There are quite a few applications that break with 0.16.6pre. Turns out the
reason for this is the new _partial_ support for the Window Manager
Specification.

The new e16 tricks programs into believing the standard is implemented, but
it fails to set _NET_WORKAREA, which is a _required_ property (it's been
this way since 1.0) [1]. Depending on the application, hilarity ensues
(some try to fit into a 0x0 work area).

The attached patch is against e16 CVS and has seen little testing. It works
for me (fixes broken apps), but you may well have better values for that
property, or better locations to invoke EWMH_SetWorkArea() from.

Roger

[1] http://www.freedesktop.org/standards/wm-spec/1.3-html/ar01s03.html#id3429889
diff -ur e16.org/e/src/E.h e16/e/src/E.h
--- e16.org/e/src/E.h   2003-08-18 18:21:57.385461978 +0200
+++ e16/e/src/E.h       2003-08-18 17:54:50.000000000 +0200
@@ -2398,6 +2398,7 @@
 void                EWMH_SetDesktopSize(void);
 void                EWMH_SetCurrentDesktop(void);
 void                EWMH_SetDesktopViewport(void);
+void                EWMH_SetWorkArea(void);
 void                EWMH_SetClientList(void);
 void                EWMH_SetActiveWindow(const EWin * ewin);
 void                EWMH_SetWindowDesktop(const EWin * ewin);
diff -ur e16.org/e/src/ewmh.c e16/e/src/ewmh.c
--- e16.org/e/src/ewmh.c        2003-08-18 18:21:57.415457533 +0200
+++ e16/e/src/ewmh.c    2003-08-18 18:34:16.117123743 +0200
@@ -63,6 +63,7 @@
 Atom                _NET_DESKTOP_NAMES;
 Atom                _NET_CURRENT_DESKTOP;
 Atom                _NET_DESKTOP_VIEWPORT;
+Atom                _NET_WORKAREA;
 Atom                _NET_VIRTUAL_ROOTS;
 
 Atom                _NET_ACTIVE_WINDOW;
@@ -205,6 +206,7 @@
    _ATOM_INIT(_NET_DESKTOP_NAMES);
    _ATOM_INIT(_NET_CURRENT_DESKTOP);
    _ATOM_INIT(_NET_DESKTOP_VIEWPORT);
+   _ATOM_INIT(_NET_WORKAREA);
    _ATOM_INIT(_NET_VIRTUAL_ROOTS);
 
    _ATOM_INIT(_NET_ACTIVE_WINDOW);
@@ -254,6 +256,7 @@
    EWMH_SetDesktopCount();
    EWMH_SetDesktopNames();
    EWMH_SetDesktopSize();
+   EWMH_SetWorkArea();
 
    EDBUG_RETURN_;
 }
@@ -315,6 +318,31 @@
 }
 
 void
+EWMH_SetWorkArea(void)
+{
+   CARD32             *p_coord;
+   int                 n_coord, i;
+
+   EDBUG(6, "EWMH_SetWorkArea");
+
+   n_coord = 4 * mode.numdesktops;
+   p_coord = Emalloc(n_coord * sizeof(CARD32));
+   if (p_coord)
+     {
+       for (i = 0; i < mode.numdesktops; i++)
+         {
+            p_coord[4 * i] = 0;
+            p_coord[4 * i + 1] = 0;
+            p_coord[4 * i + 2] = root.w;
+            p_coord[4 * i + 3] = root.h;
+         }
+       _ATOM_SET_CARD32(_NET_WORKAREA, root.win, p_coord, n_coord);
+       Efree(p_coord);
+     }
+   EDBUG_RETURN_;
+}
+
+void
 EWMH_SetCurrentDesktop(void)
 {
    CARD32              val;
diff -ur e16.org/e/src/hints.c e16/e/src/hints.c
--- e16.org/e/src/hints.c       2003-08-18 18:21:57.685417533 +0200
+++ e16/e/src/hints.c   2003-08-18 18:30:06.386048939 +0200
@@ -81,6 +81,7 @@
 #if ENABLE_EWMH
    EWMH_SetDesktopCount();
    EWMH_SetDesktopNames();
+   EWMH_SetWorkArea();
 #endif
    EDBUG_RETURN_;
 }

Reply via email to