Skip to content

Commit 2ba273f

Browse files
committed
Allow to launch only specific shell clients based on session type
1 parent cf458d0 commit 2ba273f

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

data/io.elementary.desktop.wm.shell

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
launch-on-x=true
33
args=io.elementary.wingpanel
44
wait-for-n-panels=1
5+
session-type=desktop
56

67
[io.elementary.dock]
78
launch-on-x=true
89
args=io.elementary.dock
910
wait-for-n-panels=1
11+
session-type=desktop

lib/SessionSettings.vala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,17 @@ namespace Gala.SessionSettings {
4040
public bool is_greeter () {
4141
return get_session_type () != DESKTOP;
4242
}
43+
44+
public string get_shell_clients_type () {
45+
switch (get_session_type ()) {
46+
case DESKTOP:
47+
return "desktop";
48+
case GREETER:
49+
return "greeter";
50+
case INSTALLER:
51+
return "installer";
52+
}
53+
54+
return "desktop";
55+
}
4356
}

src/ShellClients/ShellClientsManager.vala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
103103
}
104104
}
105105

106+
try {
107+
var type = key_file.get_string (group, "session-type");
108+
if (type != SessionSettings.get_shell_clients_type ()) {
109+
continue;
110+
}
111+
} catch (Error e) {
112+
warning ("Failed to check session type for client %s, assuming it should be launched: %s", group, e.message);
113+
}
114+
106115
try {
107116
starting_panels += key_file.get_integer (group, "wait-for-n-panels");
108117
} catch (Error e) {

0 commit comments

Comments
 (0)