[Xfce4-commits] [xfce/xfce4-settings] 01/03: display: Fix race condition on monitor dis/connecting

noreply at xfce.org noreply at xfce.org
Wed Mar 14 02:36:00 CET 2018


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

b   l   u   e   s   a   b   r   e       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 xfce/xfce4-settings.

commit 5bc82c2acb23ea72722fa5ec520b716ed93788ce
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Mon Mar 12 22:53:03 2018 +0100

    display: Fix race condition on monitor dis/connecting
    
    Signed-off-by: Sean Davis <smd.seandavis at gmail.com>
---
 dialogs/display-settings/main.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/dialogs/display-settings/main.c b/dialogs/display-settings/main.c
index 22ba412..6c20959 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -2422,7 +2422,8 @@ paint_output (cairo_t *cr, int i, double *snap_x, double *snap_y)
     double x, y, end_x, end_y;
     gint total_w, total_h;
     GList *connected_outputs = list_connected_outputs (&total_w, &total_h);
-    XfceOutputInfo *output = g_list_nth (connected_outputs, i)->data;
+    XfceOutputInfo *output = NULL;
+    GList *entry = NULL;
     PangoLayout *layout;
     PangoRectangle ink_extent, log_extent;
     GdkRectangle viewport;
@@ -2439,7 +2440,13 @@ paint_output (cairo_t *cr, int i, double *snap_x, double *snap_y)
 
     foo_scroll_area_get_viewport (FOO_SCROLL_AREA (randr_gui_area), &viewport);
 
-    get_geometry (output, &w, &h);
+    entry = g_list_nth (connected_outputs, i);
+    if (entry)
+        output = entry->data;
+    if (output)
+        get_geometry (output, &w, &h);
+    else
+        return;
 
     viewport.height -= 2 * MARGIN;
     viewport.width -= 2 * MARGIN;

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


More information about the Xfce4-commits mailing list