removed goto
Henrik Kinnunen fluxgen@fluxbox.org
2 files changed,
17 insertions(+),
13 deletions(-)
M
src/Screen.cc
→
src/Screen.cc
@@ -1963,21 +1963,23 @@ return 0;
return other; } +void BScreen::clearXinerama() { +#ifdef DEBUG + cerr<<"BScreen::initXinerama(): dont have Xinerama"<<endl; +#endif // DEBUG + m_xinerama_avail = false; + if (m_xinerama_headinfo) + delete [] m_xinerama_headinfo; + m_xinerama_headinfo = 0; + m_xinerama_num_heads = 0; +} void BScreen::initXinerama() { #ifdef XINERAMA Display *display = FbTk::App::instance()->display(); if (!XineramaIsActive(display)) { -notactive: -#ifdef DEBUG - cerr<<"BScreen::initXinerama(): dont have Xinerama"<<endl; -#endif // DEBUG - m_xinerama_avail = false; - if (m_xinerama_headinfo) - delete [] m_xinerama_headinfo; - m_xinerama_headinfo = 0; - m_xinerama_num_heads = 0; + clearXinerama(); return; } #ifdef DEBUG@@ -1993,10 +1995,9 @@ /* 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) + clearXinerama(); + return; } if (m_xinerama_headinfo)
M
src/Screen.hh
→
src/Screen.hh
@@ -407,6 +407,9 @@ int numHeads() const { return m_xinerama_num_heads; }
void initXinerama(); void clearHeads(); + /// clean up xinerama + void clearXinerama(); + /** * Determines head number for a position * @param x position in pixels on the screen