summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2011-08-10 12:11:43 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2011-09-20 16:08:30 +0200
commitd8e783905425ee5c26420f4d0e54d1905bae6609 (patch)
treefcb92b58ebe7547c7de25d2d0eb8b5a08b4e24cc
parentd27a6708b00256d5ccccebfe38bb01cfdca8ec04 (diff)
downloadspice-d8e783905425ee5c26420f4d0e54d1905bae6609.tar.gz
spice-d8e783905425ee5c26420f4d0e54d1905bae6609.tar.xz
spice-d8e783905425ee5c26420f4d0e54d1905bae6609.zip
fix infinite loop in resolution change
After hours of investigation, I am a bit clueless.. It seems XRR is sending us spurious ScreenChangeNotify in a loop. So we keep calling init_monitors(), which creates new platform_win etc.. Although none of the clients seems to be resetting the screen (checked all XRRSet..). The fact that we create many platform_win looks like a bug to me, and indeed, it seems to help if we reuse the same platform_win over the various init_monitors() calls. Fixes rhbz #692833
-rw-r--r--client/x11/platform.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index 2adc160d..7c74d38e 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -81,7 +81,7 @@ static GLXFBConfig **fb_config = NULL;
static XIM x_input_method = NULL;
static XIC x_input_context = NULL;
-static Window platform_win;
+static Window platform_win = 0;
static XContext win_proc_context;
static ProcessLoop* main_loop = NULL;
static int focus_count = 0;
@@ -922,6 +922,9 @@ DynamicScreen::DynamicScreen(Display* display, int screen, int& next_mon_id)
, _saved_height (get_height())
, _out_of_sync (false)
{
+ if (platform_win != 0)
+ return;
+
X_DEBUG_SYNC(display);
//FIXME: replace RootWindow() in other refs as well?
XLockDisplay(display);
@@ -1226,6 +1229,9 @@ MultyMonScreen::MultyMonScreen(Display* display, int screen, int& next_mon_id)
throw;
}
+ if (platform_win != 0)
+ return;
+
XLockDisplay(display);
platform_win = XCreateSimpleWindow(display, RootWindow(display, screen), 0, 0, 1, 1, 0, 0, 0);
XUnlockDisplay(display);