make the wheel mouse shade anywhere on the titlebar, and not press buttons. thanks woodlbock.
This commit is contained in:
parent
0aae724186
commit
17fbff7d70
2 changed files with 17 additions and 8 deletions
|
@ -2739,7 +2739,7 @@ void BlackboxWindow::buttonPressEvent(const XButtonEvent *be) {
|
||||||
client.window);
|
client.window);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (frame.maximize_button == be->window) {
|
if (frame.maximize_button == be->window && be->button <= 3) {
|
||||||
redrawMaximizeButton(True);
|
redrawMaximizeButton(True);
|
||||||
} else if (be->button == 1 || (be->button == 3 && be->state == Mod1Mask)) {
|
} else if (be->button == 1 || (be->button == 3 && be->state == Mod1Mask)) {
|
||||||
if (! flags.focused)
|
if (! flags.focused)
|
||||||
|
@ -2817,13 +2817,19 @@ void BlackboxWindow::buttonPressEvent(const XButtonEvent *be) {
|
||||||
// mouse wheel up
|
// mouse wheel up
|
||||||
} else if (be->button == 4) {
|
} else if (be->button == 4) {
|
||||||
if ((be->window == frame.label ||
|
if ((be->window == frame.label ||
|
||||||
be->window == frame.title) &&
|
be->window == frame.title ||
|
||||||
|
be->window == frame.maximize_button ||
|
||||||
|
be->window == frame.iconify_button ||
|
||||||
|
be->window == frame.close_button) &&
|
||||||
! flags.shaded)
|
! flags.shaded)
|
||||||
shade();
|
shade();
|
||||||
// mouse wheel down
|
// mouse wheel down
|
||||||
} else if (be->button == 5) {
|
} else if (be->button == 5) {
|
||||||
if ((be->window == frame.label ||
|
if ((be->window == frame.label ||
|
||||||
be->window == frame.title) &&
|
be->window == frame.title ||
|
||||||
|
be->window == frame.maximize_button ||
|
||||||
|
be->window == frame.iconify_button ||
|
||||||
|
be->window == frame.close_button) &&
|
||||||
flags.shaded)
|
flags.shaded)
|
||||||
shade();
|
shade();
|
||||||
}
|
}
|
||||||
|
@ -2836,21 +2842,22 @@ void BlackboxWindow::buttonReleaseEvent(const XButtonEvent *re) {
|
||||||
client.window);
|
client.window);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (re->window == frame.maximize_button) {
|
if (re->window == frame.maximize_button &&
|
||||||
|
re->button >= 1 && re->button <= 3) {
|
||||||
if ((re->x >= 0 && re->x <= static_cast<signed>(frame.button_w)) &&
|
if ((re->x >= 0 && re->x <= static_cast<signed>(frame.button_w)) &&
|
||||||
(re->y >= 0 && re->y <= static_cast<signed>(frame.button_w))) {
|
(re->y >= 0 && re->y <= static_cast<signed>(frame.button_w))) {
|
||||||
maximize(re->button);
|
maximize(re->button);
|
||||||
} else {
|
} else {
|
||||||
redrawMaximizeButton(flags.maximized);
|
redrawMaximizeButton(flags.maximized);
|
||||||
}
|
}
|
||||||
} else if (re->window == frame.iconify_button) {
|
} else if (re->window == frame.iconify_button && re->button == 1) {
|
||||||
if ((re->x >= 0 && re->x <= static_cast<signed>(frame.button_w)) &&
|
if ((re->x >= 0 && re->x <= static_cast<signed>(frame.button_w)) &&
|
||||||
(re->y >= 0 && re->y <= static_cast<signed>(frame.button_w))) {
|
(re->y >= 0 && re->y <= static_cast<signed>(frame.button_w))) {
|
||||||
iconify();
|
iconify();
|
||||||
} else {
|
} else {
|
||||||
redrawIconifyButton(False);
|
redrawIconifyButton(False);
|
||||||
}
|
}
|
||||||
} else if (re->window == frame.close_button) {
|
} else if (re->window == frame.close_button & re->button == 1) {
|
||||||
if ((re->x >= 0 && re->x <= static_cast<signed>(frame.button_w)) &&
|
if ((re->x >= 0 && re->x <= static_cast<signed>(frame.button_w)) &&
|
||||||
(re->y >= 0 && re->y <= static_cast<signed>(frame.button_w)))
|
(re->y >= 0 && re->y <= static_cast<signed>(frame.button_w)))
|
||||||
close();
|
close();
|
||||||
|
|
|
@ -710,9 +710,11 @@ void Blackbox::process_event(XEvent *e) {
|
||||||
if (win) {
|
if (win) {
|
||||||
if (win->isIconic())
|
if (win->isIconic())
|
||||||
win->deiconify(False, True);
|
win->deiconify(False, True);
|
||||||
|
if (win->isShaded())
|
||||||
|
win->shade();
|
||||||
if (win->isVisible() && win->setInputFocus()) {
|
if (win->isVisible() && win->setInputFocus()) {
|
||||||
//win->getScreen()->getWorkspace(win->getWorkspaceNumber())->
|
win->getScreen()->getWorkspace(win->getWorkspaceNumber())->
|
||||||
// raiseWindow(win);
|
raiseWindow(win);
|
||||||
win->installColormap(True);
|
win->installColormap(True);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue