Author: olivier
Date: 2008-10-18 15:50:49 +0000 (Sat, 18 Oct 2008)
New Revision: 28294

Modified:
   xfwm4/trunk/ChangeLog
   xfwm4/trunk/src/client.c
   xfwm4/trunk/src/events.c
   xfwm4/trunk/src/hints.c
   xfwm4/trunk/src/misc.c
   xfwm4/trunk/src/misc.h
   xfwm4/trunk/src/netwm.c
Log:
Add routine to get the name of a given atom, add client windows to save set to 
avoid loosing all windows in case of crash, display name of unsupported 
net_wm_state atom, clean-up of list of supported atoms, add hooks for debugging 
purpose.

Modified: xfwm4/trunk/ChangeLog
===================================================================
--- xfwm4/trunk/ChangeLog       2008-10-18 14:25:59 UTC (rev 28293)
+++ xfwm4/trunk/ChangeLog       2008-10-18 15:50:49 UTC (rev 28294)
@@ -1,3 +1,12 @@
+2008-10-18  olivier
+
+       * src/misc.h, src/misc.c: Add routine to get the name of a given atom,
+         src/client.c: Add client windows to save set to avoid loosing all
+         windows in case of crash,
+         src/netwm.c: Display name of unsupported net_wm_state atom,
+         src/hints.c: Clean-up of list of supported atoms,
+         src/events.c: Add hooks for debugging purpose.
+
 2008-10-16  olivier
 
        * src/events.c, src/session.c: Add support for restart style 

