* @returns if a command was performed, whether or not the event should be filtered out * if no command was performed, std::nullopt */
| 805 | * if no command was performed, std::nullopt |
| 806 | */ |
| 807 | std::optional<bool> performModifierWindowMouseAction(PointerButtonEvent *event, Window *window) |
| 808 | { |
| 809 | if (event->modifiersRelevantForShortcuts != options->commandAllModifier()) { |
| 810 | return std::nullopt; |
| 811 | } |
| 812 | if (input()->pointer()->isConstrained() || workspace()->globalShortcutsDisabled()) { |
| 813 | return std::nullopt; |
| 814 | } |
| 815 | switch (event->button) { |
| 816 | case Qt::LeftButton: |
| 817 | return !window->performMousePressCommand(options->commandAll1(), event->position); |
| 818 | case Qt::MiddleButton: |
| 819 | return !window->performMousePressCommand(options->commandAll2(), event->position); |
| 820 | case Qt::RightButton: |
| 821 | return !window->performMousePressCommand(options->commandAll3(), event->position); |
| 822 | default: |
| 823 | return std::nullopt; |
| 824 | } |
| 825 | } |
| 826 | /** |
| 827 | * @returns if a command was performed, whether or not the event should be filtered out |
| 828 | * if no command was performed, std::nullopt |
no test coverage detected