summaryrefslogtreecommitdiff
path: root/src/gs-window-x11.c
diff options
context:
space:
mode:
authorfuzaburo <[email protected]>2017-04-15 00:27:14 +0900
committerfuzaburo <[email protected]>2017-04-15 00:27:14 +0900
commitfd66fc47779b7f14c9b46682607c24af6ed075d4 (patch)
tree0283e8a816ed9fa212382a706784d5f9f0ed3336 /src/gs-window-x11.c
parent9a448b152b3ee72d2141a6e71f82b54e0f79ba76 (diff)
downloadmate-screensaver-fd66fc47779b7f14c9b46682607c24af6ed075d4.tar.bz2
mate-screensaver-fd66fc47779b7f14c9b46682607c24af6ed075d4.tar.xz
Bug fix: screensaver and lock screen not correctly displayed in configurations with overlapping monitor geometries
Diffstat (limited to 'src/gs-window-x11.c')
-rw-r--r--src/gs-window-x11.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c
index df22ede..dbdb469 100644
--- a/src/gs-window-x11.c
+++ b/src/gs-window-x11.c
@@ -305,6 +305,7 @@ get_outside_region (GSWindow *window)
GdkDisplay *display;
#if GTK_CHECK_VERSION (3, 22, 0)
int i;
+ int num_monitors;
#else
GdkScreen *screen;
int mon;
@@ -319,16 +320,18 @@ get_outside_region (GSWindow *window)
region = cairo_region_create ();
#if GTK_CHECK_VERSION (3, 22, 0)
- for (i = 0; i < gdk_display_get_n_monitors (display); i++)
+ num_monitors = gdk_display_get_n_monitors (display);
+ for (i = 0; i < num_monitors; i++)
#else
- for (mon = 0; mon < gdk_screen_get_n_monitors (screen); mon++)
+ for (mon = 0; mon < window->priv->monitor; mon++)
#endif
{
#if GTK_CHECK_VERSION (3, 22, 0)
GdkMonitor *mon = gdk_display_get_monitor (display, i);
-#endif
+
if (mon != window->priv->monitor)
{
+#endif
GdkRectangle geometry;
cairo_rectangle_int_t rectangle;
@@ -343,7 +346,13 @@ get_outside_region (GSWindow *window)
rectangle.width = geometry.width;
rectangle.height = geometry.height;
cairo_region_union_rectangle (region, &rectangle);
+#if GTK_CHECK_VERSION (3, 22, 0)
}
+ else
+ {
+ break;
+ }
+#endif
}
return region;