From 74f9d9808fce14f015d56a2aaa4ec5616ed7aa3e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 13 Jul 2015 16:18:41 +0100 Subject: Resolves: tdf#92671 union each monitor workarea to find best screen workarea Change-Id: Ia77063f7008f960373861b8b59710abe9918865c --- vcl/unx/gtk/window/gtksalframe.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'vcl') diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx index 5496bf6e6f37..3bedf781230a 100644 --- a/vcl/unx/gtk/window/gtksalframe.cxx +++ b/vcl/unx/gtk/window/gtksalframe.cxx @@ -2157,10 +2157,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 } -- cgit v1.2.3