summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfuzaburo <[email protected]>2017-04-15 00:27:14 +0900
committermonsta <[email protected]>2017-04-15 20:50:36 +0300
commitd28d6937eeeef8a24138ef9055a8f6794267c0a4 (patch)
tree32c5033f3e63b202834fe3c2cc42207d0f73f2eb
parente16722e6b7558102c591a41f88e26e09e96100cd (diff)
downloadmate-screensaver-d28d6937eeeef8a24138ef9055a8f6794267c0a4.tar.bz2
mate-screensaver-d28d6937eeeef8a24138ef9055a8f6794267c0a4.tar.xz
Bug fix: screensaver and lock screen not correctly displayed in configurations with overlapping monitor geometries
-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;