Skip to content

Commit a384ac5

Browse files
committed
WindowOverview: Dim background, keep other windows visible
1 parent b2b4c07 commit a384ac5

File tree

3 files changed

+31
-16
lines changed

3 files changed

+31
-16
lines changed

src/DesktopIntegration.vala

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

251+
var sorted_windows = wm.get_display ().sort_windows_by_stacking (app.get_windows ());
252+
251253
uint64[] window_ids = {};
252-
foreach (var window in app.get_windows ()) {
254+
foreach (var window in sorted_windows) {
255+
window.raise_and_make_recent_on_workspace (window.get_workspace ());
256+
window.focus (Meta.CURRENT_TIME);
253257
window_ids += window.get_id ();
254258
}
255259

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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -281,20 +281,20 @@ namespace Gala {
281281
Meta.KeyBinding.set_custom_handler ("switch-group-backward", window_switcher.handle_switch_windows);
282282
}
283283

284-
if (plugin_manager.window_overview_provider == null
285-
|| (window_overview = (plugin_manager.get_plugin (plugin_manager.window_overview_provider) as ActivatableComponent)) == null
286-
) {
287-
window_overview = new WindowOverview (this);
288-
ui_group.add_child ((Clutter.Actor) window_overview);
289-
}
290-
291284
// Add the remaining components that should be on top
292285
shell_group = new Clutter.Actor ();
293286
ui_group.add_child (shell_group);
294287

295288
menu_group = new Clutter.Actor ();
296289
ui_group.add_child (menu_group);
297290

291+
if (plugin_manager.window_overview_provider == null
292+
|| (window_overview = (plugin_manager.get_plugin (plugin_manager.window_overview_provider) as ActivatableComponent)) == null
293+
) {
294+
window_overview = new WindowOverview (this);
295+
ui_group.add_child ((Clutter.Actor) window_overview);
296+
}
297+
298298
var feedback_group = display.get_compositor ().get_feedback_group ();
299299
stage.remove_child (feedback_group);
300300
ui_group.add_child (feedback_group);

0 commit comments

Comments
 (0)