Commit 87ff6e4b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port away from deprecated Qt::MidButton

parent afdd5b84
...@@ -2380,7 +2380,7 @@ bool AbstractClient::processDecorationButtonPress(QMouseEvent *event, bool ignor ...@@ -2380,7 +2380,7 @@ bool AbstractClient::processDecorationButtonPress(QMouseEvent *event, bool ignor
if (event->button() == Qt::LeftButton) if (event->button() == Qt::LeftButton)
com = active ? options->commandActiveTitlebar1() : options->commandInactiveTitlebar1(); com = active ? options->commandActiveTitlebar1() : options->commandInactiveTitlebar1();
else if (event->button() == Qt::MidButton) else if (event->button() == Qt::MiddleButton)
com = active ? options->commandActiveTitlebar2() : options->commandInactiveTitlebar2(); com = active ? options->commandActiveTitlebar2() : options->commandInactiveTitlebar2();
else if (event->button() == Qt::RightButton) else if (event->button() == Qt::RightButton)
com = active ? options->commandActiveTitlebar3() : options->commandInactiveTitlebar3(); com = active ? options->commandActiveTitlebar3() : options->commandInactiveTitlebar3();
......
...@@ -851,7 +851,7 @@ void CoverSwitchEffect::windowInputMouseEvent(QEvent* e) ...@@ -851,7 +851,7 @@ void CoverSwitchEffect::windowInputMouseEvent(QEvent* e)
break; break;
case Qt::LeftButton: case Qt::LeftButton:
case Qt::RightButton: case Qt::RightButton:
case Qt::MidButton: case Qt::MiddleButton:
default: default:
QPoint pos = event->pos(); QPoint pos = event->pos();
......
...@@ -576,7 +576,7 @@ void DesktopGridEffect::windowInputMouseEvent(QEvent* e) ...@@ -576,7 +576,7 @@ void DesktopGridEffect::windowInputMouseEvent(QEvent* e)
windowMove = w; windowMove = w;
effects->setElevatedWindow(windowMove, true); effects->setElevatedWindow(windowMove, true);
} }
} else if ((me->buttons() == Qt::MidButton || me->buttons() == Qt::RightButton) && windowMove == nullptr) { } else if ((me->buttons() == Qt::MiddleButton || me->buttons() == Qt::RightButton) && windowMove == nullptr) {
EffectWindow* w = windowAt(me->pos()); EffectWindow* w = windowAt(me->pos());
if (w && w->isDesktop()) { if (w && w->isDesktop()) {
w = nullptr; w = nullptr;
......
...@@ -953,7 +953,7 @@ void FlipSwitchEffect::windowInputMouseEvent(QEvent* e) ...@@ -953,7 +953,7 @@ void FlipSwitchEffect::windowInputMouseEvent(QEvent* e)
break; break;
case Qt::LeftButton: case Qt::LeftButton:
case Qt::RightButton: case Qt::RightButton:
case Qt::MidButton: case Qt::MiddleButton:
default: default:
// TODO: Change window on mouse button click // TODO: Change window on mouse button click
break; break;
......
...@@ -602,7 +602,7 @@ void PresentWindowsEffect::inputEventUpdate(const QPoint &pos, QEvent::Type type ...@@ -602,7 +602,7 @@ void PresentWindowsEffect::inputEventUpdate(const QPoint &pos, QEvent::Type type
mouseActionDesktop(m_leftButtonDesktop); mouseActionDesktop(m_leftButtonDesktop);
} }
} }
if (button == Qt::MidButton) { if (button == Qt::MiddleButton) {
if (hovering) { if (hovering) {
// mouse is hovering above a window - use MouseActionsWindow // mouse is hovering above a window - use MouseActionsWindow
mouseActionWindow(m_middleButtonWindow); mouseActionWindow(m_middleButtonWindow);
......
...@@ -1064,7 +1064,7 @@ double Options::animationTimeFactor() const ...@@ -1064,7 +1064,7 @@ double Options::animationTimeFactor() const
Options::WindowOperation Options::operationMaxButtonClick(Qt::MouseButtons button) const Options::WindowOperation Options::operationMaxButtonClick(Qt::MouseButtons button) const
{ {
return button == Qt::RightButton ? opMaxButtonRightClick : return button == Qt::RightButton ? opMaxButtonRightClick :
button == Qt::MidButton ? opMaxButtonMiddleClick : button == Qt::MiddleButton ? opMaxButtonMiddleClick :
opMaxButtonLeftClick; opMaxButtonLeftClick;
} }
......
...@@ -149,7 +149,7 @@ Qt::MouseButton x11ToQtMouseButton(int button) ...@@ -149,7 +149,7 @@ Qt::MouseButton x11ToQtMouseButton(int button)
if (button == XCB_BUTTON_INDEX_1) if (button == XCB_BUTTON_INDEX_1)
return Qt::LeftButton; return Qt::LeftButton;
if (button == XCB_BUTTON_INDEX_2) if (button == XCB_BUTTON_INDEX_2)
return Qt::MidButton; return Qt::MiddleButton;
if (button == XCB_BUTTON_INDEX_3) if (button == XCB_BUTTON_INDEX_3)
return Qt::RightButton; return Qt::RightButton;
if (button == XCB_BUTTON_INDEX_4) if (button == XCB_BUTTON_INDEX_4)
...@@ -165,7 +165,7 @@ Qt::MouseButtons x11ToQtMouseButtons(int state) ...@@ -165,7 +165,7 @@ Qt::MouseButtons x11ToQtMouseButtons(int state)
if (state & XCB_KEY_BUT_MASK_BUTTON_1) if (state & XCB_KEY_BUT_MASK_BUTTON_1)
ret |= Qt::LeftButton; ret |= Qt::LeftButton;
if (state & XCB_KEY_BUT_MASK_BUTTON_2) if (state & XCB_KEY_BUT_MASK_BUTTON_2)
ret |= Qt::MidButton; ret |= Qt::MiddleButton;
if (state & XCB_KEY_BUT_MASK_BUTTON_3) if (state & XCB_KEY_BUT_MASK_BUTTON_3)
ret |= Qt::RightButton; ret |= Qt::RightButton;
if (state & XCB_KEY_BUT_MASK_BUTTON_4) if (state & XCB_KEY_BUT_MASK_BUTTON_4)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment