[Pkg-wmaker-commits] [wmload] 16/58: wmload: Incorporate changes from asload-0.9.3.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Mon Aug 24 23:36:19 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmload.
commit 33973075af7ae9fb37934a72923400a3e22c1e24
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date: Tue Apr 7 02:45:16 2015 -0500
wmload: Incorporate changes from asload-0.9.3.
Obtained from [1].
[1] http://tigr.net/afterstep/download/asload/asload-0.9.3.tar.gz
---
ChangeLog | 7 +++++++
wmload.c | 25 +++++++++++++++++--------
2 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 270dc7a..025865b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+VERSION: 0.9.3
+RELEASE DATE: 03 March 2000 (sashav at sprintmail.com)
+ -added range check for values. It seems that on 2.3 kernels
+ time can go backwards :)
+ -Destroying Icon window prior to main window to avoid shutdown
+ time errors
+
VERSION: 0.9.2
RELEASE DATE: 17 July 1997
diff --git a/wmload.c b/wmload.c
index 6e6199f..78ee558 100644
--- a/wmload.c
+++ b/wmload.c
@@ -17,7 +17,7 @@
#define major_VER 0
#define minor_VER 9
-#define patch_VER 2
+#define patch_VER 3
#define MW_EVENTS (ExposureMask | ButtonPressMask | StructureNotifyMask)
#define FALSE 0
#define Shape(num) (ONLYSHAPE ? num-5 : num)
@@ -105,6 +105,7 @@ int main(int argc,char *argv[])
XTextProperty name;
XClassHint classHint;
Pixmap pixmask;
+ Atom _XA_WM_DELETE_WINDOW = None;
Geometry = "";
mywmhints.initial_state = NormalState;
@@ -169,7 +170,8 @@ int main(int argc,char *argv[])
Root = RootWindow(dpy, screen);
d_depth = DefaultDepth(dpy, screen);
x_fd = XConnectionNumber(dpy);
-
+ _XA_WM_DELETE_WINDOW = XInternAtom (dpy, "WM_DELETE_WINDOW", False);
+
/* Convert XPM Data to XImage */
GetXPM();
@@ -231,6 +233,7 @@ int main(int argc,char *argv[])
mywmhints.flags = StateHint | IconWindowHint | IconPositionHint
| WindowGroupHint;
XSetWMHints(dpy, win, &mywmhints);
+ XSetWMProtocols (dpy, win, &_XA_WM_DELETE_WINDOW, 1);
XMapWindow(dpy,win);
InitLoad();
@@ -261,12 +264,17 @@ int main(int argc,char *argv[])
case ButtonPress:
system(Execute);
break;
+ case ClientMessage:
+ if ((Event.xclient.format != 32) ||
+ (Event.xclient.data.l[0] != _XA_WM_DELETE_WINDOW))
+ break;
case DestroyNotify:
- XFreeGC(dpy, NormalGC);
- XDestroyWindow(dpy, win);
+ XFreeGC(dpy, NormalGC);
XDestroyWindow(dpy, iconwin);
+ XDestroyWindow(dpy, win);
XCloseDisplay(dpy);
exit(0);
+ break ;
default:
break;
}
@@ -433,10 +441,11 @@ void GetLoad(int Maximum, int *usr, int *nice, int *sys, int *free)
cp_time[2] = strtoul(p, &p, 0); /* system */
cp_time[3] = strtoul(p, &p, 0); /* idle */
- *usr = cp_time[0] - last[0];
- *nice = cp_time[1] - last[1];
- *sys = cp_time[2] - last[2];
- *free = cp_time[3] - last[3];
+ if( (*usr = cp_time[0] - last[0]) < 0 ) *usr = 0 ;
+ if( (*nice = cp_time[1] - last[1]) < 0 ) *nice = 0 ;
+ if( (*sys = cp_time[2] - last[2]) < 0 ) *sys = 0 ;
+ if( (*free = cp_time[3] - last[3]) < 0 ) *free = 0 ;
+
total = *usr + *nice + *sys + *free;
last[0] = cp_time[0];
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmload.git
More information about the Pkg-wmaker-commits
mailing list