Skip to content

Commit 666145c

Browse files
committed
WindowOverview: Dim background, keep other windows visible
1 parent 8286c91 commit 666145c

File tree

3 files changed

+24
-13
lines changed

3 files changed

+24
-13
lines changed

src/DesktopIntegration.vala

+5-1
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,12 @@ public class Gala.DesktopIntegration : GLib.Object {
233233
throw new IOError.NOT_FOUND ("App not found");
234234
}
235235

236+
var sorted_windows = wm.get_display ().sort_windows_by_stacking (app.get_windows ());
237+
236238
uint64[] window_ids = {};
237-
foreach (var window in app.get_windows ()) {
239+
foreach (var window in sorted_windows) {
240+
window.raise_and_make_recent_on_workspace (window.get_workspace ());
241+
window.focus (Meta.CURRENT_TIME);
238242
window_ids += window.get_id ();
239243
}
240244

src/Widgets/WindowOverview.vala

+15-8
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class Gala.WindowOverview : ActorTarget, 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

@@ -28,6 +29,18 @@ public class Gala.WindowOverview : ActorTarget, ActivatableComponent {
2829
enabled = false
2930
};
3031

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

@@ -74,17 +87,11 @@ public class Gala.WindowOverview : ActorTarget, ActivatableComponent {
7487
var windows = new List<Meta.Window> ();
7588
foreach (unowned var window_actor in wm.get_display ().get_window_actors ()) {
7689
var window = window_actor.meta_window;
77-
if (ShellClientsManager.get_instance ().is_positioned_window (window)) {
78-
continue;
79-
}
80-
81-
if (window.window_type != Meta.WindowType.NORMAL &&
82-
window.window_type != Meta.WindowType.DIALOG ||
90+
if (ShellClientsManager.get_instance ().is_positioned_window (window) ||
91+
window.window_type != NORMAL && window.window_type != DIALOG ||
8392
window.is_attached_dialog () ||
8493
window_ids != null && !(window.get_id () in window_ids)
8594
) {
86-
window_actor.hide ();
87-
8895
continue;
8996
}
9097

src/WindowManager.vala

+4-4
Original file line numberDiff line numberDiff line change
@@ -254,17 +254,17 @@ namespace Gala {
254254
Meta.KeyBinding.set_custom_handler ("switch-group-backward", (Meta.KeyHandlerFunc) window_switcher.handle_switch_windows);
255255
}
256256

257+
// Add the remaining components that should be on top
258+
shell_group = new Clutter.Actor ();
259+
ui_group.add_child (shell_group);
260+
257261
if (plugin_manager.window_overview_provider == null
258262
|| (window_overview = (plugin_manager.get_plugin (plugin_manager.window_overview_provider) as ActivatableComponent)) == null
259263
) {
260264
window_overview = new WindowOverview (this);
261265
ui_group.add_child ((Clutter.Actor) window_overview);
262266
}
263267

264-
// Add the remaining components that should be on top
265-
shell_group = new Clutter.Actor ();
266-
ui_group.add_child (shell_group);
267-
268268
var feedback_group = display.get_compositor ().get_feedback_group ();
269269
stage.remove_child (feedback_group);
270270
ui_group.add_child (feedback_group);

0 commit comments

Comments
 (0)