From 84e7875541d9ec9ee680450eabeb50ca76ea0db4 Mon Sep 17 00:00:00 2001 From: lenemter Date: Thu, 26 Oct 2023 15:07:58 +0900 Subject: [PATCH 1/3] WindowClone: Use cursors for dnd --- src/Widgets/WindowClone.vala | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Widgets/WindowClone.vala b/src/Widgets/WindowClone.vala index c9f4c419b..e4625beeb 100644 --- a/src/Widgets/WindowClone.vala +++ b/src/Widgets/WindowClone.vala @@ -676,6 +676,8 @@ public class Gala.WindowClone : Clutter.Actor { close_button.opacity = 0; window_title.opacity = 0; + wm.get_display ().set_cursor (Meta.Cursor.DND_IN_DRAG); + return this; } @@ -726,6 +728,8 @@ public class Gala.WindowClone : Clutter.Actor { icon_group.remove_window (window, false); } } + + wm.get_display ().set_cursor (hovered ? Meta.Cursor.DND_MOVE: Meta.Cursor.DND_IN_DRAG); } /** @@ -799,6 +803,8 @@ public class Gala.WindowClone : Clutter.Actor { // if we're dropped at the place where we came from interpret as cancel drag_canceled (); } + + wm.get_display ().set_cursor (Meta.Cursor.DEFAULT); } /** @@ -826,6 +832,8 @@ public class Gala.WindowClone : Clutter.Actor { set_window_icon_position (slot.width, slot.height, monitor_scale_factor); window_icon.restore_easing_state (); + + wm.get_display ().set_cursor (Meta.Cursor.DEFAULT); } private void set_window_icon_position (float window_width, float window_height, float scale_factor, bool aligned = true) { From 19ec1174b87831bf66d5a6cb217668155bff6e1e Mon Sep 17 00:00:00 2001 From: lenemter Date: Thu, 26 Oct 2023 15:08:16 +0900 Subject: [PATCH 2/3] PiP: Use different cursors for dnd and resize --- plugins/pip/PopupWindow.vala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/pip/PopupWindow.vala b/plugins/pip/PopupWindow.vala index 9e776de1b..4db654766 100644 --- a/plugins/pip/PopupWindow.vala +++ b/plugins/pip/PopupWindow.vala @@ -218,12 +218,15 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor { } private Clutter.Actor on_move_begin () { + wm.get_display ().set_cursor (Meta.Cursor.DND_IN_DRAG); + return this; } private void on_move_end () { reactive = true; update_screen_position (); + wm.get_display ().set_cursor (Meta.Cursor.DEFAULT); } #if HAS_MUTTER45 @@ -245,6 +248,8 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor { grab = resize_button.get_stage ().grab (resize_button); resize_button.event.connect (on_resize_event); + wm.get_display ().set_cursor (Meta.Cursor.SE_RESIZE); + return Clutter.EVENT_PROPAGATE; } @@ -303,6 +308,8 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor { resizing = false; update_screen_position (); + + wm.get_display ().set_cursor (Meta.Cursor.DEFAULT); } private void on_allocation_changed () { From 5a917dec1a86c68f14970b9ea9c1baa1946746f0 Mon Sep 17 00:00:00 2001 From: lenemter Date: Thu, 26 Oct 2023 15:09:36 +0900 Subject: [PATCH 3/3] IconGroup: Use cursors for dnd --- src/Widgets/IconGroup.vala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Widgets/IconGroup.vala b/src/Widgets/IconGroup.vala index bd21c2741..12153d345 100644 --- a/src/Widgets/IconGroup.vala +++ b/src/Widgets/IconGroup.vala @@ -519,6 +519,8 @@ namespace Gala { // disable reactivity so that workspace thumbs can get events reactive = false; + wm.get_display ().set_cursor (Meta.Cursor.DND_IN_DRAG); + return this; } @@ -534,11 +536,15 @@ namespace Gala { } else { drag_canceled (); } + + wm.get_display ().set_cursor (Meta.Cursor.DEFAULT); } private void drag_canceled () { get_parent ().remove_child (this); restore_group (); + + wm.get_display ().set_cursor (Meta.Cursor.DEFAULT); } private void restore_group () {