Skip to content

Commit

Permalink
Merge pull request #3156 from MirServer/fix-dragging-satellite-windows
Browse files Browse the repository at this point in the history
Fix dragging and resizing satellite windows
  • Loading branch information
Saviq authored Dec 1, 2023
2 parents f449c0e + 47997fa commit 04ed7d3
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/miral/minimal_window_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,9 @@ bool miral::MinimalWindowManager::Impl::handle_pointer_event(MirPointerEvent con
shift_keys == gesture_shift_keys &&
mir_pointer_event_button_state(event, pointer_gesture_button))
{
if (gesture_window &&
tools.select_active_window(gesture_window) == gesture_window)
if (gesture_window)
{
tools.drag_active_window(new_cursor - old_cursor);
tools.drag_window(gesture_window, new_cursor - old_cursor);
consumes_event = true;
}
else
Expand Down Expand Up @@ -510,8 +509,7 @@ bool miral::MinimalWindowManager::Impl::handle_touch_event(MirTouchEvent const*
case Gesture::touch_resizing:
if (is_drag && gesture_shift_keys == shift_keys)
{
if (gesture_window &&
tools.select_active_window(gesture_window) == gesture_window)
if (gesture_window)
{
apply_resize_by(new_touch - old_touch);
consumes_event = true;
Expand All @@ -530,10 +528,9 @@ bool miral::MinimalWindowManager::Impl::handle_touch_event(MirTouchEvent const*
case Gesture::touch_moving:
if (is_drag && gesture_shift_keys == shift_keys)
{
if (gesture_window &&
tools.select_active_window(gesture_window) == gesture_window)
if (gesture_window)
{
tools.drag_active_window(new_touch - old_touch);
tools.drag_window(gesture_window, new_touch - old_touch);
consumes_event = true;
}
else
Expand Down Expand Up @@ -565,8 +562,7 @@ bool miral::MinimalWindowManager::Impl::handle_touch_event(MirTouchEvent const*

void miral::MinimalWindowManager::Impl::apply_resize_by(Displacement movement)
{
if (gesture_window &&
tools.select_active_window(gesture_window) == gesture_window)
if (gesture_window)
{
auto const top_left = resize_top_left;
Rectangle const old_pos{top_left, resize_size};
Expand Down

0 comments on commit 04ed7d3

Please sign in to comment.