all repos — fluxbox @ c0e5d1c7a3867a82e0418e921afabf8e14909429

custom fork of the fluxbox windowmanager

Fix broken _NET_REQUEST_FRAME_EXTENTS support

There was a subtle flaw in the way fluxbox detects to which BScreen a
given Window belongs: We have to compare the RootWindow of the given
Window against the RootWindow of each BScreen.

That underlying flaw made _NET_REQUEST_FRAME_EXTENTS fail: the code path
needs a valid BScreen for the given window, otherwise we return early.

Closes #1121.
Mathias Gumz akira@fluxbox.org
commit

c0e5d1c7a3867a82e0418e921afabf8e14909429

parent

5428edf3daec57f490518ac356f60cc1a05a3693

3 files changed, 20 insertions(+), 14 deletions(-)

jump to
M src/FbTk/FbWindow.ccsrc/FbTk/FbWindow.cc

@@ -31,15 +31,18 @@

#include <X11/Xutil.h> #include <X11/Xatom.h> -#ifdef HAVE_CASSERT - #include <cassert> -#else - #include <assert.h> -#endif - +#include <cassert> #include <limits> namespace FbTk { + +Window FbWindow::rootWindow(Display* dpy, Drawable win) { + union { int i; unsigned int ui; } ignore; + Window root = None; + XGetGeometry(dpy, win, &root, &ignore.i, &ignore.i, &ignore.ui, &ignore.ui, &ignore.ui, &ignore.ui); + return root; +} + FbWindow::FbWindow(): FbDrawable(),
M src/FbTk/FbWindow.hhsrc/FbTk/FbWindow.hh

@@ -24,15 +24,11 @@ #define FBTK_FBWINDOW_HH

#include "FbDrawable.hh" #include "FbString.hh" + #include <memory> #include <string> #include <set> - -#ifdef HAVE_CMATH - #include <cmath> -#else - #include <math.h> -#endif +#include <cmath> namespace FbTk {

@@ -54,8 +50,10 @@ * @see EventManager

*/ class FbWindow: public FbDrawable { public: - FbWindow(); + static Window rootWindow(Display* dpy, Drawable win); + + FbWindow(); FbWindow(const FbWindow &win_copy); FbWindow(int screen_num,
M src/fluxbox.ccsrc/fluxbox.cc

@@ -976,10 +976,15 @@ }

BScreen *Fluxbox::searchScreen(Window window) { + Window window_root = FbTk::FbWindow::rootWindow(display(), window); + if (window_root == None) { + return 0; + } + ScreenList::iterator it = m_screen_list.begin(); ScreenList::iterator it_end = m_screen_list.end(); for (; it != it_end; ++it) { - if (*it && (*it)->rootWindow() == window) + if (*it && (*it)->rootWindow() == window_root) return *it; }