[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara caolanm at redhat.com
Mon Jul 13 08:20:18 PDT 2015


 vcl/unx/gtk/window/gtksalframe.cxx |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 74f9d9808fce14f015d56a2aaa4ec5616ed7aa3e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jul 13 16:18:41 2015 +0100

    Resolves: tdf#92671 union each monitor workarea to find best screen workarea
    
    Change-Id: Ia77063f7008f960373861b8b59710abe9918865c

diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 5496bf6..3bedf78 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
 }
 


More information about the Libreoffice-commits mailing list