[Gambas-bugtracker] Bug #2347: Desktop.Type gives KDE5 if kde is instaled but using gnome

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Sat Aug 14 11:48:11 CEST 2021


http://gambaswiki.org/bugtracker/edit?object=BUG.2347&from=L21haW4-

Bruce STEERS reported a new bug.

Summary
-------

Desktop.Type gives KDE5 if kde is instaled but using gnome

Type             : Bug
Priority         : Medium
Gambas version   : Unknown
Product          : Unknown


Description
-----------

Desktop.Type gives KDE5 if kde is instaled but using gnome

In gb.desktop. main.module
GetDesktop() returns KDE if Env["KDE_FULL_SESSION"] exists.
but the env exists if using gnome with kde installed

I fixed it by making it still check XDG_CURRENT_DESKTOP after finding KDE
I also Split XDG_CURRENT_DESKTOP  to make it report GNOME, GNOME-Default GNOME-Fallback, etc

--
Suggested edit..
---

Public Sub GetDesktop() As String

  If Not $sDesktop Then

    If Application.Env["KDE_FULL_SESSION"] Then

      If Application.Env["KDE_SESSION_VERSION"] = "4" Then
        $sDesktop = "KDE4"
      Else If Application.Env["KDE_SESSION_VERSION"] = "5" Then
        $sDesktop = "KDE5"
      Else
        $sDesktop = "KDE"
      Endif
    Endif

    Select Case UCase(Application.Env["XDG_CURRENT_DESKTOP"])
      Case Like "GNOME*"
        $sDesktop = Split(Application.Env["XDG_CURRENT_DESKTOP"], ":")[0]  ' will be GNOME , GNOME-Default, GNOME-Fallback, etc if Split()[0]
      Case "LXDE"
        $sDesktop = "LXDE"
      Case "UNITY"
        $sDesktop = "UNITY"
      Default
        $sDesktop = UCase(Application.Env["XDG_CURRENT_DESKTOP"])
        If $sDesktop Begins "X-" Then $sDesktop = Mid$($sDesktop, 3)
    End Select

    If Not $sDesktop Then

      If Application.Env["GNOME_DESKTOP_SESSION_ID"] Then
        $sDesktop = "GNOME"
      Else If Application.Env["MATE_DESKTOP_SESSION_ID"] Or If Application.Env["MATECORBA_SOCKETDIR"] Then
        $sDesktop = "MATE"
      Else If Application.Env["E_BIN_DIR"] And If Application.Env["E_LIB_DIR"] Then
        $sDesktop = "ENLIGHTENMENT"
      Else If Application.Env["WMAKER_BIN_NAME"] Then
        $sDesktop = "WINDOWMAKER"
      Else If Application.Env["DESKTOP_SESSION"] = "LXDE" Then
        $sDesktop = "LXDE"
      Else If UCase(Env["DESKTOP_SESSION"]) = "XCFE" Then
        $sDesktop = "XFCE"
      Else If UCase(Env["XDG_MENU_PREFIX"]) Begins "XCFE" Then
        $sDesktop = "XFCE"
      Else If InStr(Env["XDG_DATA_DIR"], "/xfce") Then
        $sDesktop = "XFCE"
      Endif

    Endif

  Endif

  Return $sDesktop

End
---


Respects
Bruce


System information
------------------

[System]
Gambas=3.16.90 a5938c48a (bruces-patched)
OperatingSystem=Linux
Kernel=5.4.0-77-generic
Architecture=x86_64
Distribution=Linux Mint 20.1 Ulyssa
Desktop=KDE5
Font=Noto Sans,10
Scale=7
Theme=breeze
Language=en_GB.UTF-8
Memory=3824M

[Libraries]
Cairo=libcairo.so.2.11600.0
Curl=libcurl.so.4.6.0
DBus=libdbus-1.so.3.19.11
GDK2=libgdk-x11-2.0.so.0.2400.32
GDK3=libgdk-3.so.0.2404.16
GStreamer=libgstreamer-1.0.so.0.1602.0
GTK+2=libgtk-x11-2.0.so.0.2400.32
GTK+3=libgtk-3.so.0.2404.16
OpenGL=libGL.so.1.7.0
Poppler=libpoppler.so.97.0.0
QT5=libQt5Core.so.5.12.8
SDL=libSDL-1.2.so.0.11.4
SQLite=libsqlite3.so.0.8.6

[Environment]
CLUTTER_BACKEND=x11
CLUTTER_IM_MODULE=ibus
COMPIZ_CONFIG_PROFILE=mint
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DEFAULTS_PATH=/usr/share/gconf/gnome-classic.default.path
DESKTOP_SESSION=gnome-classic
DISPLAY=:0
GB_GUI=gb.gtk3
GDMSESSION=gnome-classic
GDM_LANG=en_GB
GIO_LAUNCHED_DESKTOP_FILE=<home>/.local/share/applications/Desktop-ish.desktop
GIO_LAUNCHED_DESKTOP_FILE_PID=10196
GJS_DEBUG_OUTPUT=stderr
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNOME_SHELL_SESSION_MODE=classic
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
GTK3_MODULES=xapp-gtk3-module
GTK_IM_MODULE=ibus
GTK_MODULES=gail:atk-bridge:appmenu-gtk-module
GTK_OVERLAY_SCROLLING=1
HOME=<home>
IM_CONFIG_PHASE=1
INVOCATION_ID=29b670c7c3f94018ba073e804d2afaf3
JOURNAL_STREAM=9:79655
KDE_FULL_SESSION=true
KDE_SESSION_UID=1000
KDE_SESSION_VERSION=5
LANG=en_GB.UTF-8
LANGUAGE=en_GB.UTF-8
LC_ALL=en_GB.UTF-8
LIBVIRT_DEFAULT_URI=qemu:///system
LOGNAME=<user>
MANAGERPID=1236
MANDATORY_PATH=/usr/share/gconf/gnome-classic.mandatory.path
MATE_DESKTOP_SESSION_ID=this-is-deprecated
PAM_KWALLET5_LOGIN=/run/user/1000/kwallet5.socket
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PWD=<home>
QT4_IM_MODULE=ibus
QT_ACCESSIBILITY=1
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_IM_MODULE=ibus
QT_QPA_PLATFORMTHEME=qt5ct
QT_SCALE_FACTOR=1
SESSION_MANAGER=local/<hostname>:@/tmp/.ICE-unix/8197,unix/<hostname>:/tmp/.ICE-unix/8197
SHELL=/bin/bash
SHLVL=0
SSH_AGENT_PID=8140
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
TZ=:/etc/localtime
USER=<user>
XAUTHORITY=<home>/.Xauthority
XCURSOR_THEME=breeze_cursors
XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome-classic:/etc/xdg
XDG_CURRENT_DESKTOP=GNOME-Classic:GNOME
XDG_DATA_DIRS=/usr/share/gnome-classic:<home>/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/<user>
XDG_MENU_PREFIX=gnome-
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_CLASS=user
XDG_SESSION_DESKTOP=gnome-classic
XDG_SESSION_ID=c7
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session5
XDG_SESSION_TYPE=x11
XDG_VTNR=7
XMODIFIERS=@im=ibus
_=/usr/bin/gambas3




More information about the Bugtracker mailing list