Please find attached various minor patches for E16, more or less related to the Extended Window Manager Hints:
e16-fix-initial-desktop.patch initialises the desktop for a new window to the current desktop. This avoids that DetermineEwinArea() called from AddToFamily() accesses desks.desk[ewin->desktop] with ewin->desktop = -1.
e16-fix-desktop-hint.patch makes sure the current desktop hint always gets set when calling ConformEwinToDesktop(). Fixes an EWMH problem when sticking/unsticking.
e16-fix-stick-by-wm-desktop.patch implements sick/unstick by client messages using _NET_WM_DESKTOP in stead of _NET_WM_STATE.
e16-fix-off-vp-stick.patch puts windows being made sticky on the current viewport, if not already there. Otherwise they may seem to get lost. Fixes problems with taskbars not only showing windows in the current viewport.
/Kim
--- e16-cvs.org/e/src/borders.c 2003-03-24 22:11:56.000000000 +0100 +++ e16/e/src/borders.c 2003-03-26 20:15:58.000000000 +0100 @@ -1670,7 +1670,7 @@ ewin->border_new = 0; ewin->bits = NULL; ewin->sticky = 0; - ewin->desktop = -1; + ewin->desktop = desks.current; ewin->groups = NULL; ewin->num_groups = 0; ewin->visible = 0;
--- e16-cvs.org/e/src/desktops.c 2003-03-24 22:11:57.000000000 +0100 +++ e16/e/src/desktops.c 2003-03-26 21:19:17.000000000 +0100 @@ -1355,10 +1355,8 @@ ewin->y); ICCCM_Configure(ewin); StackDesktops(); - HintsSetWindowDesktop(ewin); - EDBUG_RETURN_; } - if (ewin->floating) + else if (ewin->floating) { DesktopRemoveEwin(ewin); xo = desks.desk[ewin->desktop].x; @@ -1372,10 +1370,8 @@ XRaiseWindow(disp, ewin->win); ShowEdgeWindows(); ICCCM_Configure(ewin); - HintsSetWindowDesktop(ewin); - EDBUG_RETURN_; } - if (ewin->parent != desks.desk[ewin->desktop].win) + else if (ewin->parent != desks.desk[ewin->desktop].win) { ewin->parent = desks.desk[ewin->desktop].win; DesktopAddEwinToTop(ewin); @@ -1384,13 +1380,11 @@ RaiseEwin(ewin); /* ShowEwin(ewin); */ ICCCM_Configure(ewin); -/* HintsSetWindowDesktop(ewin); */ - HintsSetWindowHints(ewin); StackDesktops(); SetEwinToCurrentArea(ewin); } + HintsSetWindowDesktop(ewin); EDBUG_RETURN_; - } int
--- e16-cvs.org/e/src/ewmh.c 2003-03-24 04:48:08.000000000 +0100 +++ e16/e/src/ewmh.c 2003-03-26 23:37:37.000000000 +0100 @@ -497,9 +497,16 @@ goto exit; if (val[0] == 0xFFFFFFFF) - ewin->desktop = 0; + { + /* It is possible to distinguish between "sticky" and "on all desktops". */ + /* E doesn't */ + ewin->sticky = 1; + } else + { ewin->desktop = val[0]; + ewin->sticky = 0; + } Efree(val); exit: @@ -692,7 +699,18 @@ } else if (event->message_type == _NET_WM_DESKTOP) { - MoveEwinToDesktop(ewin, event->data.l[0]); + if (event->data.l[0] == 0xFFFFFFFF) + { + if (!ewin->sticky) + MakeWindowSticky(ewin); + } + else + { + if (ewin->sticky) + MakeWindowUnSticky(ewin); + else + MoveEwinToDesktop(ewin, event->data.l[0]); + } } else if (event->message_type == _NET_WM_STATE) {
--- e16-cvs.org/e/src/sticky.c 2003-03-24 22:12:01.000000000 +0100 +++ e16/e/src/sticky.c 2003-03-27 00:16:18.000000000 +0100 @@ -22,6 +22,9 @@ */ #include "E.h" +#define _COORD_MODULO(a, b, c) { a = b % c; if (a < 0) a += c; } + + void MakeWindowUnSticky(EWin * ewin) { @@ -50,10 +53,21 @@ void MakeWindowSticky(EWin * ewin) { + int x, y; EDBUG(5, "MakeWindowSticky"); if (!ewin) EDBUG_RETURN_; ewin->sticky = 1; + /* Avoid "losing" windows made sticky while not in the current viewport */ + _COORD_MODULO(x, ewin->x, root.w); + _COORD_MODULO(y, ewin->y, root.h); + if (x != ewin->x || y != ewin->y) + { + ewin->x = x; + ewin->y = y; + FloatEwinAt(ewin, ewin->x, ewin->y); + DrawEwinShape(ewin, 0, ewin->x, ewin->y, ewin->client.w, ewin->client.h, 0); + } MoveEwinToDesktopAt(ewin, desks.current, ewin->x, ewin->y); RaiseEwin(ewin); DrawEwin(ewin);