all repos — fluxbox @ 8c3f2a8e0378ff5d649ce831b995669874fd1056

custom fork of the fluxbox windowmanager

Deal with XineramaQueryScreens failure.

The call to XineramaQueryScreens may return NULL in some cases. This patch
tries to deal with that somehow.

Signed-off-by: Tomas Janousek <tomi@nomi.cz>
Tomas Janousek tomi@nomi.cz
commit

8c3f2a8e0378ff5d649ce831b995669874fd1056

parent

c702d683e08792d764f2f4fb2ac37900f5cf1b78

1 files changed, 12 insertions(+), 0 deletions(-)

jump to
M src/Screen.ccsrc/Screen.cc

@@ -1955,6 +1955,7 @@ #ifdef XINERAMA

Display *display = FbTk::App::instance()->display(); if (!XineramaIsActive(display)) { +notactive: #ifdef DEBUG cerr<<"BScreen::initXinerama(): dont have Xinerama"<<endl; #endif // DEBUG

@@ -1973,6 +1974,17 @@

XineramaScreenInfo *screen_info; int number; screen_info = XineramaQueryScreens(display, &number); + + /* The call may have actually failed. If this is the first time we init + * Xinerama, fall back to turning it off. If not, pretend nothing + * happened -- another event will tell us and it will work then. */ + if (!screen_info) { + if (m_xinerama_headinfo) + return; + else + goto notactive; + } + if (m_xinerama_headinfo) delete [] m_xinerama_headinfo; m_xinerama_headinfo = new XineramaHeadInfo[number];