File xrdp-bsc965647-allow-admin-choose-desktop.patch of Package xrdp

From b14f40d4567b884623936a8b3c20350d1ea37ffd Mon Sep 17 00:00:00 2001
From: Felix Zhang <fezhang@suse.com>
Date: Mon, 1 Aug 2016 17:55:35 +0800
Subject: [PATCH] bsc#965647 allow admin choose desktop

---
 sesman/startwm.sh | 44 +++++++++++++++++++++-----------------------
 1 file changed, 21 insertions(+), 23 deletions(-)

diff --git a/sesman/startwm.sh b/sesman/startwm.sh
index ee48263..ace62a0 100755
--- a/sesman/startwm.sh
+++ b/sesman/startwm.sh
@@ -3,30 +3,28 @@
 #start the window manager
 wm_start()
 {
-  if [ -r /etc/default/locale ]; then
-    . /etc/default/locale
-    export LANG LANGUAGE
-  fi
-
-  # debian
-  if [ -r /etc/X11/Xsession ]; then
-    . /etc/X11/Xsession
-    exit 0
-  fi
-
-  # el
-  if [ -r /etc/X11/xinit/Xsession ]; then
-    . /etc/X11/xinit/Xsession
-    exit 0
-  fi
+  #Customize your preferred session mode here
+  SESSION="sle"
 
-  # suse
-  if [ -r /etc/X11/xdm/Xsession ]; then
-    . /etc/X11/xdm/Xsession
-    exit 0
-  fi
-
-  xterm
+  case $SESSION in
+    sle)
+      if [ -r /usr/bin/gnome-session ]; then
+        export GNOME_SHELL_SESSION_MODE=classic
+        export SLE_CLASSIC_MODE=1
+        /usr/bin/gnome-session --session gnome-classic
+      fi
+      ;;
+    gnome)
+      if [ -r /usr/bin/gnome-session ]; then
+        /usr/bin/gnome-session
+      fi
+      ;;
+    icewm)
+      if [ -r /usr/bin/icewm-session ]; then
+        /usr/bin/icewm-session
+      fi
+      ;;
+  esac
 }
 
 #Execution sequence for interactive login shell
-- 
2.6.6
openSUSE Build Service is sponsored by