Skip to content

Commit 722d2dd

Browse files
committed
support x
1 parent 223aaa3 commit 722d2dd

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

src/InternalUtils.vala

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace Gala {
99
public enum InputArea {
1010
NONE,
1111
FULLSCREEN,
12+
MULTITASKING_VIEW,
1213
DEFAULT
1314
}
1415

@@ -32,6 +33,36 @@ namespace Gala {
3233
rects = {rect};
3334
break;
3435

36+
case InputArea.MULTITASKING_VIEW:
37+
var shell_client_rect = ShellClientsManager.get_instance ().get_shell_client_rect ();
38+
39+
int width, height;
40+
display.get_size (out width, out height);
41+
42+
if (shell_client_rect != null) {
43+
X.Xrectangle left_rect = {0, 0, (ushort) shell_client_rect.x, (ushort) height};
44+
X.Xrectangle right_rect = {
45+
(short) (shell_client_rect.x + shell_client_rect.width), 0,
46+
(ushort) (width - shell_client_rect.x - shell_client_rect.width), (ushort) height
47+
};
48+
X.Xrectangle top_rect = {
49+
(short) shell_client_rect.x, 0,
50+
(ushort) shell_client_rect.width, (ushort) shell_client_rect.y
51+
};
52+
X.Xrectangle bottom_rect = {
53+
(short) shell_client_rect.x,
54+
(short) (shell_client_rect.y + shell_client_rect.height),
55+
(ushort) shell_client_rect.width,
56+
(ushort) (height - shell_client_rect.y - shell_client_rect.height)
57+
};
58+
rects = {left_rect, right_rect, top_rect, bottom_rect};
59+
} else {
60+
X.Xrectangle rect = {0, 0, (ushort)width, (ushort)height};
61+
rects = {rect};
62+
}
63+
64+
break;
65+
3566
case InputArea.DEFAULT:
3667
// add plugin's requested areas
3768
foreach (var rect in PluginManager.get_default ().get_regions ()) {

src/ShellClients/ShellClientsManager.vala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
299299
}
300300
break;
301301

302+
case "visible-in-multitasking-view":
303+
request_visible_in_multitasking_view (window);
304+
break;
305+
302306
case "centered":
303307
make_centered (window);
304308
break;
@@ -318,4 +322,13 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
318322
requires (window in panel_windows) {
319323
panel_windows[window].restore_previous_x11_region = true;
320324
}
325+
326+
public Mtk.Rectangle? get_shell_client_rect () {
327+
foreach (var client in panel_windows.get_values ()) {
328+
if (client.visible_in_multitasking_view) {
329+
return client.get_custom_window_rect ();
330+
}
331+
}
332+
return null;
333+
}
321334
}

src/WindowManager.vala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,10 +576,12 @@ namespace Gala {
576576
}
577577
}
578578

579-
if (is_modal ())
580-
InternalUtils.set_input_area (display, InputArea.FULLSCREEN);
581-
else
579+
if (is_modal ()) {
580+
var area = multitasking_view.is_opened () ? InputArea.MULTITASKING_VIEW : InputArea.FULLSCREEN;
581+
InternalUtils.set_input_area (display, area);
582+
} else {
582583
InternalUtils.set_input_area (display, InputArea.DEFAULT);
584+
}
583585
}
584586

585587
/**

0 commit comments

Comments
 (0)