Raise window on button up - #5273
Open
AlanGriffiths wants to merge 2 commits into
Open
AlanGriffiths wants to merge 2 commits into
AlanGriffiths wants to merge 2 commits into
Conversation
… up, not on the initial button down event
… up, not on the initial button down event (more)
TICS Quality Gate✔️ Passedmir
|
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 4
Open (4)
The example policy no longer selects/focuses a window on a normal primary click (selection is now… · New This changes behavior compared to the previous implementation: pointer-moving gestures (shift +… · New Selection/raise now happens on anymir_pointer_action_button_up, regardless of which button was… · New The test now publishes both a button-down and button-up event, but it doesn’t assert the new… · New
What changed in this PR
Updates pointer focus/raise behavior to occur on button release (to better support drag & drop) and adjusts related tests/examples.
Changes:
- Update core floating window manager to select/raise windows on
button_upinstead ofbutton_down. - Extend the pointer selection test to emit both down + up events.
- Refine the example policy to only select the active window when initiating an Alt+tertiary-button action.
| File | Description |
|---|---|
| tests/window_management_tests/test_floating_window_manager.cpp | Adjusts the selection test to publish both pointer down and pointer up. |
| src/miral/floating_window_manager.cpp | Moves window selection/raise to mir_pointer_action_button_up and narrows button_down handling to gesture initiation. |
| examples/example-server-lib/floating_window_manager.cpp | Limits select_active_window() to the Alt+tertiary-button path within button-down handling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
91
to
+100
| if (action == mir_pointer_action_button_down) | ||
| { | ||
| if (auto const window = tools.window_at(cursor)) | ||
| tools.select_active_window(window); | ||
|
|
||
| if (auto const window = tools.active_window()) | ||
| if (mir_pointer_event_button_state(event, mir_pointer_button_tertiary)) | ||
| { | ||
| if (mir_pointer_event_button_state(event, mir_pointer_button_tertiary)) | ||
| if (modifiers == mir_input_event_modifier_alt) | ||
| { | ||
| if (modifiers == mir_input_event_modifier_alt) | ||
| if (auto const window = tools.window_at(cursor)) | ||
| tools.select_active_window(window); | ||
|
|
||
| if (auto const window = tools.active_window()) |
Comment on lines
+401
to
+409
|
|
||
| if (auto const window = tools.active_window()) | ||
| { | ||
| begin_pointer_gesture( | ||
| tools.info_for(window), | ||
| mir_pointer_event_input_event(event), | ||
| Gesture::pointer_moving, mir_resize_edge_none); | ||
| consumes_event = true; | ||
| } |
Comment on lines
+415
to
+417
| if (auto const window = tools.window_at(new_cursor)) | ||
| { | ||
| tools.select_active_window(window); |
| {}, | ||
| {}); | ||
|
|
||
| publish_event(*select_event1); |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #5250
Changes the focus/raise behavior to work better with drag & drop