diff --git a/ChangeLog b/ChangeLog index 6013d260..085cc2a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,16 @@ Changes since version 0.53.0: - fixed a bug that caused icon overlaping in Clip, when icon was moved around. - this time really added libwmfun to distribution. +- made deiconification not automatically focus window in sloppy focus +- fixed crash with DisableMiniwindows and icon pixmap changes +- fixed crash when changing icon of window without WM_CLASS +- added IAmAnnoyingAndDontWantWorkspaceNameDisplay +- added hysteresys for offscreen menu scrollback +- fixed bug with IgnoreFocusClick +- fixed crash with windows with width == 1 (Alban Hertroys + ) +- added SHEXEC command +- fixed resizebarback for SHADOW_RESIZEBAR ( jim knoble jmknoble@pobox.com) Changes since version 0.52.0: diff --git a/NEWS b/NEWS index f6af6e9f..3bae3d42 100644 --- a/NEWS +++ b/NEWS @@ -2,15 +2,35 @@ NEWS for veteran Window Maker users ----------------------------------- +--- 0.53.1 + +New Option For setstyle +----------------------- + +The --ignore flag will tell setstyle to not change the option that is +specified, when modifying the Window Maker configurations. For example: + +setstyle --ignore MenuStyle sometheme.themed will cause the MenuStyle +option to not be changed. + +setstyle --ignore FTitleBack --ignore UTitleBack --ignore PTitleBack bla.themed +will load the theme, but keep the titlebar background related options as +before. + + +root menu +--------- + +EXEC will execute the named program + +SHEXEC will execute the shell command. + +If you want to execute something like blabla > /dev/null, then use SHEXEC + + + --- 0.53.0 - -KDE 1.1 compatibility ---------------------- - - - - New Options ----------- diff --git a/WINGs/ChangeLog b/WINGs/ChangeLog index 95f9529c..fbdf7317 100644 --- a/WINGs/ChangeLog +++ b/WINGs/ChangeLog @@ -1,3 +1,9 @@ +changes since wmaker 0.53.0: +............................ + +- added balloon help + + changes since wmaker 0.52.0: ............................ diff --git a/WINGs/Makefile.am b/WINGs/Makefile.am index 4a7568e8..c46ca1ed 100644 --- a/WINGs/Makefile.am +++ b/WINGs/Makefile.am @@ -67,6 +67,7 @@ libWINGs_a_SOURCES = \ selection.c \ userdefaults.c \ wapplication.c \ + wballoon.c \ wbrowser.c \ wbutton.c \ wcolor.c \ diff --git a/WINGs/Makefile.in b/WINGs/Makefile.in index c27da256..11318ea1 100644 --- a/WINGs/Makefile.in +++ b/WINGs/Makefile.in @@ -139,7 +139,7 @@ wmquery_LDADD = libWINGs.a $(LIBLIST) EXTRA_DIST = logo.xpm # wbutton.c -libWINGs_a_SOURCES = WINGs.h WINGsP.h configuration.c llist.h llist.c international.c notification.c selection.c userdefaults.c wapplication.c wbrowser.c wbutton.c wcolor.c wcolorpanel.c wcolorwell.c wevent.c wfilepanel.c wframe.c wfont.c wfontpanel.c widgets.c wlabel.c wlist.c wmisc.c wpanel.c wpixmap.c wpopupbutton.c wscroller.c wscrollview.c wslider.c wsplitview.c wtextfield.c wwindow.c wview.c error.c findfile.c hashtable.c memory.c usleep.c +libWINGs_a_SOURCES = WINGs.h WINGsP.h configuration.c llist.h llist.c international.c notification.c selection.c userdefaults.c wapplication.c wballoon.c wbrowser.c wbutton.c wcolor.c wcolorpanel.c wcolorwell.c wevent.c wfilepanel.c wframe.c wfont.c wfontpanel.c widgets.c wlabel.c wlist.c wmisc.c wpanel.c wpixmap.c wpopupbutton.c wscroller.c wscrollview.c wslider.c wsplitview.c wtextfield.c wwindow.c wview.c error.c findfile.c hashtable.c memory.c usleep.c INCLUDES = -I$(top_srcdir)/wrlib -I$(top_srcdir)/src -DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@ -DDEBUG @@ -159,12 +159,12 @@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ libWINGs_a_LIBADD = libWINGs_a_OBJECTS = configuration.o llist.o international.o \ -notification.o selection.o userdefaults.o wapplication.o wbrowser.o \ -wbutton.o wcolor.o wcolorpanel.o wcolorwell.o wevent.o wfilepanel.o \ -wframe.o wfont.o wfontpanel.o widgets.o wlabel.o wlist.o wmisc.o \ -wpanel.o wpixmap.o wpopupbutton.o wscroller.o wscrollview.o wslider.o \ -wsplitview.o wtextfield.o wwindow.o wview.o error.o findfile.o \ -hashtable.o memory.o usleep.o +notification.o selection.o userdefaults.o wapplication.o wballoon.o \ +wbrowser.o wbutton.o wcolor.o wcolorpanel.o wcolorwell.o wevent.o \ +wfilepanel.o wframe.o wfont.o wfontpanel.o widgets.o wlabel.o wlist.o \ +wmisc.o wpanel.o wpixmap.o wpopupbutton.o wscroller.o wscrollview.o \ +wslider.o wsplitview.o wtextfield.o wwindow.o wview.o error.o \ +findfile.o hashtable.o memory.o usleep.o AR = ar PROGRAMS = $(noinst_PROGRAMS) diff --git a/WINGs/Resources/Makefile.in b/WINGs/Resources/Makefile.in index a8bf066a..6451bfc8 100644 --- a/WINGs/Resources/Makefile.in +++ b/WINGs/Resources/Makefile.in @@ -108,9 +108,9 @@ GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WINGs/Resources/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu WINGs/Resources/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -142,6 +142,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = WINGs/Resources distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu WINGs/Resources/Makefile @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ diff --git a/WINGs/WINGs.h b/WINGs/WINGs.h index 0bf842ca..836d17c4 100644 --- a/WINGs/WINGs.h +++ b/WINGs/WINGs.h @@ -639,6 +639,22 @@ extern char *WMViewSizeDidChangeNotification; extern char *WMViewRealizedNotification; + +/* ....................................................................... */ + +void WMSetBalloonTextForView(char *text, WMView *view); + +void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment); + +void WMSetBalloonFont(WMScreen *scr, WMFont *font); + +void WMSetBalloonTextColor(WMScreen *scr, WMColor *color); + +void WMSetBalloonDelay(WMScreen *scr, int delay); + +void WMSetBalloonEnabled(WMScreen *scr, Bool flag); + + /* ....................................................................... */ WMWindow *WMCreateWindow(WMScreen *screen, char *name); diff --git a/WINGs/WINGsP.h b/WINGs/WINGsP.h index ee5619e0..3ce51abc 100644 --- a/WINGs/WINGsP.h +++ b/WINGs/WINGsP.h @@ -134,7 +134,9 @@ typedef struct W_Screen { struct W_FontPanel *sharedFontPanel; struct W_ColorPanel *sharedColorPanel; - + + Pixmap stipple; + /* colors */ W_Color *white; W_Color *black; @@ -432,3 +434,8 @@ void W_FlushASAPNotificationQueue(); void W_FlushIdleNotificationQueue(); +struct W_Balloon *W_CreateBalloon(WMScreen *scr); + +void W_BalloonHandleEnterView(WMView *view); + +void W_BalloonHandleLeaveView(WMView *view); diff --git a/WINGs/wballoon.c b/WINGs/wballoon.c new file mode 100644 index 00000000..ed8d1e24 --- /dev/null +++ b/WINGs/wballoon.c @@ -0,0 +1,473 @@ + + + + +#include "WINGsP.h" + +#include + + +typedef struct W_Balloon { + W_View *view; + + WMHashTable *table; /* Table from view ptr to text */ + + WMColor *backColor; + WMColor *textColor; + WMFont *font; + + WMHandlerID timer; /* timer for showing balloon */ + + WMHandlerID noDelayTimer; + + int delay; + + Window forWindow; /* window for which the balloon + * is being show in the moment */ + + struct { + WMAlignment alignment:2; + unsigned enabled:1; + unsigned noDelay:1; + } flags; +} Balloon; + + + +#define DEFAULT_WIDTH 60 +#define DEFAULT_HEIGHT 14 +#define DEFAULT_ALIGNMENT WALeft +#define DEFAULT_DELAY 500 + +#define NO_DELAY_DELAY 150 + + +static void destroyBalloon(Balloon *bPtr); + + +static void handleEvents(XEvent *event, void *data); + +static void showText(Balloon *bPtr, int x, int y, int w, int h, char *text); + + +struct W_Balloon* +W_CreateBalloon(WMScreen *scr) +{ + Balloon *bPtr; + + bPtr = wmalloc(sizeof(Balloon)); + memset(bPtr, 0, sizeof(Balloon)); + + bPtr->view = W_CreateTopView(scr); + if (!bPtr->view) { + free(bPtr); + return NULL; + } + bPtr->view->self = bPtr; + + bPtr->view->attribFlags |= CWOverrideRedirect; + bPtr->view->attribs.override_redirect = True; + + bPtr->textColor = WMRetainColor(bPtr->view->screen->black); + + WMCreateEventHandler(bPtr->view, StructureNotifyMask, handleEvents, bPtr); + + W_ResizeView(bPtr->view, DEFAULT_WIDTH, DEFAULT_HEIGHT); + bPtr->flags.alignment = DEFAULT_ALIGNMENT; + + bPtr->table = WMCreateHashTable(WMIntHashCallbacks); + + bPtr->delay = DEFAULT_DELAY; + + bPtr->flags.enabled = 1; + + return bPtr; +} + + + +void +WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment) +{ + scr->balloon->flags.alignment = alignment; + +} + + +void +WMSetBalloonTextForView(char *text, WMView *view) +{ + char *oldText = NULL; + WMScreen *scr = view->screen; + + if (text) { + oldText = WMHashInsert(scr->balloon->table, view, wstrdup(text)); + } else { + oldText = WMHashGet(scr->balloon->table, view); + + WMHashRemove(scr->balloon->table, view); + } + + if (oldText) { + free(oldText); + } +} + + +void +WMSetBalloonFont(WMScreen *scr, WMFont *font) +{ + Balloon *bPtr = scr->balloon; + + if (bPtr->font!=NULL) + WMReleaseFont(bPtr->font); + + if (font) + bPtr->font = WMRetainFont(font); + else + bPtr->font = NULL; +} + + +void +WMSetBalloonTextColor(WMScreen *scr, WMColor *color) +{ + Balloon *bPtr = scr->balloon; + + if (bPtr->textColor) + WMReleaseColor(bPtr->textColor); + + bPtr->textColor = WMRetainColor(color); +} + + +void +WMSetBalloonDelay(WMScreen *scr, int delay) +{ + scr->balloon->delay = delay; +} + + +void +WMSetBalloonEnabled(WMScreen *scr, Bool flag) +{ + scr->balloon->flags.enabled = flag; + + W_UnmapView(scr->balloon->view); +} + + +static void +clearNoDelay(void *data) +{ + Balloon *bPtr = (Balloon*)data; + + bPtr->flags.noDelay = 0; + bPtr->noDelayTimer = NULL; +} + + +void +W_BalloonHandleLeaveView(WMView *view) +{ + Balloon *bPtr = view->screen->balloon; + + if (bPtr->view->flags.mapped && bPtr->forWindow == view->window) { + W_UnmapView(bPtr->view); + + if (bPtr->timer) + WMDeleteTimerHandler(bPtr->timer); + + bPtr->timer = NULL; + + bPtr->noDelayTimer = WMAddTimerHandler(NO_DELAY_DELAY, clearNoDelay, + bPtr); + } + bPtr->forWindow = None; +} + + +static void +showBalloon(void *data) +{ + char *text; + WMView *view = (WMView*)data; + Balloon *bPtr = view->screen->balloon; + int x, y; + Window foo; + + bPtr->timer = NULL; + + text = WMHashGet(bPtr->table, view); + if (!text) + return; + + XTranslateCoordinates(view->screen->display, view->window, + view->screen->rootWin, 0, 0, &x, &y, &foo); + + if (!bPtr->view->flags.realized) + W_RealizeView(bPtr->view); + + showText(bPtr, x, y, view->size.width, view->size.height, text); + + bPtr->forWindow = view->window; + + bPtr->flags.noDelay = 1; +} + + + +void +W_BalloonHandleEnterView(WMView *view) +{ + Balloon *bPtr = view->screen->balloon; + char *text; + + if (!bPtr->flags.enabled) + return; + + text = WMHashGet(bPtr->table, view); + if (!text) { + bPtr->forWindow = None; + + if (bPtr->view->flags.realized) + W_UnmapView(bPtr->view); + + return; + } + + if (bPtr->timer) + WMDeleteTimerHandler(bPtr->timer); + + if (bPtr->noDelayTimer) + WMDeleteTimerHandler(bPtr->noDelayTimer); + bPtr->noDelayTimer = NULL; + + if (bPtr->flags.noDelay) { + bPtr->timer = NULL; + + showBalloon(view); + } else { + bPtr->timer = WMAddTimerHandler(bPtr->delay, showBalloon, view); + } +} + + +#define TOP 0 +#define BOTTOM 1 +#define LEFT 0 +#define RIGHT 2 + +#define TLEFT (TOP|LEFT) +#define TRIGHT (TOP|RIGHT) +#define BLEFT (BOTTOM|LEFT) +#define BRIGHT (BOTTOM|RIGHT) + + + +#define SPACE 12 + + +static void +drawBalloon(Display *dpy, Pixmap pix, GC gc, int x, int y, int w, int h, + int side) +{ + int rad = h*3/10; + XPoint pt[3]; + + XFillArc(dpy, pix, gc, x, y, rad, rad, 90*64, 90*64); + XFillArc(dpy, pix, gc, x, y+h-1-rad, rad, rad, 180*64, 90*64); + + XFillArc(dpy, pix, gc, x+w-1-rad, y, rad, rad, 0*64, 90*64); + XFillArc(dpy, pix, gc, x+w-1-rad, y+h-1-rad, rad, rad, 270*64, 90*64); + + XFillRectangle(dpy, pix, gc, x, y+rad/2, w, h-rad); + XFillRectangle(dpy, pix, gc, x+rad/2, y, w-rad, h); + + if (side & BOTTOM) { + pt[0].y = y+h-1; + pt[1].y = y+h-1+SPACE; + pt[2].y = y+h-1; + } else { + pt[0].y = y; + pt[1].y = y-SPACE; + pt[2].y = y; + } + if (side & RIGHT) { + pt[0].x = x+w-h+2*h/16; + pt[1].x = x+w-h+11*h/16; + pt[2].x = x+w-h+7*h/16; + } else { + pt[0].x = x+h-2*h/16; + pt[1].x = x+h-11*h/16; + pt[2].x = x+h-7*h/16; + } + XFillPolygon(dpy, pix, gc, pt, 3, Convex, CoordModeOrigin); +} + + +static Pixmap +makePixmap(WMScreen *scr, int width, int height, int side, Pixmap *mask) +{ + Display *dpy = WMScreenDisplay(scr); + Pixmap bitmap; + Pixmap pixmap; + int x, y; + WMColor *black = WMBlackColor(scr); + WMColor *white = WMWhiteColor(scr); + + bitmap = XCreatePixmap(dpy, scr->rootWin, width+SPACE, height+SPACE, 1); + + XSetForeground(dpy, scr->monoGC, 0); + XFillRectangle(dpy, bitmap, scr->monoGC, 0, 0, width+SPACE, height+SPACE); + + pixmap = XCreatePixmap(dpy, scr->rootWin, width+SPACE, height+SPACE, + scr->depth); + + XFillRectangle(dpy, pixmap, WMColorGC(black), 0, 0, + width+SPACE, height+SPACE); + + if (side & BOTTOM) { + y = 0; + } else { + y = SPACE; + } + x = 0; + + XSetForeground(dpy, scr->monoGC, 1); + drawBalloon(dpy, bitmap, scr->monoGC, x, y, width, height, side); + drawBalloon(dpy, pixmap, WMColorGC(white), x+1, y+1, width-2, height-2, + side); + + *mask = bitmap; + + WMReleaseColor(black); + WMReleaseColor(white); + + return pixmap; +} + + +static void +showText(Balloon *bPtr, int x, int y, int h, int w, char *text) +{ + WMScreen *scr = bPtr->view->screen; + Display *dpy = WMScreenDisplay(scr); + int width; + int height; + Pixmap pixmap; + Pixmap mask; + WMFont *font = bPtr->font ? bPtr->font : scr->normalFont; + int textHeight; + int side = 0; + int ty; + int bx, by; + + { + int w; + char *ptr, *ptr2; + + ptr = text; + width = 0; + while (ptr && ptr2) { + ptr2 = strchr(ptr, '\n'); + if (ptr2) { + w = WMWidthOfString(font, ptr, ptr2 - ptr); + } else { + w = WMWidthOfString(font, ptr, strlen(ptr)); + } + if (w > width) + width = w; + ptr = ptr2 + 1; + } + } + + width += 16; + + textHeight = W_GetTextHeight(font, text, width, False); + + height = textHeight + 4; + + if (height < 16) + height = 16; + if (width < height) + width = height; + + if (x + width > scr->rootView->size.width) { + side = RIGHT; + bx = x - width + w/2; + if (bx < 0) + bx = 0; + } else { + side = LEFT; + bx = x + w/2; + } + if (bx + width > scr->rootView->size.width) + bx = scr->rootView->size.width - width; + + if (y - (height + SPACE) < 0) { + side |= TOP; + by = y+h-1; + ty = SPACE; + } else { + side |= BOTTOM; + by = y - (height + SPACE); + ty = 0; + } + pixmap = makePixmap(scr, width, height, side, &mask); + + W_PaintText(bPtr->view, pixmap, font, 8, ty + (height - textHeight)/2, + width, bPtr->flags.alignment, + WMColorGC(bPtr->textColor ? bPtr->textColor : scr->black), + False, text, strlen(text)); + + XSetWindowBackgroundPixmap(dpy, bPtr->view->window, pixmap); + + W_ResizeView(bPtr->view, width, height+SPACE); + + XFreePixmap(dpy, pixmap); + + XShapeCombineMask(dpy, bPtr->view->window, ShapeBounding, 0, 0, mask, + ShapeSet); + XFreePixmap(dpy, mask); + + W_MoveView(bPtr->view, bx, by); + + W_MapView(bPtr->view); +} + + +static void +handleEvents(XEvent *event, void *data) +{ + Balloon *bPtr = (Balloon*)data; + + switch (event->type) { + case DestroyNotify: + destroyBalloon(bPtr); + break; + } +} + + +static void +destroyBalloon(Balloon *bPtr) +{ + WMHashEnumerator e; + char *str; + + e = WMEnumerateHashTable(bPtr->table); + + while ((str = WMNextHashEnumeratorItem(&e))) { + free(str); + } + WMFreeHashTable(bPtr->table); + + if (bPtr->textColor) + WMReleaseColor(bPtr->textColor); + + if (bPtr->font) + WMReleaseFont(bPtr->font); + + free(bPtr); +} diff --git a/WINGs/wbutton.c b/WINGs/wbutton.c index 70600ec6..d6e3cbe7 100644 --- a/WINGs/wbutton.c +++ b/WINGs/wbutton.c @@ -13,10 +13,12 @@ typedef struct W_Button { char *altCaption; WMFont *font; - + W_Pixmap *image; W_Pixmap *altImage; + W_Pixmap *dimage; + void *clientData; WMAction *action; @@ -231,14 +233,62 @@ WMCreateButton(WMWidget *parent, WMButtonType type) } +static void +updateDisabledMask(WMButton *bPtr) +{ + WMScreen *scr = WMWidgetScreen(bPtr); + Display *dpy = scr->display; + + if (bPtr->image) { + XGCValues gcv; + + bPtr->dimage->mask = XCreatePixmap(dpy, scr->stipple, + bPtr->dimage->width, + bPtr->dimage->height, 1); + + XSetForeground(dpy, scr->monoGC, 0); + XFillRectangle(dpy, bPtr->dimage->mask, scr->monoGC, 0, 0, + bPtr->dimage->width, bPtr->dimage->height); + + gcv.foreground = 1; + gcv.background = 0; + gcv.stipple = scr->stipple; + gcv.fill_style = FillStippled; + gcv.clip_mask = bPtr->image->mask; + gcv.clip_x_origin = 0; + gcv.clip_y_origin = 0; + + XChangeGC(dpy, scr->monoGC, GCForeground|GCBackground|GCStipple + |GCFillStyle|GCClipMask|GCClipXOrigin|GCClipYOrigin, &gcv); + + XFillRectangle(dpy, bPtr->dimage->mask, scr->monoGC, 0, 0, + bPtr->dimage->width, bPtr->dimage->height); + + gcv.fill_style = FillSolid; + gcv.clip_mask = None; + XChangeGC(dpy, scr->monoGC, GCFillStyle|GCClipMask, &gcv); + } +} + + void WMSetButtonImage(WMButton *bPtr, WMPixmap *image) { if (bPtr->image!=NULL) WMReleasePixmap(bPtr->image); bPtr->image = WMRetainPixmap(image); - - + + if (bPtr->dimage) { + bPtr->dimage->pixmap = None; + WMReleasePixmap(bPtr->dimage); + } + + bPtr->dimage = WMCreatePixmapFromXPixmaps(WMWidgetScreen(bPtr), + image->pixmap, None, + image->width, image->height, + image->depth); + updateDisabledMask(bPtr); + if (bPtr->view->flags.realized) { paintButton(bPtr); } @@ -502,7 +552,10 @@ paintButton(Button *bPtr) gc = NULL; caption = bPtr->caption; - image = bPtr->image; + if (bPtr->flags.enabled) + image = bPtr->image; + else + image = bPtr->dimage; offset = 0; if (bPtr->flags.bordered) relief = WRRaised; @@ -689,7 +742,7 @@ destroyButton(Button *bPtr) if (bPtr->flags.addedObserver) { WMRemoveNotificationObserver(bPtr); } - + if (bPtr->timer) WMDeleteTimerHandler(bPtr->timer); @@ -704,7 +757,13 @@ destroyButton(Button *bPtr) if (bPtr->image) WMReleasePixmap(bPtr->image); - + + if (bPtr->dimage) { + /* yuck.. kluge */ + bPtr->dimage->pixmap = None; + + WMReleasePixmap(bPtr->dimage); + } if (bPtr->altImage) WMReleasePixmap(bPtr->altImage); diff --git a/WINGs/wevent.c b/WINGs/wevent.c index e38cf551..93a828b5 100644 --- a/WINGs/wevent.c +++ b/WINGs/wevent.c @@ -586,7 +586,7 @@ WMHandleEvent(XEvent *event) return False; } - + view->screen->lastEventTime = getEventTime(view->screen, event); toplevel = W_TopLevelOfView(view); @@ -637,6 +637,12 @@ WMHandleEvent(XEvent *event) } } + /* do balloon stuffs */ + if (event->type == EnterNotify) + W_BalloonHandleEnterView(view); + else if (event->type == LeaveNotify) + W_BalloonHandleLeaveView(view); + /* This is a hack. It will make the panel be secure while * the event handlers are handled, as some event handler * might destroy the widget. */ diff --git a/WINGs/widgets.c b/WINGs/widgets.c index 13c84745..a1e88542 100644 --- a/WINGs/widgets.c +++ b/WINGs/widgets.c @@ -297,10 +297,9 @@ static char *CHECK_MARK[] = { "#%======="}; -#define STIPPLE_WIDTH 8 -#define STIPPLE_HEIGHT 8 -static unsigned char STIPPLE_BITS[] = { - 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa}; +#define STIPPLE_WIDTH 2 +#define STIPPLE_HEIGHT 2 +static unsigned char STIPPLE_BITS[] = {0x01, 0x02}; extern void W_ReadConfigurations(void); @@ -632,9 +631,8 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context) /* we need a 1bpp drawable for the monoGC, so borrow this one */ scrPtr->monoGC = XCreateGC(display, stipple, 0, NULL); - XFreePixmap(display, stipple); - - + scrPtr->stipple = stipple; + scrPtr->normalFont = WMSystemFontOfSize(scrPtr, 12); scrPtr->boldFont = WMBoldSystemFontOfSize(scrPtr, 12); @@ -741,6 +739,10 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context) scrPtr->rootView = W_CreateRootView(scrPtr); + + scrPtr->balloon = W_CreateBalloon(scrPtr); + + W_InitApplication(scrPtr); return scrPtr; diff --git a/WINGs/wmisc.c b/WINGs/wmisc.c index 7cdbaca1..1647a951 100644 --- a/WINGs/wmisc.c +++ b/WINGs/wmisc.c @@ -172,7 +172,7 @@ W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y, void W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font, WMReliefType relief, char *text, - WMAlignment alignment, W_Pixmap *image, + WMAlignment alignment, W_Pixmap *image, WMImagePosition position, GC backGC, int ofs) { W_Screen *screen = view->screen; @@ -264,7 +264,7 @@ W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font, ix += ofs; iy += ofs; - + XSetClipOrigin(screen->display, screen->clipGC, ix, iy); XSetClipMask(screen->display, screen->clipGC, image->mask); diff --git a/WINGs/wpixmap.c b/WINGs/wpixmap.c index 49b99bb5..749418ed 100644 --- a/WINGs/wpixmap.c +++ b/WINGs/wpixmap.c @@ -22,7 +22,8 @@ WMReleasePixmap(WMPixmap *pixmap) pixmap->refCount--; if (pixmap->refCount<1) { - XFreePixmap(pixmap->screen->display, pixmap->pixmap); + if (pixmap->pixmap) + XFreePixmap(pixmap->screen->display, pixmap->pixmap); if (pixmap->mask) XFreePixmap(pixmap->screen->display, pixmap->mask); free(pixmap); diff --git a/WINGs/wtest.c b/WINGs/wtest.c index 5322101f..ff8deb68 100644 --- a/WINGs/wtest.c +++ b/WINGs/wtest.c @@ -143,6 +143,8 @@ testGradientButtons(WMScreen *scr) WMSetButtonAltImage(btn, pix2); WMSetButtonText(btn, "Cool"); + WMSetBalloonTextForView("This is a button", WMWidgetView(btn)); + btn = WMCreateButton(win, WBTMomentaryChange); WMResizeWidget(btn, 60, 24); WMMoveWidget(btn, 90, 100); @@ -152,6 +154,8 @@ testGradientButtons(WMScreen *scr) WMSetButtonAltImage(btn, pix2); WMSetButtonText(btn, "Button"); + WMSetBalloonTextForView("This is another button", WMWidgetView(btn)); + btn = WMCreateButton(win, WBTMomentaryChange); WMResizeWidget(btn, 60, 24); WMMoveWidget(btn, 160, 100); @@ -160,7 +164,10 @@ testGradientButtons(WMScreen *scr) WMSetButtonImage(btn, pix1); WMSetButtonAltImage(btn, pix2); WMSetButtonText(btn, "Test"); - + + WMSetBalloonTextForView("This is yet another button.\nBut the balloon has 3 lines.\nYay!", + WMWidgetView(btn)); + WMRealizeWidget(win); WMMapSubwidgets(win); WMMapWidget(win); @@ -409,15 +416,17 @@ int main(int argc, char **argv) * * Put the testSomething() function you want to test here. */ + testGradientButtons(scr); + #if 0 testOpenFilePanel(scr); testFontPanel(scr); testList(scr); testGradientButtons(scr); testScrollView(scr); -#endif + testColorWell(scr); -#if 1 + testSlider(scr); testTextField(scr); testPullDown(scr); diff --git a/WINGs/wview.c b/WINGs/wview.c index 51f58436..325a3488 100644 --- a/WINGs/wview.c +++ b/WINGs/wview.c @@ -102,43 +102,6 @@ adoptChildView(W_View *view, W_View *child) } -static void -handleEvents(XEvent *event, void *data) -{ - W_View *view = (W_View*)data; - - if (event->type == ConfigureNotify) { - - if (event->xconfigure.width != view->size.width - || event->xconfigure.height != view->size.height) { - - view->size.width = event->xconfigure.width; - view->size.height = event->xconfigure.height; - - if (view->flags.notifySizeChanged) { - WMPostNotificationName(WMViewSizeDidChangeNotification, - view, NULL); - } - } - if (event->xconfigure.x != view->pos.x - || event->xconfigure.y != view->pos.y) { - - if (event->xconfigure.send_event) { - view->pos.x = event->xconfigure.x; - view->pos.y = event->xconfigure.y; - } else { - Window foo; - - XTranslateCoordinates(view->screen->display, - view->window, view->screen->rootWin, - event->xconfigure.x, event->xconfigure.y, - &view->pos.x, &view->pos.y, &foo); - } - } - } -} - - static W_View* createView(W_Screen *screen, W_View *parent) { @@ -213,9 +176,6 @@ W_CreateTopView(W_Screen *screen) view->flags.topLevel = 1; view->attribs.event_mask |= StructureNotifyMask; - /* catch changes in the toplevel window (resize from user etc.) */ - WMCreateEventHandler(view, StructureNotifyMask, handleEvents, view); - return view; } diff --git a/WINGs/wwindow.c b/WINGs/wwindow.c index 42d84e6f..473ebda0 100644 --- a/WINGs/wwindow.c +++ b/WINGs/wwindow.c @@ -172,8 +172,8 @@ WMCreateWindowWithStyle(WMScreen *screen, char *name, int style) screen->windowList = win; WMCreateEventHandler(win->view, ExposureMask|StructureNotifyMask - |ClientMessageMask|FocusChangeMask, handleEvents, - win); + |ClientMessageMask|FocusChangeMask, + handleEvents, win); W_ResizeView(win->view, DEFAULT_WIDTH, DEFAULT_HEIGHT); @@ -616,6 +616,7 @@ static void handleEvents(XEvent *event, void *clientData) { _Window *win = (_Window*)clientData; + W_View *view = win->view; switch (event->type) { @@ -629,12 +630,43 @@ handleEvents(XEvent *event, void *clientData) } } break; + case UnmapNotify: WMUnmapWidget(win); break; + case DestroyNotify: destroyWindow(win); break; + + case ConfigureNotify: + if (event->xconfigure.width != view->size.width + || event->xconfigure.height != view->size.height) { + + view->size.width = event->xconfigure.width; + view->size.height = event->xconfigure.height; + + if (view->flags.notifySizeChanged) { + WMPostNotificationName(WMViewSizeDidChangeNotification, + view, NULL); + } + } + if (event->xconfigure.x != view->pos.x + || event->xconfigure.y != view->pos.y) { + + if (event->xconfigure.send_event) { + view->pos.x = event->xconfigure.x; + view->pos.y = event->xconfigure.y; + } else { + Window foo; + + XTranslateCoordinates(view->screen->display, + view->window, view->screen->rootWin, + event->xconfigure.x, event->xconfigure.y, + &view->pos.x, &view->pos.y, &foo); + } + } + break; } } diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c index 2f68f665..26cba123 100644 --- a/WPrefs.app/Menu.c +++ b/WPrefs.app/Menu.c @@ -101,23 +101,25 @@ enum { enum { CpExec = 0, - CpArrange = 1, - CpHide = 2, - CpShow = 3, - CpExit = 4, - CpShutdown = 5, - CpRestart = 6, - CpRestartWM = 7, - CpSaveSession = 8, - CpClearSession = 9, - CpRefresh = 10, - CpInfo = 11, - CpLegal = 12 + CpShExec = 1, + CpArrange = 2, + CpHide = 3, + CpShow = 4, + CpExit = 5, + CpShutdown = 6, + CpRestart = 7, + CpRestartWM = 8, + CpSaveSession = 9, + CpClearSession = 10, + CpRefresh = 11, + CpInfo = 12, + CpLegal = 13 }; enum { TNothing, TExec, + TShExec, TSimpleCommand, TRestart, TRestartWM, @@ -375,7 +377,8 @@ updateForItemType(_Panel *panel, int type) } else { WMMapWidget(panel->shoF); } - if (type==TExec || type==TRestart || type==TExternalMenu) { + if (type==TExec || type == TShExec || type==TRestart + || type==TExternalMenu) { WMMapWidget(panel->proF); } else { WMUnmapWidget(panel->proF); @@ -403,7 +406,9 @@ updateForItemType(_Panel *panel, int type) if (type == TRestart) { WMSetFrameTitle(panel->proF, _("Window Manager")); } else if (type == TExternalMenu) { - WMSetFrameTitle(panel->proF, _("Program to open files")); + WMSetFrameTitle(panel->proF, _("Program to Open Files")); + } else if (type == TShExec) { + WMSetFrameTitle(panel->proF, _("Command to Execute")); } else { WMSetFrameTitle(panel->proF, _("Program to Run")); } @@ -623,6 +628,10 @@ browserClick(WMWidget *w, void *data) WMSetTextFieldText(panel->proT, getItemParameter(item)); WMSetPopUpButtonSelectedItem(panel->cmdP, CpExec); updateForItemType(panel, TExec); + } else if (strcmp(command, "SHEXEC")==0) { + WMSetTextFieldText(panel->proT, getItemParameter(item)); + WMSetPopUpButtonSelectedItem(panel->cmdP, CpShExec); + updateForItemType(panel, TShExec); } else if (strcmp(command, "WORKSPACE_MENU")==0) { updateForItemType(panel, TWSMenu); } else if (strcmp(command, "EXIT")==0) { @@ -733,7 +742,8 @@ changedItem(void *observerData, WMNotification *notification) litem->text = str; WMRedisplayWidget(list); - } else if (strcmp(command, "EXEC")==0 + } else if (strcmp(command, "EXEC")==0 + || strcmp(command, "SHEXEC")==0 || strcmp(command, "RESTART")==0) { if (t == panel->proT) { str = WMGetTextFieldText(t); @@ -821,6 +831,15 @@ changedCommand(WMWidget *w, void *data) updateForItemType(panel, TExec); } break; + case CpShExec: + if (strcmp(getItemCommand(panel->editedItem), "SHEXEC")!=0) { + changeItemCommand(panel->editedItem, "SHEXEC"); + tmp = WMGetTextFieldText(panel->proT); + changeItemParameter(panel->editedItem, tmp); + free(tmp); + updateForItemType(panel, TShExec); + } + break; case CpArrange: if (strcmp(getItemCommand(panel->editedItem), "ARRANGE_ICONS")!=0) { changeItemCommand(panel->editedItem, "ARRANGE_ICONS"); @@ -993,7 +1012,6 @@ scrolledBrowser(void *observerData, WMNotification *notification) { _Panel *panel = (_Panel*)observerData; int column; - WMList *list; proplist_t item; column = WMGetBrowserFirstVisibleColumn(panel->browser); @@ -1132,12 +1150,13 @@ createPanel(_Panel *p) WMResizeWidget(panel->cmdP, 170, 20); WMMoveWidget(panel->cmdP, 10, 20); WMAddPopUpButtonItem(panel->cmdP, _("Run Program")); + WMAddPopUpButtonItem(panel->cmdP, _("Execute Shell Command")); WMAddPopUpButtonItem(panel->cmdP, _("Arrange Icons")); WMAddPopUpButtonItem(panel->cmdP, _("Hide Others")); WMAddPopUpButtonItem(panel->cmdP, _("Show All Windows")); WMAddPopUpButtonItem(panel->cmdP, _("Exit WindowMaker")); WMAddPopUpButtonItem(panel->cmdP, _("Exit X Session")); - WMAddPopUpButtonItem(panel->cmdP, _("Start window manager")); + WMAddPopUpButtonItem(panel->cmdP, _("Start Window Manager")); WMAddPopUpButtonItem(panel->cmdP, _("Restart WindowMaker")); WMAddPopUpButtonItem(panel->cmdP, _("Save Session")); WMAddPopUpButtonItem(panel->cmdP, _("Clear Session")); diff --git a/WPrefs.app/WPrefs.c b/WPrefs.app/WPrefs.c index 74d4654c..3edff3bf 100644 --- a/WPrefs.app/WPrefs.c +++ b/WPrefs.app/WPrefs.c @@ -303,7 +303,8 @@ createMainWindow(WMScreen *scr) WMResizeWidget(WPrefs.versionL, FRAME_WIDTH-20, 20); WMMoveWidget(WPrefs.versionL, 10, 65); WMSetLabelTextAlignment(WPrefs.versionL, WACenter); - sprintf(buffer, _("Version %s for Window Maker %s"), WVERSION, WMVERSION); + sprintf(buffer, _("Version %s for Window Maker %s or newer"), WVERSION, + WMVERSION); WMSetLabelText(WPrefs.versionL, buffer); WPrefs.statusL = WMCreateLabel(WPrefs.banner); diff --git a/WPrefs.app/WPrefs.h b/WPrefs.app/WPrefs.h index 726b2f59..d4eb460f 100644 --- a/WPrefs.app/WPrefs.h +++ b/WPrefs.app/WPrefs.h @@ -43,7 +43,7 @@ /****/ #define WVERSION "0.31" -#define WMVERSION "0.52.x" +#define WMVERSION "0.53.x" extern char *NOptionValueChanged; diff --git a/WPrefs.app/po/Makefile.in b/WPrefs.app/po/Makefile.in index fd6210b3..36dddcf9 100644 --- a/WPrefs.app/po/Makefile.in +++ b/WPrefs.app/po/Makefile.in @@ -120,9 +120,9 @@ all: all-redirect .SUFFIXES: .SUFFIXES: .mo .po $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WPrefs.app/po/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu WPrefs.app/po/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -135,6 +135,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = WPrefs.app/po distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu WPrefs.app/po/Makefile @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ diff --git a/WPrefs.app/xpm/Makefile.in b/WPrefs.app/xpm/Makefile.in index ec6a7e26..eb4019b5 100644 --- a/WPrefs.app/xpm/Makefile.in +++ b/WPrefs.app/xpm/Makefile.in @@ -109,9 +109,9 @@ GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WPrefs.app/xpm/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu WPrefs.app/xpm/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -143,6 +143,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = WPrefs.app/xpm distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu WPrefs.app/xpm/Makefile @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ diff --git a/WindowMaker/plmenu b/WindowMaker/plmenu index f0af75bb..a8caabc2 100644 --- a/WindowMaker/plmenu +++ b/WindowMaker/plmenu @@ -100,6 +100,6 @@ ("Start BlackBox", RESTART, blackbox), ("Start kwm", RESTART, kwm), ("Start IceWM", RESTART, icewm), - ("Exit...", EXIT), + ("Exit...", EXIT) ) ) diff --git a/configure.in b/configure.in index 2623d92c..a2d61a3c 100644 --- a/configure.in +++ b/configure.in @@ -10,7 +10,7 @@ AC_INIT(src/WindowMaker.h) -AM_INIT_AUTOMAKE(WindowMaker, 0.53.0) +AM_INIT_AUTOMAKE(WindowMaker, 0.53.1) AM_PROG_LIBTOOL @@ -319,7 +319,7 @@ dnl dnl Disable some stuff that are duplicated in kde dnl --------------------------------------------- AC_ARG_ENABLE(lite, - [ --enable-lite disable stuff duplicated in KDE/GNOME ], + [ --enable-lite disable some stuff (dont use it) ], [if test x$enableval = xyes; then LITE=yes AC_DEFINE(LITE) diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 7cb1dd07..6414fd88 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -369,6 +369,9 @@ typedef struct WPreferences { char window_balloon; char miniwin_balloon; char appicon_balloon; + + char no_workspace_name_display; + #ifdef WEENDOZE_CYCLE char windoze_cycling; /* Windoze 95 style Alt+Tabbing */ char popup_switchmenu; /* Popup the switchmenu when Alt+Tabbing */ diff --git a/src/actions.c b/src/actions.c index 959222b1..f8cfb643 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1150,9 +1150,9 @@ wDeiconifyWindow(WWindow *wwin) wwin->icon = NULL; } XUngrabServer(dpy); - if (wPreferences.focus_mode==WKF_CLICK - || wPreferences.focus_mode==WKF_SLOPPY) - wSetFocusTo(wwin->screen_ptr, wwin); + + if (wPreferences.focus_mode==WKF_CLICK) + wSetFocusTo(wwin->screen_ptr, wwin); #ifdef ANIMATIONS if (!wwin->screen_ptr->flags.startup) { diff --git a/src/client.c b/src/client.c index af2cc7c7..d5a8394a 100644 --- a/src/client.c +++ b/src/client.c @@ -492,7 +492,7 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event) || (wwin->wm_hints->flags & IconWindowHint)) { WApplication *wapp; - if (wwin->flags.miniaturized) { + if (wwin->flags.miniaturized && wwin->icon) { wIconUpdate(wwin->icon); } wapp = wApplicationOf(wwin->main_window); diff --git a/src/defaults.c b/src/defaults.c index 65e6948e..1bcd4be4 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -387,6 +387,9 @@ WDefaultEntry optionList[] = { {"CycleWorkspaces", "NO", NULL, &wPreferences.ws_cycle, getBool, NULL }, + {"IAmAnnoyingAndDontWantWorkspaceNameDisplay", "NO",NULL, + &wPreferences.no_workspace_name_display, getBool, NULL + }, {"StickyIcons", "NO", NULL, &wPreferences.sticky_icons, getBool, setStickyIcons }, @@ -522,7 +525,7 @@ WDefaultEntry optionList[] = { {"DisplayFont", DEF_INFO_TEXT_FONT, NULL, NULL, getFont, setDisplayFont }, - {"LargeDisplayFont" DEF_WORKSPACE_NAME_FONT, NULL, + {"LargeDisplayFont",DEF_WORKSPACE_NAME_FONT, NULL, NULL, getFont, setLargeDisplayFont }, {"HighlightColor", "white", NULL, diff --git a/src/dialog.c b/src/dialog.c index 15f51217..1fba21f2 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -496,7 +496,7 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class) if (tmp && (instance || class)) sprintf(tmp, "%s [%s.%s]", _("Icon Chooser"), instance, class); else - tmp = _("Icon Chooser"); + strcpy(tmp, _("Icon Chooser")); wwin = wManageInternalWindow(scr, parent, None, tmp, (scr->scr_width - 450)/2, diff --git a/src/framewin.c b/src/framewin.c index 801a72c2..d0218315 100644 --- a/src/framewin.c +++ b/src/framewin.c @@ -579,11 +579,21 @@ renderResizebarTexture(WScreen *scr, WTexture *texture, int width, int height, ROperateLine(img, RSubtractOperation, cwidth, 2, cwidth, height-1, &dark); ROperateLine(img, RAddOperation, cwidth+1, 2, cwidth+1, height-1, &light); - ROperateLine(img, RSubtractOperation, width-cwidth-2, 2, width-cwidth-2, - height-1, &dark); + if (width > 1) + ROperateLine(img, RSubtractOperation, width-cwidth-2, 2, + width-cwidth-2, height-1, &dark); ROperateLine(img, RAddOperation, width-cwidth-1, 2, width-cwidth-1, height-1, &light); +#ifdef SHADOW_RESIZEBAR + ROperateLine(img, RAddOperation, 0, 1, 0, height-1, &light); + ROperateLine(img, RSubtractOperation, width-1, 1, width-1, height-1, + &dark); + ROperateLine(img, RSubtractOperation, 0, height-1, width-1, height-1, + &dark); +#endif /* SHADOW_RESIZEBAR */ + + if (!RConvertImage(scr->rcontext, img, pmap)) { wwarning(_("error rendering image: %s"), RMessageForError(RErrorCode)); } diff --git a/src/menu.c b/src/menu.c index 60d0e490..a576f947 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1796,9 +1796,9 @@ wMenuScroll(WMenu *menu, XEvent *event) WMNextEvent(dpy, &ev); switch (ev.type) { - case EnterNotify: + case EnterNotify: WMHandleEvent(&ev); - case MotionNotify: + case MotionNotify: x = (ev.type==MotionNotify) ? ev.xmotion.x_root : ev.xcrossing.x_root; y = (ev.type==MotionNotify) ? ev.xmotion.y_root : ev.xcrossing.y_root; @@ -1938,8 +1938,7 @@ menuMouseDown(WObjDescriptor *desc, XEvent *event) smenu = parentMenu(menu); old_frame_x = smenu->frame_x; old_frame_y = smenu->frame_y; - } - else if (event->xbutton.window == menu->frame->core->window) { + } else if (event->xbutton.window == menu->frame->core->window) { /* This is true if the menu was launched with right click on root window */ delayed_select = 1; d_data.delayed_select = &delayed_select; @@ -2195,8 +2194,7 @@ menuMouseDown(WObjDescriptor *desc, XEvent *event) } } - if (((WMenu*)desc->parent)->flags.brother || close_on_exit - || !smenu) + if (((WMenu*)desc->parent)->flags.brother || close_on_exit || !smenu) closeCascade(desc->parent); /* close the cascade windows that should not remain opened */ diff --git a/src/misc.c b/src/misc.c index 48cf0ce4..0c2fea81 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1436,7 +1436,7 @@ ExecuteShellCommand(WScreen *scr, char *command) #ifdef HAVE_SETPGID setpgid(0, 0); #endif - execl(shell, shell, "-c", wstrappend("exec ", command), NULL); + execl(shell, shell, "-c", command, NULL); wsyserror("could not execute %s -c %s", shell, command); Exit(-1); } else if (pid < 0) { diff --git a/src/rootmenu.c b/src/rootmenu.c index 8fd8c21d..743088e2 100644 --- a/src/rootmenu.c +++ b/src/rootmenu.c @@ -114,6 +114,7 @@ static Shortcut *shortcutList = NULL; * REFRESH - forces the desktop to be repainted * EXIT [QUICK] - exit the window manager [without confirmation] * EXEC - execute an external program + * SHEXEC - execute a shell command * WORKSPACE_MENU - places the workspace submenu * ARRANGE_ICONS * RESTART [] - restarts the window manager @@ -807,7 +808,18 @@ addMenuEntry(WMenu *menu, char *title, char *shortcut, char *command, wwarning(_("%s:missing parameter for menu command \"%s\""), file_name, command); else { - entry = wMenuAddCallback(menu, title, execCommand, wstrdup(params)); + entry = wMenuAddCallback(menu, title, execCommand, + wstrappend("exec ", params)); + entry->free_cdata = free; + shortcutOk = True; + } + } else if (strcmp(command, "SHEXEC")==0) { + if (!params) + wwarning(_("%s:missing parameter for menu command \"%s\""), + file_name, command); + else { + entry = wMenuAddCallback(menu, title, execCommand, + wstrdup(params)); entry->free_cdata = free; shortcutOk = True; } diff --git a/src/session.c b/src/session.c index 32447d4a..5339058b 100644 --- a/src/session.c +++ b/src/session.c @@ -776,7 +776,7 @@ wSessionGetStateFor(WWindow *wwin, WSessionData *state) &state->width, &state->height, &state->user_changed_width, &state->user_changed_height); - + /* state */ value = PLGetArrayElement(slist, index++); str = PLGetString(value); @@ -784,18 +784,18 @@ wSessionGetStateFor(WWindow *wwin, WSessionData *state) sscanf(str, "%i %i %i", &state->miniaturized, &state->shaded, &state->maximized); - + /* attributes */ value = PLGetArrayElement(slist, index++); str = PLGetString(value); getAttributeState(str, &state->mflags, &state->flags); - + /* workspace */ value = PLGetArrayElement(slist, index++); str = PLGetString(value); - + sscanf(str, "%i", &state->workspace); @@ -808,7 +808,7 @@ wSessionGetStateFor(WWindow *wwin, WSessionData *state) /* shortcuts */ value = PLGetArrayElement(slist, index++); str = PLGetString(value); - + sscanf(str, "%i", &state->shortcuts); } diff --git a/src/session.h b/src/session.h index ec80c2ca..5134da1b 100644 --- a/src/session.h +++ b/src/session.h @@ -1,6 +1,6 @@ /* session.h * - * Copyright (c) 1998 Dan Pascu + * Copyright (c) 1999 Alfredo K. Kojima * * Window Maker window manager * @@ -68,4 +68,6 @@ Bool wSessionIsManaged(void); #endif +Bool wSessionGetStateFor(WWindow *wwin, WSessionData *state); + #endif diff --git a/src/wconfig.h.in b/src/wconfig.h.in index 742175d9..48e5cd21 100644 --- a/src/wconfig.h.in +++ b/src/wconfig.h.in @@ -362,7 +362,10 @@ /* delay for menu item selection hysteresis */ #define MENU_SELECT_DELAY 200 -/* animation speed constants */ +/* delay for jumpback of scrolled menus */ +#define MENU_JUMP_BACK_DELAY 200 + +/* *** animation speed constants *** */ /* icon slide */ #define ICON_SLIDE_SLOWDOWN_UF 20 @@ -400,7 +403,7 @@ #define MENU_SCROLL_STEPS_U 1 #define MENU_SCROLL_DELAY_U 8 -#define MENU_JUMP_BACK_DELAY 0 +0 /* shade animation */ #define SHADE_STEPS_UF 5 @@ -418,6 +421,12 @@ #define SHADE_STEPS_U 20 #define SHADE_DELAY_U 10 + +/* workspace name on switch display */ +#define WORKSPACE_NAME_FADE_DELAY 30 + +#define WORKSPACE_NAME_DELAY 500 + /* window birth animation steps (DO NOT MAKE IT RUN-TIME) */ #define WINDOW_BIRTH_STEPS 20 diff --git a/src/window.c b/src/window.c index 9f763440..e4dbcc1d 100644 --- a/src/window.c +++ b/src/window.c @@ -1552,10 +1552,10 @@ wWindowFocus(WWindow *wwin, WWindow *owin) wFrameWindowChangeState(wwin->frame, WS_FOCUSED); - wWindowResetMouseGrabs(wwin); - wwin->flags.focused = 1; + wWindowResetMouseGrabs(wwin); + UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE); if (owin == wwin || !owin) @@ -1621,6 +1621,7 @@ wWindowUnfocus(WWindow *wwin) } } wwin->flags.focused = 0; + wWindowResetMouseGrabs(wwin); UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE); @@ -2334,7 +2335,7 @@ wWindowResetMouseGrabs(WWindow *wwin) GrabModeAsync, None, None); } - if (!wwin->flags.focused) { + if (!wwin->flags.focused && !WFLAGP(wwin, no_focusable)) { /* the passive grabs to focus the window */ if (wPreferences.focus_mode == WKF_CLICK) XGrabButton(dpy, AnyButton, AnyModifier, wwin->client_win, diff --git a/src/window.h b/src/window.h index 48aa1081..f8901786 100644 --- a/src/window.h +++ b/src/window.h @@ -141,7 +141,6 @@ typedef struct { unsigned int olwm_transient:1; unsigned int olwm_warp_to_pin:1; #endif - } WWindowAttributes; diff --git a/src/workspace.c b/src/workspace.c index 57095354..025bdfff 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -252,8 +252,9 @@ hideWorkpaceName(void *data) RImage *img = RCloneImage(scr->workspace_name_data->back); Pixmap pix; - scr->workspace_name_timer = WMAddTimerHandler(30, hideWorkpaceName, - scr); + scr->workspace_name_timer = + WMAddTimerHandler(WORKSPACE_NAME_FADE_DELAY, hideWorkpaceName, + scr); RCombineImagesWithOpaqueness(img, scr->workspace_name_data->text, scr->workspace_name_data->count*255/10); @@ -289,6 +290,8 @@ showWorkspaceName(WScreen *scr, int workspace) XUnmapWindow(dpy, scr->workspace_name); XFlush(dpy); } + scr->workspace_name_timer = WMAddTimerHandler(WORKSPACE_NAME_DELAY, + hideWorkpaceName, scr); if (scr->workspace_name_data) { RDestroyImage(scr->workspace_name_data->back); @@ -307,8 +310,10 @@ showWorkspaceName(WScreen *scr, int workspace) h = scr->workspace_name_font->height; XResizeWindow(dpy, scr->workspace_name, w+4, h+4); - XMoveWindow(dpy, scr->workspace_name, (scr->scr_width - (w+4))/2, + XMoveWindow(dpy, scr->workspace_name, (scr->scr_width - (w+4))/2, 0); + /* (scr->scr_height - (h+4))/2); + */ text = XCreatePixmap(dpy, scr->w_win, w+4, h+4, scr->w_depth); mask = XCreatePixmap(dpy, scr->w_win, w+4, h+4, 1); @@ -374,11 +379,12 @@ showWorkspaceName(WScreen *scr, int workspace) scr->workspace_name_data = data; - scr->workspace_name_timer = WMAddTimerHandler(300, hideWorkpaceName, scr); - return; erro: + if (scr->workspace_name_timer) + WMDeleteTimerHandler(scr->workspace_name_timer); + if (data->text) RDestroyImage(data->text); if (data->back) @@ -387,7 +393,9 @@ erro: scr->workspace_name_data = NULL; - scr->workspace_name_timer = WMAddTimerHandler(600, hideWorkpaceName, scr); + scr->workspace_name_timer = WMAddTimerHandler(WORKSPACE_NAME_DELAY + + 10*WORKSPACE_NAME_FADE_DELAY, + hideWorkpaceName, scr); } @@ -401,7 +409,8 @@ wWorkspaceChange(WScreen *scr, int workspace) if (workspace != scr->current_workspace) { wWorkspaceForceChange(scr, workspace); } else { - showWorkspaceName(scr, workspace); + if (!wPreferences.no_workspace_name_display) + showWorkspaceName(scr, workspace); } } @@ -568,7 +577,8 @@ wWorkspaceForceChange(WScreen *scr, int workspace) } } - showWorkspaceName(scr, workspace); + if (!wPreferences.no_workspace_name_display) + showWorkspaceName(scr, workspace); #ifdef GNOME_STUFF wGNOMEUpdateCurrentWorkspaceHint(scr); diff --git a/util/setstyle.c b/util/setstyle.c index 1d32f4b7..50505e70 100644 --- a/util/setstyle.c +++ b/util/setstyle.c @@ -21,7 +21,7 @@ */ -#define PROG_VERSION "setstyle (Window Maker) 0.4" +#define PROG_VERSION "setstyle (Window Maker) 0.5" #include #include @@ -35,6 +35,7 @@ #include "../src/wconfig.h" +#define MAX_OPTIONS 128 char *FontOptions[] = { "IconTitleFont", @@ -344,13 +345,13 @@ print_help() printf("Usage: %s [OPTIONS] FILE\n", ProgName); puts("Reads style/theme configuration from FILE and updates Window Maker."); puts(""); - puts(" --no-fonts ignore font related options"); - puts(" --help display this help and exit"); - puts(" --version output version information and exit"); + puts(" --no-fonts ignore font related options"); + puts(" --ignore