Switch to XCB_BUTTON_INDEX* for Pointer Button constants

This commit is contained in:
Martin Gräßlin 2013-09-13 09:12:26 +02:00
parent 85152773fc
commit 5eb69aba9c

View file

@ -1040,7 +1040,7 @@ bool Client::buttonPressEvent(xcb_window_t w, int button, int state, int x, int
const bool bModKeyHeld = modKeyDown(state); const bool bModKeyHeld = modKeyDown(state);
if (isSplash() if (isSplash()
&& button == Button1 && !bModKeyHeld) { && button == XCB_BUTTON_INDEX_1 && !bModKeyHeld) {
// hide splashwindow if the user clicks on it // hide splashwindow if the user clicks on it
hideClient(true); hideClient(true);
if (w == wrapperId()) if (w == wrapperId())
@ -1054,18 +1054,18 @@ bool Client::buttonPressEvent(xcb_window_t w, int button, int state, int x, int
if (bModKeyHeld) { if (bModKeyHeld) {
was_action = true; was_action = true;
switch(button) { switch(button) {
case Button1: case XCB_BUTTON_INDEX_1:
com = options->commandAll1(); com = options->commandAll1();
break; break;
case Button2: case XCB_BUTTON_INDEX_2:
com = options->commandAll2(); com = options->commandAll2();
break; break;
case Button3: case XCB_BUTTON_INDEX_3:
com = options->commandAll3(); com = options->commandAll3();
break; break;
case Button4: case XCB_BUTTON_INDEX_4:
case Button5: case XCB_BUTTON_INDEX_5:
com = options->operationWindowMouseWheel(button == Button4 ? 120 : -120); com = options->operationWindowMouseWheel(button == XCB_BUTTON_INDEX_4 ? 120 : -120);
break; break;
} }
} else { } else {
@ -1074,17 +1074,17 @@ bool Client::buttonPressEvent(xcb_window_t w, int button, int state, int x, int
was_action = true; was_action = true;
perform_handled = true; perform_handled = true;
switch(button) { switch(button) {
case Button1: case XCB_BUTTON_INDEX_1:
com = options->commandWindow1(); com = options->commandWindow1();
break; break;
case Button2: case XCB_BUTTON_INDEX_2:
com = options->commandWindow2(); com = options->commandWindow2();
break; break;
case Button3: case XCB_BUTTON_INDEX_3:
com = options->commandWindow3(); com = options->commandWindow3();
break; break;
case Button4: case XCB_BUTTON_INDEX_4:
case Button5: case XCB_BUTTON_INDEX_5:
com = options->commandWindowWheel(); com = options->commandWindowWheel();
break; break;
} }
@ -1139,13 +1139,13 @@ bool Client::processDecorationButtonPress(int button, int /*state*/, int x, int
if (!wantsInput()) // we cannot be active, use it anyway if (!wantsInput()) // we cannot be active, use it anyway
active = true; active = true;
if (button == Button1) if (button == XCB_BUTTON_INDEX_1)
com = active ? options->commandActiveTitlebar1() : options->commandInactiveTitlebar1(); com = active ? options->commandActiveTitlebar1() : options->commandInactiveTitlebar1();
else if (button == Button2) else if (button == XCB_BUTTON_INDEX_2)
com = active ? options->commandActiveTitlebar2() : options->commandInactiveTitlebar2(); com = active ? options->commandActiveTitlebar2() : options->commandInactiveTitlebar2();
else if (button == Button3) else if (button == XCB_BUTTON_INDEX_3)
com = active ? options->commandActiveTitlebar3() : options->commandInactiveTitlebar3(); com = active ? options->commandActiveTitlebar3() : options->commandInactiveTitlebar3();
if (button == Button1 if (button == XCB_BUTTON_INDEX_1
&& com != Options::MouseOperationsMenu // actions where it's not possible to get the matching && com != Options::MouseOperationsMenu // actions where it's not possible to get the matching
&& com != Options::MouseMinimize // mouse release event && com != Options::MouseMinimize // mouse release event
&& com != Options::MouseDragTab) { && com != Options::MouseDragTab) {
@ -1182,13 +1182,13 @@ void Client::processMousePressEvent(QMouseEvent* e)
int button; int button;
switch(e->button()) { switch(e->button()) {
case Qt::LeftButton: case Qt::LeftButton:
button = Button1; button = XCB_BUTTON_INDEX_1;
break; break;
case Qt::MidButton: case Qt::MidButton:
button = Button2; button = XCB_BUTTON_INDEX_2;
break; break;
case Qt::RightButton: case Qt::RightButton:
button = Button3; button = XCB_BUTTON_INDEX_3;
break; break;
default: default:
return; return;