[Xfce4-commits] [apps/xfdashboard] 02/02: Fix warning when old and/or new monitor in signal handler is NULL at windows view

noreply at xfce.org noreply at xfce.org
Tue Aug 7 08:02:06 CEST 2018


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 a92f3f30f80c3430dab8c33732b86b73846b2ebc
Author: Stephan Haller <nomad at froevel.de>
Date:   Tue Aug 7 08:01:40 2018 +0200

    Fix warning when old and/or new monitor in signal handler is NULL at windows view
---
 libxfdashboard/windows-view.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libxfdashboard/windows-view.c b/libxfdashboard/windows-view.c
index d91fb19..60be07b 100644
--- a/libxfdashboard/windows-view.c
+++ b/libxfdashboard/windows-view.c
@@ -697,8 +697,8 @@ static void _xfdashboard_windows_view_on_window_monitor_changed(XfdashboardWindo
 
 	g_return_if_fail(XFDASHBOARD_IS_WINDOWS_VIEW(self));
 	g_return_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER_WINDOW(inWindow));
-	g_return_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER_MONITOR(inOldMonitor));
-	g_return_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER_MONITOR(inNewMonitor));
+	g_return_if_fail(inOldMonitor==NULL || XFDASHBOARD_IS_WINDOW_TRACKER_MONITOR(inOldMonitor));
+	g_return_if_fail(inNewMonitor==NULL || XFDASHBOARD_IS_WINDOW_TRACKER_MONITOR(inNewMonitor));
 
 	priv=self->priv;
 
@@ -707,9 +707,11 @@ static void _xfdashboard_windows_view_on_window_monitor_changed(XfdashboardWindo
 	 * and create it. Otherwise recreate all window actors for changed stage
 	 * interface and monitor.
 	 */
-	if(!_xfdashboard_windows_view_update_stage_and_monitor(self))
+	if(!_xfdashboard_windows_view_update_stage_and_monitor(self) &&
+		G_LIKELY(!inOldMonitor) &&
+		G_LIKELY(!inNewMonitor))
 	{
-		/* Check if window moved away from this view*/
+		/* Check if window moved away from this view */
 		if(priv->currentMonitor==inOldMonitor &&
 			!_xfdashboard_windows_view_is_visible_window(self, inWindow))
 		{

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


More information about the Xfce4-commits mailing list