all repos — fluxbox @ 6c2641404a62c55a231f8004e237aca459501309

custom fork of the fluxbox windowmanager

allow 4px deadzone for clicks

For the shaky ones.
Since this introduces a visible gap between trigger and move event, we
temporarily manipulate the coordinates in the global last event what
covers the outdated patch #134

REQUEST: 178
Thomas Lübking thomas.luebking@gmail.com
commit

6c2641404a62c55a231f8004e237aca459501309

parent

b93010c5e27081d73abd8ed16b0ce3e789ae3edb

1 files changed, 11 insertions(+), 2 deletions(-)

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

@@ -2462,6 +2462,8 @@

} +const unsigned int DEADZONE = 4; + void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) { if (m_last_pressed_button == static_cast<int>(re.button)) {

@@ -2474,7 +2476,7 @@ else if (isResizing())

stopResizing(); else if (m_attaching_tab) attachTo(re.x_root, re.y_root); - else if (m_last_button_x == re.x_root && m_last_button_y == re.y_root) { + else if (std::abs(m_last_button_x - re.x_root) + std::abs(m_last_button_y - re.y_root) < DEADZONE) { int context = 0; context = frame().getContext(re.subwindow ? re.subwindow : re.window, re.x_root, re.y_root);

@@ -2505,7 +2507,14 @@ }

// in case someone put MoveX :StartMoving etc into keys, we have // to activate it before doing the actual motionNotify code - Fluxbox::instance()->keys()->doAction(me.type, me.state, m_last_pressed_button, context, &winClient(), me.time); + if (std::abs(m_last_button_x - me.x_root) + std::abs(m_last_button_y - me.y_root) >= DEADZONE) { + XEvent &e = const_cast<XEvent&>(Fluxbox::instance()->lastEvent()); // is copy of "me" + e.xmotion.x_root = m_last_button_x; + e.xmotion.y_root = m_last_button_y; + Fluxbox::instance()->keys()->doAction(me.type, me.state, m_last_pressed_button, context, &winClient(), me.time); + e.xmotion.x = me.x_root; + e.xmotion.y = me.y_root; + } if (moving) {