summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk/app/gtksys.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-04-30 11:19:56 +0100
committerPetr Mladek <pmladek@suse.cz>2013-04-30 12:49:59 +0200
commitff3ce21011beda7c835db0979292d29dfa832d6b (patch)
tree3bc298a13e5a35528362afa5c56a8d383eb5afce /vcl/unx/gtk/app/gtksys.cxx
parent0252a22c43ec6d676c7d9a7ded0ec7064dede7c1 (diff)
fdo#62815 - tolerate crazy / out-of-bound ScreenNumbers for FullScreen
Thus making the gtk+ backend more similar to the generic backend in this regard; also be more strict about invalid monitors -> empty screens. Change-Id: Ia4f2e1205cb1d309fb1bb01f9631167339a3478e Signed-off-by: Petr Mladek <pmladek@suse.cz>
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;
}