From 9035122c5ffae9c926f15d992671b23d5317912f Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 9 Apr 2001 23:43:09 +0000 Subject: [PATCH] - Now when Window Maker calls wmsetbg to set the background, it will pass the correct switch to it, depending on the value of the DisableDithering option. - Replaced some functions with macros in WINGs (wmkpoint(), wmksize() and wmkrange()). They're less expensive to call this way. - Fixed a memleak in the info panel. --- ChangeLog | 4 ++++ WINGs/ChangeLog | 3 ++- WINGs/WINGs/WINGs.h | 15 +++++---------- WINGs/WINGs/WUtil.h | 4 ++-- WINGs/handlers.c | 1 - WINGs/host.c | 1 + WINGs/wevent.c | 10 ---------- WINGs/wmisc.c | 37 ------------------------------------- src/defaults.c | 21 +++++++++++++-------- src/dialog.c | 7 +++++-- 10 files changed, 32 insertions(+), 71 deletions(-) diff --git a/ChangeLog b/ChangeLog index 05be18ea..e6712fa6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,10 @@ Changes since version 0.64.0: - fixed bug with multibyte text on libc5 systems (Osamu Ajiki ) - fixed race conditions on signal handlers - SIGINT will gently exit, SIGTERM will not be handled +- When Window Maker calls wmsetbg to set the background, it will consider the + value of the DisableDithering option and pass the right switch to wmsetbg. +- fixed a memleak in the dialog panels. + Changes since version 0.63.1: ............................. diff --git a/WINGs/ChangeLog b/WINGs/ChangeLog index 2fe5ebcb..8a014608 100644 --- a/WINGs/ChangeLog +++ b/WINGs/ChangeLog @@ -11,13 +11,14 @@ Changes since wmaker 0.64.0: - fixed mem leak that occured when input handling was done with poll - simpler and more straightforward event handling for timer, idle, input and X events (also fixed some problems the old handling logic had) -- moved timer, dile and input handler definitions and prototypes from +- moved timer, idle and input handler definitions and prototypes from WINGs.h to WUtil.h because they're not GUI related. - better and more robust handling of events (timer, idle, input, X) in WMMaskEvent(). Also fixed a bug where input and timer events were not treated for undefined periods of time under some circumstances. - fixed secure textfields not to allow text selection, to avoid compromising sensitive information by pasting it to a terminal. +- replaced wmkrange(), wmkpoint() and wmksize() functions with macros. changes since wmaker 0.63.1: diff --git a/WINGs/WINGs/WINGs.h b/WINGs/WINGs/WINGs.h index a71cdeda..b8a512ae 100644 --- a/WINGs/WINGs/WINGs.h +++ b/WINGs/WINGs/WINGs.h @@ -36,8 +36,12 @@ typedef struct { WMSize size; } WMRect; +#define wmksize(width, height) (WMSize){(width), (height)} +#define wmkpoint(x, y) (WMPoint){(x), (y)} +#define wmkrect(pos, size) (WMRect){(pos), (size)} + + -/* WMRange was moved in WUtil.h */ #define ClientMessageMask (1L<<30) @@ -573,15 +577,6 @@ typedef struct W_DragDestinationProcs { -/* ...................................................................... */ - - -WMRange wmkrange(int start, int count); - -WMPoint wmkpoint(int x, int y); - -WMSize wmksize(unsigned int width, unsigned int height); - /* ....................................................................... */ diff --git a/WINGs/WINGs/WUtil.h b/WINGs/WINGs/WUtil.h index ac747832..085450f0 100644 --- a/WINGs/WINGs/WUtil.h +++ b/WINGs/WINGs/WUtil.h @@ -149,12 +149,13 @@ typedef int WMMatchDataProc(void *item, void *cdata); - typedef struct { int position; int count; } WMRange; +#define wmkrange(position, count) (WMRange){(position), (count)} + /* DO NOT ACCESS THE CONTENTS OF THIS STRUCT */ @@ -474,7 +475,6 @@ void WMPutInBag(WMBag *bag, void *item); /* insert will increment the index of elements after it by 1 */ void WMInsertInBag(WMBag *bag, int index, void *item); -/* this is slow */ /* erase will remove the element from the bag, * but will keep the index of the other elements unchanged */ int WMEraseFromBag(WMBag *bag, int index); diff --git a/WINGs/handlers.c b/WINGs/handlers.c index 6383049b..c81b2b6e 100644 --- a/WINGs/handlers.c +++ b/WINGs/handlers.c @@ -55,7 +55,6 @@ static WMBag *idleHandler=NULL; static WMBag *inputHandler=NULL; -// this should go to wevent.c and wutil.c too #define timerPending() (timerHandler) diff --git a/WINGs/host.c b/WINGs/host.c index c42162c0..212575ae 100644 --- a/WINGs/host.c +++ b/WINGs/host.c @@ -261,6 +261,7 @@ WMIsHostEqualToHost(WMHost* hPtr, WMHost* aPtr) for (i=0; iaddresses); i++) { adr1 = WMGetFromArray(aPtr->addresses, i); + // use WMFindInArray here --Dan for (j=0; jaddresses); j++) { adr2 = WMGetFromArray(hPtr->addresses, j); if (strcmp(adr1, adr2)==0) diff --git a/WINGs/wevent.c b/WINGs/wevent.c index f2f8fa9c..91528e1e 100644 --- a/WINGs/wevent.c +++ b/WINGs/wevent.c @@ -444,16 +444,6 @@ WMNextEvent(Display *dpy, XEvent *event) } -/* - * Is this comment still valid? - * waitForEvent seems now to understand masked events. -Dan - * - * Cant use this because XPending() will make waitForEvent - * return even if the event in the queue is not what we want, - * and if we block until some new event arrives from the - * server, other events already in the queue (like Expose) - * will be deferred. - */ void WMMaskEvent(Display *dpy, long mask, XEvent *event) { diff --git a/WINGs/wmisc.c b/WINGs/wmisc.c index 68605f3b..54943c4c 100644 --- a/WINGs/wmisc.c +++ b/WINGs/wmisc.c @@ -316,42 +316,5 @@ W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font, -WMRange -wmkrange(int start, int count) -{ - WMRange range; - - range.position = start; - range.count = count; - - return range; -} - - -WMPoint -wmkpoint(int x, int y) -{ - WMPoint point; - - point.x = x; - point.y = y; - - return point; -} - - -WMSize -wmksize(unsigned int width, unsigned int height) -{ - WMSize size; - - size.width = width; - size.height = height; - - return size; -} - - - diff --git a/src/defaults.c b/src/defaults.c index 3d74b0e5..c72f552f 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -3134,18 +3134,21 @@ setWorkspaceSpecificBack(WScreen *scr, WDefaultEntry *entry, proplist_t value, if (close(filedes[1]) < 0) wsyserror("could not close pipe"); - } else if (pid == 0) { + } else if (pid == 0) { + char *dither; + SetupEnvironment(scr); if (close(0) < 0) wsyserror("could not close pipe"); if (dup(filedes[0]) < 0) { wsyserror("dup() failed:can't set workspace specific background image"); - } + } + dither = wPreferences.no_dithering ? "-m" : "-d"; if (wPreferences.smooth_workspace_back) - execlp("wmsetbg", "wmsetbg", "-helper", "-S", "-d", NULL); + execlp("wmsetbg", "wmsetbg", "-helper", "-S", dither, NULL); else - execlp("wmsetbg", "wmsetbg", "-helper", "-d", NULL); + execlp("wmsetbg", "wmsetbg", "-helper", dither, NULL); wsyserror("could not execute wmsetbg"); exit(1); } else { @@ -3209,15 +3212,17 @@ setWorkspaceBack(WScreen *scr, WDefaultEntry *entry, proplist_t value, } } else if (PLGetNumberOfElements(value) > 0) { char *command; - char *text; + char *text; + char *dither; SetupEnvironment(scr); text = PLGetDescription(value); - command = wmalloc(strlen(text)+40); + command = wmalloc(strlen(text)+40); + dither = wPreferences.no_dithering ? "-m" : "-d"; if (wPreferences.smooth_workspace_back) - sprintf(command, "wmsetbg -d -S -p '%s' &", text); + sprintf(command, "wmsetbg %s -S -p '%s' &", dither, text); else - sprintf(command, "wmsetbg -d -p '%s' &", text); + sprintf(command, "wmsetbg %s -p '%s' &", dither, text); wfree(text); system(command); wfree(command); diff --git a/src/dialog.c b/src/dialog.c index c61cbc82..8ff12d91 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -808,6 +808,9 @@ destroyInfoPanel(WCoreWindow *foo, void *data, XEvent *event) if (thePanel->oldPix) { WMReleasePixmap(thePanel->oldPix); } + if (thePanel->oldFont) { + WMReleaseFont(thePanel->oldFont); + } if (thePanel->icon) { RDestroyImage(thePanel->icon); } @@ -1068,8 +1071,8 @@ handleLogoPush(XEvent *event, void *data) "WHAT YOU SAY??", "WE GET SIGNAL", "SOMEBODY SET UP US THE BOMB", - "ALL YOUR BASE ARE BELONG TO US!" - + "ALL YOUR BASE ARE BELONG TO US!", + "Oh My God!!! Larry is back!" };