diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-07-13 16:18:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-07-13 16:19:46 +0100 |
commit | 74f9d9808fce14f015d56a2aaa4ec5616ed7aa3e (patch) | |
tree | 046bb76ca83054e26fa223d862862d3c3d0c7025 /vcl | |
parent | e82951a858530a05f3ceb66157baf60bbc2d09eb (diff) |
Resolves: tdf#92671 union each monitor workarea to find best screen workarea
Change-Id: Ia77063f7008f960373861b8b59710abe9918865c
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk/window/gtksalframe.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
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 } |