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
This commit is contained in:
parent
b93010c5e2
commit
6c2641404a
1 changed files with 11 additions and 2 deletions
|
@ -2462,6 +2462,8 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) {
|
|||
|
||||
}
|
||||
|
||||
const unsigned int DEADZONE = 4;
|
||||
|
||||
void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
|
||||
|
||||
if (m_last_pressed_button == static_cast<int>(re.button)) {
|
||||
|
@ -2474,7 +2476,7 @@ void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
|
|||
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 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
|
|||
|
||||
// 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) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue