Skip to content

Commit 1f96cc5

Browse files
committed
WindowOverview: Dim background, keep other windows visible
1 parent bf4c341 commit 1f96cc5

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
@@ -252,8 +252,12 @@ public class Gala.DesktopIntegration : GLib.Object {
252252
throw new IOError.NOT_FOUND ("App not found");
253253
}
254254

255+
var sorted_windows = wm.get_display ().sort_windows_by_stacking (app.get_windows ());
256+
255257
uint64[] window_ids = {};
256-
foreach (var window in app.get_windows ()) {
258+
foreach (var window in sorted_windows) {
259+
window.raise_and_make_recent_on_workspace (window.get_workspace ());
260+
window.focus (Meta.CURRENT_TIME);
257261
window_ids += window.get_id ();
258262
}
259263

src/Widgets/WindowOverview.vala

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

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

18+
private Clutter.Actor background;
1819
private Clutter.Actor monitors;
1920
private ModalProxy modal_proxy;
2021

@@ -32,6 +33,18 @@ public class Gala.WindowOverview : ActorTarget, RootTarget, ActivatableComponent
3233
};
3334
add_gesture_controller (gesture_controller);
3435

36+
background = new Clutter.Actor () {
37+
#if HAS_MUTTER47
38+
background_color = Cogl.Color.from_string ("black")
39+
#else
40+
background_color = Clutter.Color.from_string ("black")
41+
#endif
42+
};
43+
background.add_constraint (new Clutter.BindConstraint (this, SIZE, 0));
44+
add_child (background);
45+
46+
add_target (new PropertyTarget (MULTITASKING_VIEW, background, "opacity", typeof (uint), 0u, 150u));
47+
3548
monitors = new ActorTarget ();
3649
add_child (monitors);
3750
}
@@ -71,19 +84,17 @@ public class Gala.WindowOverview : ActorTarget, RootTarget, ActivatableComponent
7184
window_ids = hints != null && "windows" in hints ? (uint64[]) hints["windows"] : null;
7285

7386
var windows = new List<Meta.Window> ();
87+
#if HAS_MUTTER48
88+
foreach (unowned var window_actor in wm.get_display ().get_compositor ().get_window_actors ()) {
89+
#else
7490
foreach (unowned var window_actor in wm.get_display ().get_window_actors ()) {
91+
#endif
7592
var window = window_actor.meta_window;
76-
if (ShellClientsManager.get_instance ().is_positioned_window (window)) {
77-
continue;
78-
}
79-
80-
if (window.window_type != Meta.WindowType.NORMAL &&
81-
window.window_type != Meta.WindowType.DIALOG ||
93+
if (ShellClientsManager.get_instance ().is_positioned_window (window) ||
94+
window.window_type != NORMAL && window.window_type != DIALOG ||
8295
window.is_attached_dialog () ||
8396
window_ids != null && !(window.get_id () in window_ids)
8497
) {
85-
window_actor.hide ();
86-
8798
continue;
8899
}
89100

src/WindowManager.vala

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

283+
// Add the remaining components that should be on top
284+
shell_group = new Clutter.Actor ();
285+
ui_group.add_child (shell_group);
286+
283287
if (plugin_manager.window_overview_provider == null
284288
|| (window_overview = (plugin_manager.get_plugin (plugin_manager.window_overview_provider) as ActivatableComponent)) == null
285289
) {
286290
window_overview = new WindowOverview (this);
287291
ui_group.add_child ((Clutter.Actor) window_overview);
288292
}
289293

290-
// Add the remaining components that should be on top
291-
shell_group = new Clutter.Actor ();
292-
ui_group.add_child (shell_group);
293-
294294
var feedback_group = display.get_compositor ().get_feedback_group ();
295295
stage.remove_child (feedback_group);
296296
ui_group.add_child (feedback_group);

0 commit comments

Comments
 (0)