From 12e9f1d2a9460b7ca68636a8b45a9106a9057c58 Mon Sep 17 00:00:00 2001 From: Guillaume Pothier Date: Sun, 23 Nov 2008 19:13:23 +0000 Subject: [PATCH] Added check to ensure that TopLevel::screen never returns -1 svn path=/trunk/KDE/kdebase/workspace/; revision=888093 --- toplevel.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/toplevel.cpp b/toplevel.cpp index 9ac3da10bc..06b6922fea 100644 --- a/toplevel.cpp +++ b/toplevel.cpp @@ -342,7 +342,13 @@ int Toplevel::screen() const { if( !options->xineramaEnabled ) return 0; - return workspace()->screenNumber( geometry().center()); + int s = workspace()->screenNumber( geometry().center()); + if( s < 0 ) + { + kDebug() << "center" << geometry().center() << "screen" << s; + return 0; + } + return s; } bool Toplevel::isOnScreen( int screen ) const