all repos — fluxbox @ 08ea27de38a28cc2e9f5eab3bed094fc53d48952

custom fork of the fluxbox windowmanager

Control OnTitlebar ./. OnWindow

On concurrent shortcuts OnTitlebar implies OnWindow and was so
far resolved to OnWindow while OnTitlebar is the more precise
condition.

This also requires to exclude buttons from the titlebar context,
ie. pass the position to the getContext function on press events

BUG: 1035

The patch depends on the patch to correctly resolve the tab under the
mouse since we're now passing the actual subwindows around
Thomas Lübking thomas.luebking@gmail.com
commit

08ea27de38a28cc2e9f5eab3bed094fc53d48952

parent

a1d3065994daba4bb0d1b437981afff358377bd4

2 files changed, 16 insertions(+), 7 deletions(-)

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

@@ -1590,7 +1590,12 @@ if (window().window() == win) return context | Keys::ON_WINDOW;

// /!\ old code: handle = titlebar in motionNotifyEvent but only there ! // handle() as border ?? if (handle().window() == win) return Keys::ON_WINDOWBORDER | Keys::ON_WINDOW; - if (titlebar().window() == win) return context | Keys::ON_TITLEBAR; + if (titlebar().window() == win) { + const int px = x - this->x() - window().borderWidth(); + if (px < label().x() || px > label().x() + label().width()) + return context; // one of the buttons, asked from a grabbed event + return context | Keys::ON_TITLEBAR; + } if (label().window() == win) return context | Keys::ON_TITLEBAR; // internal tabs are on title bar if (tabcontainer().window() == win)
M src/Window.ccsrc/Window.cc

@@ -2402,9 +2402,13 @@ m_last_button_y = be.y_root;

m_last_pressed_button = be.button; Keys *k = Fluxbox::instance()->keys(); - int context = frame().getContext(be.window); - if (k->doAction(be.type, be.state, be.button, - context, &winClient(), be.time)) { + int context = 0; + context = frame().getContext(be.subwindow ? be.subwindow : be.window, be.x_root, be.y_root); + if (!context && be.subwindow) + context = frame().getContext(be.window); + + if (k->doAction(be.type, be.state, be.button, context, &winClient(), be.time)) { + XAllowEvents(display, SyncPointer, CurrentTime); return; }

@@ -2415,17 +2419,17 @@ client = winClientOfLabelButtonWindow(be.window);

} + // - refeed the event into the queue so the app or titlebar subwindow gets it + if (be.subwindow) + XAllowEvents(display, ReplayPointer, CurrentTime); // if nothing was bound via keys-file then // - raise() if clickRaise is enabled // - hide open menues // - focus on clickFocus - // - refeed the event into the queue so the app gets it if (frame().window().window() == be.window) { if (screen().clickRaises()) raise(); - - XAllowEvents(display, ReplayPointer, CurrentTime); m_button_grab_x = be.x_root - frame().x() - frame().window().borderWidth(); m_button_grab_y = be.y_root - frame().y() - frame().window().borderWidth();