? gdmwm.diff
Index: gui/gdmwm.c
===================================================================
RCS file: /cvs/gnome/gdm2/gui/gdmwm.c,v
retrieving revision 1.24
diff -u -r1.24 gdmwm.c
--- gui/gdmwm.c	3 Aug 2004 23:36:15 -0000	1.24
+++ gui/gdmwm.c	25 Aug 2004 15:32:37 -0000
@@ -65,6 +65,7 @@
 static Atom XA_WM_STATE = 0;
 static Atom XA_WM_TAKE_FOCUS = 0;
 static Atom XA_COMPOUND_TEXT = 0;
+static Atom XA_NET_WM_STRUT = 0;
 
 static int trap_depth = 0;
 
@@ -226,6 +227,24 @@
 	gdm_wm_screen = gdm_wm_allscreens[cur_screen_num];
 }
 
+void
+gdm_wm_update_struts (Display *xdisplay, Window xwindow)
+{
+    gint     size = 0;
+    guint32 *struts = get_typed_property_data (xdisplay, xwindow, XA_NET_WM_STRUT, 
+					       XA_CARDINAL, &size, 32);
+
+    if (size == 4)
+    {
+	g_message ("struts: %d %d %d %d", struts[0], struts[1], struts[2], struts[3]);
+	gdm_wm_screen.x = struts[0];
+	gdm_wm_screen.y = struts[2];
+	gdm_wm_screen.width = gdk_screen_width () - struts[1];
+	gdm_wm_screen.height = gdk_screen_height () - struts[3];
+    }
+    g_free (struts);
+}
+
 /* Not really a WM function, center a gtk window by setting uposition */
 void
 gdm_wm_center_window (GtkWindow *cw) 
@@ -1077,6 +1096,14 @@
 		if (gw != NULL)
 			gdm_wm_focus_window (gw->win);
 		break;
+	case PropertyNotify:
+		if (ev->xproperty.atom == XA_NET_WM_STRUT)
+		{
+			gdm_wm_update_struts (ev->xproperty.display, 
+					      ev->xproperty.window);
+		        gdm_wm_center_window (gw->win);
+		}
+		break;
 	default:
 		break;
 	}
@@ -1181,6 +1208,7 @@
 	XA_WM_TAKE_FOCUS = XInternAtom (wm_disp, "WM_TAKE_FOCUS", False);
 
 	XA_COMPOUND_TEXT = XInternAtom (wm_disp, "COMPOUND_TEXT", False);
+	XA_NET_WM_STRUT = XInternAtom (wm_disp, "_NET_WM_STRUT", False);
 
 	wm_root = DefaultRootWindow (wm_disp);
 
