summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
}