aboutsummaryrefslogtreecommitdiff
path: root/.patches-to-be-ported-from-slick-greeter/0062-Allow-wayland-sessions-to-pass-validation.patch
blob: e3c4889c7ad861e70e5dcbddbb063ea0c728cbcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From e6a649d20b926e9b82ea21af384c997636a90c9e Mon Sep 17 00:00:00 2001
From: Ivan Podogov <ginkage@yandex.ru>
Date: Wed, 28 Dec 2022 12:35:51 +0000
Subject: [PATCH 62/81] Allow wayland sessions to pass validation

This makes slick-greeter properly remember the last wayland session instead of defaulting to an xsession.

Signed-off-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
---
 src/slick-greeter.vala | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/slick-greeter.vala b/src/slick-greeter.vala
index d1b9815..44661b5 100644
--- a/src/slick-greeter.vala
+++ b/src/slick-greeter.vala
@@ -204,6 +204,13 @@ public class SlickGreeter
             }
         }
 
+        foreach (string session in sessions) {
+            var path = Path.build_filename  ("/usr/share/wayland-sessions/", session.concat(".desktop"), null);
+            if (FileUtils.test (path, FileTest.EXISTS)) {
+                return session;
+            }
+        }
+
         warning ("Could not find a default session.");
         return null;
     }
@@ -214,7 +221,8 @@ public class SlickGreeter
         otherwise, return the default session. */
         if (session != null) {
             var path = Path.build_filename  ("/usr/share/xsessions/", session.concat(".desktop"), null);
-            if (!FileUtils.test (path, FileTest.EXISTS) ) {
+            var waypath = Path.build_filename  ("/usr/share/wayland-sessions/", session.concat(".desktop"), null);
+            if (!FileUtils.test (path, FileTest.EXISTS) & !FileUtils.test (waypath, FileTest.EXISTS)) {
                 debug ("Invalid session: '%s'", session);
                 session = null;
             }
-- 
2.30.2