Skip to content

Commit 8de5134

Browse files
lenemterdanirabbit
andauthored
WindowSwitcher: avoid grabbing modal proxy multiple times (#2761)
Co-authored-by: Danielle Foré <danielle@elementary.io>
1 parent e109122 commit 8de5134

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

data/gala.metainfo.xml.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<issue url="https://github.com/elementary/gala/issues/2675">Blur behind modal shell protocol</issue>
4343
<issue url="https://github.com/elementary/gala/issues/2676">Window selection from dock overview doesn't focus the chosen window</issue>
4444
<issue url="https://github.com/elementary/gala/issues/2685">Move to new workspace on fullscreen not working</issue>
45+
<issue url="https://github.com/elementary/gala/issues/2696">There is a transparent overlay window/object that prevents interaction with whatever is underneath it</issue>
4546
<issue url="https://github.com/elementary/dock/issues/537">Dock invisible</issue>
4647
</issues>
4748
</release>

src/Widgets/WindowSwitcher/WindowSwitcher.vala

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class Gala.WindowSwitcher : CanvasActor, GestureTarget, RootTarget {
2020

2121
private GestureController gesture_controller;
2222
private int modifier_mask;
23-
private Gala.ModalProxy modal_proxy = null;
23+
private Gala.ModalProxy? modal_proxy;
2424
private Drawing.StyleManager style_manager;
2525
private Clutter.Actor container;
2626
private Gala.Text caption;
@@ -428,10 +428,13 @@ public class Gala.WindowSwitcher : CanvasActor, GestureTarget, RootTarget {
428428
}
429429

430430
opened = show;
431-
if (show) {
432-
push_modal ();
433-
} else {
431+
if (show && modal_proxy == null) {
432+
modal_proxy = wm.push_modal (get_stage (), true);
433+
modal_proxy.allow_actions (SWITCH_WINDOWS | LOCATE_POINTER | MEDIA_KEYS);
434+
} else if (modal_proxy != null) {
434435
wm.pop_modal (modal_proxy);
436+
modal_proxy = null;
437+
435438
get_stage ().set_key_focus (null);
436439
}
437440

@@ -441,11 +444,6 @@ public class Gala.WindowSwitcher : CanvasActor, GestureTarget, RootTarget {
441444
restore_easing_state ();
442445
}
443446

444-
private void push_modal () {
445-
modal_proxy = wm.push_modal (get_stage (), true);
446-
modal_proxy.allow_actions (SWITCH_WINDOWS | LOCATE_POINTER | MEDIA_KEYS);
447-
}
448-
449447
private void close_switcher (uint32 time, bool cancel = false) {
450448
if (!opened) {
451449
return;

0 commit comments

Comments
 (0)