summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-13 16:18:41 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-07-16 11:43:32 +0000
commitbaea35b431e03819406199ed6001d3cbbe650b9c (patch)
tree2b9580715c02034a723d7ff8ad2c49ff027d520a
parent8c0ace56528cfd469d55c17a6e9b32c33e715ec0 (diff)
Resolves: tdf#92671 union each monitor workarea to find best screen workarea
Change-Id: Ia77063f7008f960373861b8b59710abe9918865c (cherry picked from commit 74f9d9808fce14f015d56a2aaa4ec5616ed7aa3e) Reviewed-on: https://gerrit.libreoffice.org/17015 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r--vcl/unx/gtk/window/gtksalframe.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 3bee994f8f59..ce2918f05551 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -2158,10 +2158,16 @@ void GtkSalFrame::GetWorkArea( Rectangle& rRect )
rRect = GetGtkSalData()->GetGtkDisplay()->getWMAdaptor()->getWorkArea( 0 );
#else
GdkScreen *pScreen = gtk_window_get_screen(GTK_WINDOW(m_pWindow));
- gint nMonitor = gdk_screen_get_monitor_at_window(pScreen, widget_get_window(m_pWindow));
- GdkRectangle aRect;
- gdk_screen_get_monitor_workarea(pScreen, nMonitor, &aRect);
- rRect = Rectangle(aRect.x, aRect.y, aRect.width, aRect.height);
+ Rectangle aRetRect;
+ int max = gdk_screen_get_n_monitors (pScreen);
+ for (int i = 0; i < max; ++i)
+ {
+ GdkRectangle aRect;
+ gdk_screen_get_monitor_workarea(pScreen, i, &aRect);
+ Rectangle aMonitorRect(aRect.x, aRect.y, aRect.x+aRect.width, aRect.y+aRect.height);
+ aRetRect.Union(aMonitorRect);
+ }
+ rRect = aRetRect;
#endif
}