Changeset View
Changeset View
Standalone View
Standalone View
input.cpp
| Show First 20 Lines • Show All 701 Lines • ▼ Show 20 Line(s) | 701 | enum class MouseAction { | |||
|---|---|---|---|---|---|
| 702 | ModifierOnly, | 702 | ModifierOnly, | ||
| 703 | ModifierAndWindow | 703 | ModifierAndWindow | ||
| 704 | }; | 704 | }; | ||
| 705 | std::pair<bool, bool> performClientMouseAction(QMouseEvent *event, AbstractClient *client, MouseAction action = MouseAction::ModifierOnly) | 705 | std::pair<bool, bool> performClientMouseAction(QMouseEvent *event, AbstractClient *client, MouseAction action = MouseAction::ModifierOnly) | ||
| 706 | { | 706 | { | ||
| 707 | Options::MouseCommand command = Options::MouseNothing; | 707 | Options::MouseCommand command = Options::MouseNothing; | ||
| 708 | bool wasAction = false; | 708 | bool wasAction = false; | ||
| 709 | if (static_cast<MouseEvent*>(event)->modifiersRelevantForGlobalShortcuts() == options->commandAllModifier()) { | 709 | if (static_cast<MouseEvent*>(event)->modifiersRelevantForGlobalShortcuts() == options->commandAllModifier()) { | ||
| 710 | if (!input()->pointer()->isConstrained()) { | 710 | if (!input()->pointer()->isConstrained() && !workspace()->globalShortcutsDisabled()) { | ||
| 711 | wasAction = true; | 711 | wasAction = true; | ||
| 712 | switch (event->button()) { | 712 | switch (event->button()) { | ||
| 713 | case Qt::LeftButton: | 713 | case Qt::LeftButton: | ||
| 714 | command = options->commandAll1(); | 714 | command = options->commandAll1(); | ||
| 715 | break; | 715 | break; | ||
| 716 | case Qt::MiddleButton: | 716 | case Qt::MiddleButton: | ||
| 717 | command = options->commandAll2(); | 717 | command = options->commandAll2(); | ||
| 718 | break; | 718 | break; | ||
| Show All 16 Lines | |||||
| 735 | return std::make_pair(wasAction, false); | 735 | return std::make_pair(wasAction, false); | ||
| 736 | } | 736 | } | ||
| 737 | 737 | | |||
| 738 | std::pair<bool, bool> performClientWheelAction(QWheelEvent *event, AbstractClient *c, MouseAction action = MouseAction::ModifierOnly) | 738 | std::pair<bool, bool> performClientWheelAction(QWheelEvent *event, AbstractClient *c, MouseAction action = MouseAction::ModifierOnly) | ||
| 739 | { | 739 | { | ||
| 740 | bool wasAction = false; | 740 | bool wasAction = false; | ||
| 741 | Options::MouseCommand command = Options::MouseNothing; | 741 | Options::MouseCommand command = Options::MouseNothing; | ||
| 742 | if (static_cast<WheelEvent*>(event)->modifiersRelevantForGlobalShortcuts() == options->commandAllModifier()) { | 742 | if (static_cast<WheelEvent*>(event)->modifiersRelevantForGlobalShortcuts() == options->commandAllModifier()) { | ||
| 743 | if (!input()->pointer()->isConstrained() && !workspace()->globalShortcutsDisabled()) { | ||||
| 743 | wasAction = true; | 744 | wasAction = true; | ||
| 744 | command = options->operationWindowMouseWheel(-1 * event->angleDelta().y()); | 745 | command = options->operationWindowMouseWheel(-1 * event->angleDelta().y()); | ||
| 746 | } | ||||
| 745 | } else { | 747 | } else { | ||
| 746 | if (action == MouseAction::ModifierAndWindow) { | 748 | if (action == MouseAction::ModifierAndWindow) { | ||
| 747 | command = c->getWheelCommand(Qt::Vertical, &wasAction); | 749 | command = c->getWheelCommand(Qt::Vertical, &wasAction); | ||
| 748 | } | 750 | } | ||
| 749 | } | 751 | } | ||
| 750 | if (wasAction) { | 752 | if (wasAction) { | ||
| 751 | return std::make_pair(wasAction, !c->performMouseCommand(command, event->globalPos())); | 753 | return std::make_pair(wasAction, !c->performMouseCommand(command, event->globalPos())); | ||
| 752 | } | 754 | } | ||
| ▲ Show 20 Lines • Show All 1438 Lines • Show Last 20 Lines | |||||