[Xfce4-commits] <xfce4-screenshooter:master> Make sure the active window is not destroyed.

Jérôme Guelfucci noreply at xfce.org
Fri Nov 27 19:02:01 CET 2009


Updating branch refs/heads/master
         to 559ff72028679af30de4769d4a47f80d1df84615 (commit)
       from 9bff10908048a323377f25ccfe052409bba98d86 (commit)

commit 559ff72028679af30de4769d4a47f80d1df84615
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Fri Nov 27 19:02:04 2009 +0100

    Make sure the active window is not destroyed.

 lib/screenshooter-capture.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/lib/screenshooter-capture.c b/lib/screenshooter-capture.c
index 1902325..1d0644c 100644
--- a/lib/screenshooter-capture.c
+++ b/lib/screenshooter-capture.c
@@ -90,6 +90,15 @@ static GdkWindow
       *needs_unref = FALSE;
       *border = FALSE;
     }
+  else if (G_UNLIKELY (gdk_window_is_destroyed (window)))
+    {
+      TRACE ("The active window is destroyed, fallback to the root window.");
+
+      g_object_unref (window);
+      window = gdk_get_default_root_window ();
+      *needs_unref = FALSE;
+      *border = FALSE;
+    }
   else if (gdk_window_get_type_hint (window) == GDK_WINDOW_TYPE_HINT_DESKTOP)
     {
       /* If the active window is the desktop, grab the whole screen */



More information about the Xfce4-commits mailing list