Skip to content

Commit a35fbc2

Browse files
committed
Keep static windows
1 parent 6c4dce9 commit a35fbc2

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

src/Widgets/MultitaskingView/WindowCloneContainer.vala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ public class Gala.WindowCloneContainer : ActorTarget {
4040
on_items_changed (0, 0, windows.get_n_items ());
4141
windows.items_changed.connect (on_items_changed);
4242

43+
clip_to_allocation = true;
44+
4345
set_relayout_action (MULTITASKING_VIEW, true);
46+
set_relayout_action (SWITCH_WORKSPACE, true);
4447
}
4548

4649
private void on_items_changed (uint position, uint removed, uint added) {
@@ -166,7 +169,18 @@ public class Gala.WindowCloneContainer : ActorTarget {
166169
protected override void allocate (Clutter.ActorBox box) {
167170
set_allocation (box);
168171

172+
var static_windows = StaticWindowContainer.get_instance (wm.get_display ());
169173
for (var child = get_first_child (); child != null; child = child.get_next_sibling ()) {
174+
if (child is WindowClone && static_windows.is_static (child.window)) {
175+
float x, y;
176+
get_transformed_position (out x, out y);
177+
178+
var allocation = origin_allocations[child];
179+
allocation.set_origin (allocation.x1 - x, allocation.y1 - y);
180+
child.allocate (allocation);
181+
continue;
182+
}
183+
170184
var target_allocation = target_allocations[child];
171185
var origin_allocation = origin_allocations[child];
172186

src/WindowListModel.vala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public class Gala.WindowListModel : Object, ListModel {
6363
StaticWindowContainer.get_instance (display).window_changed.connect (check_window);
6464
display.window_entered_monitor.connect ((monitor, win) => check_window (win));
6565

66+
// display.get_workspace_manager ().active_workspace_changed.connect (() => Idle.add_once (check_all));
67+
6668
notify.connect (check_all);
6769

6870
check_all ();
@@ -106,10 +108,7 @@ public class Gala.WindowListModel : Object, ListModel {
106108
return false;
107109
}
108110

109-
if (workspace_filter != null &&
110-
(StaticWindowContainer.get_instance (display).is_static (window) ||
111-
!window.located_on_workspace (workspace_filter))
112-
) {
111+
if (workspace_filter != null && !window.located_on_workspace (workspace_filter)) {
113112
return false;
114113
}
115114

0 commit comments

Comments
 (0)