Modified: xfwm4/trunk/src/client.c
===================================================================
--- xfwm4/trunk/src/client.c    2008-10-18 14:25:59 UTC (rev 28293)
+++ xfwm4/trunk/src/client.c    2008-10-18 15:50:49 UTC (rev 28294)
@@ -1530,7 +1530,7 @@
 
     if (!XGetWindowAttributes (display_info->dpy, w, &attr))
     {
-        TRACE ("Cannot get window attributes");
+        g_warning ("Cannot get window attributes for window (0x%lx)", w);
         myDisplayUngrabServer (display_info);
         gdk_error_trap_pop ();
         return NULL;
@@ -1539,7 +1539,7 @@
     screen_info = myDisplayGetScreenFromRoot (display_info, attr.root);
     if (!screen_info)
     {
-        TRACE ("Cannot determine screen info from windows");
+        g_warning ("Cannot determine screen info from window (0x%lx)", w);
         myDisplayUngrabServer (display_info);
         gdk_error_trap_pop ();
         return NULL;
@@ -1598,6 +1598,7 @@
     getWindowName (display_info, c->window, &c->name);
     getWindowHostname (display_info, c->window, &c->hostname);
     getTransientFor (display_info, screen_info->xroot, c->window, 
&c->transient_for);
+    XChangeSaveSet(display_info->dpy, c->window, SetModeInsert);
 
     /* Initialize structure */
     c->size = NULL;
@@ -1992,6 +1993,8 @@
     XUnmapWindow (display_info->dpy, c->frame);
     clientCoordGravitate (c, REMOVE, &c->x, &c->y);
     XSelectInput (display_info->dpy, c->window, NoEventMask);
+    XChangeSaveSet(display_info->dpy, c->window, SetModeDelete);
+
     reparented = XCheckTypedWindowEvent (display_info->dpy, c->window, 
ReparentNotify, &ev);
 
     if (remap || !reparented)

Modified: xfwm4/trunk/src/events.c
===================================================================
--- xfwm4/trunk/src/events.c    2008-10-18 14:25:59 UTC (rev 28293)
+++ xfwm4/trunk/src/events.c    2008-10-18 15:50:49 UTC (rev 28294)
@@ -1247,7 +1247,7 @@
 static eventFilterStatus
 handleConfigureRequest (DisplayInfo *display_info, XConfigureRequestEvent * ev)
 {
-    Client *c = NULL;
+    Client *c;
     XWindowChanges wc;
 
     TRACE ("entering handleConfigureRequest");
@@ -2330,6 +2330,13 @@
     return EVENT_FILTER_PASS;
 }
 
+static eventFilterStatus
+handleReparentNotify (DisplayInfo *display_info, XReparentEvent * ev)
+{
+    TRACE ("entering handleReparentNotify, 0x%lx reparented in 0x%lx", 
ev->window, ev->parent);
+    return EVENT_FILTER_PASS;
+}
+
 #ifdef HAVE_XSYNC
 static eventFilterStatus
 handleXSyncAlarmNotify (DisplayInfo *display_info, XSyncAlarmNotifyEvent * ev)
@@ -2428,6 +2435,9 @@
         case MappingNotify:
             status = handleMappingNotify (display_info, (XMappingEvent *) ev);
             break;
+        case ReparentNotify:
+            status = handleReparentNotify (display_info, (XReparentEvent *) 
ev);
+            break;
         default:
             if ((display_info->have_shape) && (ev->type == 
display_info->shape_event_base))
             {
@@ -2449,9 +2459,9 @@
         }
         else if (display_info->quit)
         {
-            /* 
-             * Qutting on purpose, update session manager so 
-             * it does not restart the program immediately 
+            /*
+             * Qutting on purpose, update session manager so
+             * it does not restart the program immediately
              */
             client_session_set_restart_style(display_info->session, 
SESSION_RESTART_IF_RUNNING);
             gtk_main_quit ();

Modified: xfwm4/trunk/src/hints.c
===================================================================
--- xfwm4/trunk/src/hints.c     2008-10-18 14:25:59 UTC (rev 28293)
+++ xfwm4/trunk/src/hints.c     2008-10-18 15:50:49 UTC (rev 28294)
@@ -426,16 +426,6 @@
     atoms[i++] = display_info->atoms[NET_WM_ICON_GEOMETRY];
     atoms[i++] = display_info->atoms[NET_WM_ICON_NAME];
     atoms[i++] = display_info->atoms[NET_WM_MOVERESIZE];
-    atoms[i++] = display_info->atoms[NET_WM_MOVERESIZE_MOVE];
-    atoms[i++] = display_info->atoms[NET_WM_MOVERESIZE_SIZE_BOTTOM];
-    atoms[i++] = display_info->atoms[NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT];
-    atoms[i++] = display_info->atoms[NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT];
-    atoms[i++] = display_info->atoms[NET_WM_MOVERESIZE_SIZE_KEYBOARD];
-    atoms[i++] = display_info->atoms[NET_WM_MOVERESIZE_SIZE_LEFT];
-    atoms[i++] = display_info->atoms[NET_WM_MOVERESIZE_SIZE_RIGHT];
-    atoms[i++] = display_info->atoms[NET_WM_MOVERESIZE_SIZE_TOP];
-    atoms[i++] = display_info->atoms[NET_WM_MOVERESIZE_SIZE_TOPLEFT];
-    atoms[i++] = display_info->atoms[NET_WM_MOVERESIZE_SIZE_TOPRIGHT];
     atoms[i++] = display_info->atoms[NET_WM_NAME];
     atoms[i++] = display_info->atoms[NET_WM_PID];
     atoms[i++] = display_info->atoms[NET_WM_PING];

Modified: xfwm4/trunk/src/misc.c
===================================================================
--- xfwm4/trunk/src/misc.c      2008-10-18 14:25:59 UTC (rev 28293)
+++ xfwm4/trunk/src/misc.c      2008-10-18 15:50:49 UTC (rev 28294)
@@ -295,3 +295,33 @@
     cache_monitor = nearest_monitor;
     return (nearest_monitor);
 }
+
+gchar*
+get_atom_name (DisplayInfo *display_info, Atom atom)
+{
+    gchar *value;
+    gchar *xname;
+
+    if (atom)
+    {
+        char *xname;
+
+        xname = (gchar *) XGetAtomName (display_info->dpy, atom);
+        if (xname)
+        {
+            value = g_strdup (xname);
+            XFree ((char *) xname);
+        }
+        else
+        {
+            value = g_strdup ("Unknown");
+        }
+    }
+    else
+    {
+        value = g_strdup ("None");
+    }
+
+    return value;
+}
+

Modified: xfwm4/trunk/src/misc.h
===================================================================
--- xfwm4/trunk/src/misc.h      2008-10-18 14:25:59 UTC (rev 28293)
+++ xfwm4/trunk/src/misc.h      2008-10-18 15:50:49 UTC (rev 28294)
@@ -73,5 +73,7 @@
 gint                     find_monitor_at_point                  (GdkScreen *,
                                                                  gint,
                                                                  gint);
+gchar*                   get_atom_name                          (DisplayInfo *,
+                                                                 Atom);
 
 #endif /* INC_MISC_H */

Modified: xfwm4/trunk/src/netwm.c
===================================================================
--- xfwm4/trunk/src/netwm.c     2008-10-18 14:25:59 UTC (rev 28293)
+++ xfwm4/trunk/src/netwm.c     2008-10-18 15:50:49 UTC (rev 28294)
@@ -268,7 +268,10 @@
             }
             else
             {
-                g_warning ("Unmanaged net_wm_state (window 0x%lx)", c->window);
+                gchar *atom_name;
+                atom_name = get_atom_name (display_info, atoms[i]);
+                g_warning ("Unmanaged net_wm_state (window 0x%lx, atom 
\"%s\")", c->window, atom_name);
+                g_free (atom_name);
             }
 
             ++i;

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to