Skip to content

Commit a6c3b17

Browse files
committed
Add some guards, disconnect signal handler early
1 parent 0305e15 commit a6c3b17

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Widgets/MultitaskingView/WindowClone.vala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
157157
window.notify["maximized-vertically"].disconnect (check_shadow_requirements);
158158
window.notify["minimized"].disconnect (update_targets);
159159
window.position_changed.disconnect (update_targets);
160+
161+
finish_drag ();
160162
}
161163

162164
private void reallocate () {
@@ -453,7 +455,7 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
453455
* A drag action has been initiated on us, we scale ourselves to a smaller scale and
454456
* provide a clone of ourselves as drag handle so that it can move freely.
455457
*/
456-
private Clutter.Actor drag_begin (float click_x, float click_y) {
458+
private Clutter.Actor drag_begin (float click_x, float click_y) requires (drag_handle == null) {
457459
active_shape.hide ();
458460

459461
var scale = window_icon.width / clone.width;
@@ -588,9 +590,9 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
588590
if (duration > 0) {
589591
ulong handler = 0;
590592
handler = drag_handle.transitions_completed.connect (() => {
593+
drag_handle.disconnect (handler);
591594
finish_drag ();
592595
visible = true;
593-
drag_handle.disconnect (handler);
594596
});
595597
} else {
596598
finish_drag ();

0 commit comments

Comments
 (0)