[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/unx

Caolán McNamara caolanm at redhat.com
Thu Jul 16 04:43:58 PDT 2015


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

New commits:
commit baea35b431e03819406199ed6001d3cbbe650b9c
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
    (cherry picked from commit 74f9d9808fce14f015d56a2aaa4ec5616ed7aa3e)
    Reviewed-on: https://gerrit.libreoffice.org/17015
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

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


More information about the Libreoffice-commits mailing list