summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2012-03-22 17:44:54 -0400
committerMatthias Clasen <mclasen@redhat.com>2012-03-23 09:09:14 -0400
commit88a1d4d5a1e26545e9a69ef9d11d37f62b608e14 (patch)
tree3346e988ef379f734af34da8cf626a025c5f15a9 /gdk
parent482195d7888696527557cc6af6ab3ecb4bd4ba5b (diff)
downloadgtk+-88a1d4d5a1e26545e9a69ef9d11d37f62b608e14.tar.gz
x11: Deal better with L-shaped monitor arrangements
The code for calculating the per-monitor workarea was ignoring the fact that the EWMH workarea property can only handle rectangular workareas, and thus can't really do justice to general monitor arrangements. As a workaround, we ignore it for anything but the primary monitor. And we ignore it for the primary monitor as well if it does not even cover it. https://bugzilla.gnome.org/show_bug.cgi?id=672163
Diffstat (limited to 'gdk')
-rw-r--r--gdk/x11/gdkscreen-x11.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
index c14e065d1b..a6d8ba6582 100644
--- a/gdk/x11/gdkscreen-x11.c
+++ b/gdk/x11/gdkscreen-x11.c
@@ -372,8 +372,19 @@ gdk_x11_screen_get_monitor_workarea (GdkScreen *screen,
GdkRectangle workarea;
gdk_x11_screen_get_monitor_geometry (screen, monitor_num, dest);
- get_work_area (screen, &workarea);
- gdk_rectangle_intersect (&workarea, dest, dest);
+
+ /* The EWMH constrains workarea to be a rectangle, so it
+ * can't adequately deal with L-shaped monitor arrangements.
+ * As a workaround, we ignore the workarea for anything
+ * but the primary monitor. Since that is where the 'desktop
+ * chrome' usually lives, this works ok in practice.
+ */
+ if (monitor_num == GDK_X11_SCREEN (screen)->primary_monitor)
+ {
+ get_work_area (screen, &workarea);
+ if (gdk_rectangle_intersect (dest, &workarea, &workarea))
+ *dest = workarea;
+ }
}
static GdkVisual *