Skip to content

Commit 3ca29b6

Browse files
committed
WindowOverview: Dim background, keep other windows visible
1 parent 853b013 commit 3ca29b6

File tree

3 files changed

+28
-13
lines changed

3 files changed

+28
-13
lines changed

src/DesktopIntegration.vala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,12 @@ public class Gala.DesktopIntegration : GLib.Object {
236236
throw new IOError.NOT_FOUND ("App not found");
237237
}
238238

239+
var sorted_windows = wm.get_display ().sort_windows_by_stacking (app.get_windows ());
240+
239241
uint64[] window_ids = {};
240-
foreach (var window in app.get_windows ()) {
242+
foreach (var window in sorted_windows) {
243+
window.raise_and_make_recent_on_workspace (window.get_workspace ());
244+
window.focus (Meta.CURRENT_TIME);
241245
window_ids += window.get_id ();
242246
}
243247

src/Widgets/WindowOverview.vala

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class Gala.WindowOverview : ActorTarget, RootTarget, ActivatableComponent
1414

1515
private GestureController gesture_controller; // Currently not used for actual touchpad gestures but only as controller
1616

17+
private Clutter.Actor background;
1718
private Clutter.Actor monitors;
1819
private ModalProxy modal_proxy;
1920

@@ -29,6 +30,18 @@ public class Gala.WindowOverview : ActorTarget, RootTarget, ActivatableComponent
2930
};
3031
add_gesture_controller (gesture_controller);
3132

33+
background = new Clutter.Actor () {
34+
#if HAS_MUTTER47
35+
background_color = Cogl.Color.from_string ("black")
36+
#else
37+
background_color = Clutter.Color.from_string ("black")
38+
#endif
39+
};
40+
background.add_constraint (new Clutter.BindConstraint (this, SIZE, 0));
41+
add_child (background);
42+
43+
add_target (new PropertyTarget (MULTITASKING_VIEW, background, "opacity", typeof (uint), 0u, 150u));
44+
3245
monitors = new ActorTarget ();
3346
add_child (monitors);
3447

@@ -73,19 +86,17 @@ public class Gala.WindowOverview : ActorTarget, RootTarget, ActivatableComponent
7386
}
7487

7588
var windows = new List<Meta.Window> ();
89+
#if HAS_MUTTER48
90+
foreach (unowned var window_actor in wm.get_display ().get_compositor ().get_window_actors ()) {
91+
#else
7692
foreach (unowned var window_actor in wm.get_display ().get_window_actors ()) {
93+
#endif
7794
var window = window_actor.meta_window;
78-
if (ShellClientsManager.get_instance ().is_positioned_window (window)) {
79-
continue;
80-
}
81-
82-
if (window.window_type != Meta.WindowType.NORMAL &&
83-
window.window_type != Meta.WindowType.DIALOG ||
95+
if (ShellClientsManager.get_instance ().is_positioned_window (window) ||
96+
window.window_type != NORMAL && window.window_type != DIALOG ||
8497
window.is_attached_dialog () ||
8598
window_ids != null && !(window.get_id () in window_ids)
8699
) {
87-
window_actor.hide ();
88-
89100
continue;
90101
}
91102

src/WindowManager.vala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,17 +273,17 @@ namespace Gala {
273273
Meta.KeyBinding.set_custom_handler ("switch-group-backward", window_switcher.handle_switch_windows);
274274
}
275275

276+
// Add the remaining components that should be on top
277+
shell_group = new Clutter.Actor ();
278+
ui_group.add_child (shell_group);
279+
276280
if (plugin_manager.window_overview_provider == null
277281
|| (window_overview = (plugin_manager.get_plugin (plugin_manager.window_overview_provider) as ActivatableComponent)) == null
278282
) {
279283
window_overview = new WindowOverview (this);
280284
ui_group.add_child ((Clutter.Actor) window_overview);
281285
}
282286

283-
// Add the remaining components that should be on top
284-
shell_group = new Clutter.Actor ();
285-
ui_group.add_child (shell_group);
286-
287287
var feedback_group = display.get_compositor ().get_feedback_group ();
288288
stage.remove_child (feedback_group);
289289
ui_group.add_child (feedback_group);

0 commit comments

Comments
 (0)