summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk/app/gtksys.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/gtk/app/gtksys.cxx')
-rw-r--r--vcl/unx/gtk/app/gtksys.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
index bc06b25a1ccc..c822fd260993 100644
--- a/vcl/unx/gtk/app/gtksys.cxx
+++ b/vcl/unx/gtk/app/gtksys.cxx
@@ -70,6 +70,13 @@ struct GdkRectangleEqual
}
+/**
+ * GtkSalSystem::countScreenMonitors()
+ *
+ * This method builds the vector which allows us to map from VCL's
+ * idea of linear integer ScreenNumber to to gtk+'s rather more
+ * complicated screen + monitor concept.
+ */
void
GtkSalSystem::countScreenMonitors()
{
@@ -134,6 +141,11 @@ GtkSalSystem::getScreenMonitorFromIdx (int nIdx, gint &nMonitor)
break;
}
nMonitor = nIdx;
+
+ // handle invalid monitor indexes as non-existent screens
+ if (nMonitor < 0 || (pScreen && nMonitor >= gdk_screen_get_n_monitors (pScreen)))
+ pScreen = NULL;
+
return pScreen;
}