[Xfce4-commits] [apps/xfdashboard] 01/01: Fix function to lookup X11 window from GDK window for a ClutterStage in GDK backend

noreply at xfce.org noreply at xfce.org
Thu Oct 5 10:58:31 CEST 2017


This is an automated email from the git hooks/post-receive script.

n   o   m   a   d       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfdashboard.

commit 4ca56f59dd47bbea6a9c6c351ce0d576206348dd
Author: Stephan Haller <nomad at froevel.de>
Date:   Thu Oct 5 10:55:06 2017 +0200

    Fix function to lookup X11 window from GDK window for a ClutterStage in GDK backend
    
    When xfdashboard is run in daemon mode the stage window will be created on first visible state. That means that looking up GDK window for a stage will return NULL at start-up until the stage is shown for the very first time. When iterating through the stages and determining GDK windows we need to respect this, otherwise xfdashboard crashes in daemon mode at start-up when resolving a NULL pointer of GDK window to a X11 window ID (XID).
---
 libxfdashboard/gdk/window-tracker-backend-gdk.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/libxfdashboard/gdk/window-tracker-backend-gdk.c b/libxfdashboard/gdk/window-tracker-backend-gdk.c
index ee67224..2250f35 100644
--- a/libxfdashboard/gdk/window-tracker-backend-gdk.c
+++ b/libxfdashboard/gdk/window-tracker-backend-gdk.c
@@ -475,7 +475,27 @@ static ClutterStage* _xfdashboard_window_tracker_backend_gdk_window_tracker_back
 		if(stage)
 		{
 			iterGdkWindow=clutter_gdk_get_stage_window(stage);
+			if(!iterGdkWindow)
+			{
+				XFDASHBOARD_DEBUG(self, WINDOWS,
+									"Could not get GDK window from stage %s@%p",
+									G_OBJECT_TYPE_NAME(stage),
+									stage);
+				continue;
+			}
+
 			iterXWindow=gdk_x11_window_get_xid(iterGdkWindow);
+			if(iterXWindow==None)
+			{
+				XFDASHBOARD_DEBUG(self, WINDOWS,
+									"Could not get X server window for GDK window %s@%p of stage %s@%p",
+									G_OBJECT_TYPE_NAME(iterGdkWindow),
+									iterGdkWindow,
+									G_OBJECT_TYPE_NAME(stage),
+									stage);
+				continue;
+			}
+
 			if(stageXWindow==iterXWindow) foundStage=stage;
 		}
 	}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list