summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Janousek <tomi@nomi.cz>2007-07-09 14:45:47 (GMT)
committerTomas Janousek <tomi@nomi.cz>2008-01-27 14:01:14 (GMT)
commit8c3f2a8e0378ff5d649ce831b995669874fd1056 (patch)
tree816f627edb9dd8e5ef87f38ca079e011d2e9cb3b
parentc702d683e08792d764f2f4fb2ac37900f5cf1b78 (diff)
downloadfluxbox_lack-8c3f2a8e0378ff5d649ce831b995669874fd1056.zip
fluxbox_lack-8c3f2a8e0378ff5d649ce831b995669874fd1056.tar.bz2
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>
-rw-r--r--src/Screen.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 2e8c265..c6379a0 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1955,6 +1955,7 @@ void BScreen::initXinerama() {
1955 Display *display = FbTk::App::instance()->display(); 1955 Display *display = FbTk::App::instance()->display();
1956 1956
1957 if (!XineramaIsActive(display)) { 1957 if (!XineramaIsActive(display)) {
1958notactive:
1958#ifdef DEBUG 1959#ifdef DEBUG
1959 cerr<<"BScreen::initXinerama(): dont have Xinerama"<<endl; 1960 cerr<<"BScreen::initXinerama(): dont have Xinerama"<<endl;
1960#endif // DEBUG 1961#endif // DEBUG
@@ -1973,6 +1974,17 @@ void BScreen::initXinerama() {
1973 XineramaScreenInfo *screen_info; 1974 XineramaScreenInfo *screen_info;
1974 int number; 1975 int number;
1975 screen_info = XineramaQueryScreens(display, &number); 1976 screen_info = XineramaQueryScreens(display, &number);
1977
1978 /* The call may have actually failed. If this is the first time we init
1979 * Xinerama, fall back to turning it off. If not, pretend nothing
1980 * happened -- another event will tell us and it will work then. */
1981 if (!screen_info) {
1982 if (m_xinerama_headinfo)
1983 return;
1984 else
1985 goto notactive;
1986 }
1987
1976 if (m_xinerama_headinfo) 1988 if (m_xinerama_headinfo)
1977 delete [] m_xinerama_headinfo; 1989 delete [] m_xinerama_headinfo;
1978 m_xinerama_headinfo = new XineramaHeadInfo[number]; 1990 m_xinerama_headinfo = new XineramaHeadInfo[number];