[Xfce4-commits] [xfce/xfce4-settings] 01/01: display: Fix race condition on monitor dis/connecting
noreply at xfce.org
noreply at xfce.org
Mon Mar 12 23:12:53 CET 2018
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h x f c e - 4 . 1 2
in repository xfce/xfce4-settings.
commit 00b0f9e0349988f3dcfab9b042cbb702cd90246f
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
---
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 21216ab..5ebcfb3 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -2430,7 +2430,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;
@@ -2447,7 +2448,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