Skip to content

Raise window on button up - #5273

Open
AlanGriffiths wants to merge 2 commits into
mainfrom
raise-active-window-on-button-up
Open

AlanGriffiths wants to merge 2 commits into
mainfrom
raise-active-window-on-button-up

Conversation

@AlanGriffiths

Copy link
Copy Markdown
Contributor

Closes #5250

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

@github-actions

Copy link
Copy Markdown

TICS Quality Gate

✔️ Passed

mir

Coding Standards: ✔️ Passed

✔️ Condition “No new Coding Standard Violations for level 1, 2, 3 with respect to Previous analysis” passed.

See the results in the TICS Viewer

The following files have been checked for this project
  • src/miral/floating_window_manager.cpp

TICS / TICS / Run TICS analysis

@AlanGriffiths
AlanGriffiths marked this pull request as ready for review October 5, 2026 13:42
Copilot AI balanced review requested due to automatic review settings October 5, 2026 13:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

Open (4)
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_up instead of button_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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change window focus on drag and drop

2 participants