[Goodies-commits] r6317 - in xfce4-screenshooter-plugin/trunk: . lib

Jerome Guelfucci jeromeg at xfce.org
Sun Dec 14 11:23:47 CET 2008


Author: jeromeg
Date: 2008-12-14 10:23:47 +0000 (Sun, 14 Dec 2008)
New Revision: 6317

Modified:
   xfce4-screenshooter-plugin/trunk/ChangeLog
   xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.c
Log:
  * lib/screenshooter-utils.c: (get_window_screenshot) don't crash when
    we are in active window mode and NULL is returned as the active
    window. The root window should not be unrefed !


Modified: xfce4-screenshooter-plugin/trunk/ChangeLog
===================================================================
--- xfce4-screenshooter-plugin/trunk/ChangeLog	2008-12-14 07:20:59 UTC (rev 6316)
+++ xfce4-screenshooter-plugin/trunk/ChangeLog	2008-12-14 10:23:47 UTC (rev 6317)
@@ -1,3 +1,9 @@
+2008-12-14 jeromeg
+
+  * lib/screenshooter-utils.c: (get_window_screenshot) don't crash when
+    we are in active window mode and NULL is returned as the active
+    window. The root window should not be unrefed !
+
 2008-12-13 jeromeg
 
   * lib/screenshooter-dialogs.c: change a few strings.

Modified: xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.c	2008-12-14 07:20:59 UTC (rev 6316)
+++ xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.c	2008-12-14 10:23:47 UTC (rev 6317)
@@ -48,11 +48,9 @@
       window = gdk_get_default_root_window ();
       *needs_unref = FALSE;
     }
-  
-  /* If the active window is the desktop, we grab the whole screen, else
-   * we find the toplevel window to grab the decorations. */
-  if (gdk_window_get_type_hint (window) == GDK_WINDOW_TYPE_HINT_DESKTOP)
+  else if (gdk_window_get_type_hint (window) == GDK_WINDOW_TYPE_HINT_DESKTOP)
     {
+      /* If the active window is the desktop, grab the whole screen */
       g_object_unref (window);
                     
       window = gdk_get_default_root_window ();
@@ -60,6 +58,7 @@
     }
   else
     {
+      /* Else we find the toplevel window to grab the decorations. */
       window2 = gdk_window_get_toplevel (window);
       
       g_object_unref (window);




More information about the Goodies-commits mailing list