lxqt-session icon indicating copy to clipboard operation
lxqt-session copied to clipboard

lxqt-session - make WM selection smarter

Open shirishag75 opened this issue 6 years ago • 37 comments

For some unknown reason, when I entered for a lxqt session, lxqt asked me for the default window manager
lxqt-window-manager-asked

There is/was no way to take the screenshot unless was in a VM hence reused the picture shared on the forum.

now if you look at the dialog box it doesn't give you any hint how do you get out of the session to come to the default login screen and the user is sort of stuck there.

I was able to use CTRL+ALT+Fn to come to a terminal emulator, shutdown lightdm via systemctl and restart lightdm to get the login screen, go to mate-desktop, look up https://forum.lxqt.org/t/selecting-default-window-manager-in-lxqt-0-13-0/309 and use the settings shared by agaida at https://forum.lxqt.org/t/selecting-default-window-manager-in-lxqt-0-13-0/309/7 , copy the needful to /etc/xdg/lxqt/session.conf and was able to login.

A user shouldn't need to go through such loopholes.

FWIW, there is/was no file named session.conf in /etc/xdg/lxqt/

Update - I removed session.conf in /etc/xdg/lxqt/ and tried logging in again and this time it worked, dunno the reason why it worked this time but not the other time.

System credentials in case they throw any more light -

Package: lxqt-session
Version: 0.13.1~181-gab84e77-3
Severity: normal

-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'unstable'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.18.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_IN, LC_CTYPE=en_IN (charmap=UTF-8), LANGUAGE=en_IN:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages lxqt-session depends on:
ii  libc6                     2.27-6
ii  libkf5windowsystem5       5.49.0-1
ii  liblxqt0                  0.13.0-1
ii  libqt5core5a              5.11.1+dfsg-9
ii  libqt5dbus5               5.11.1+dfsg-9
ii  libqt5gui5                5.11.1+dfsg-9
ii  libqt5widgets5            5.11.1+dfsg-9
ii  libqt5x11extras5          5.11.1-2
ii  libqt5xdg3                3.2.1~11-g374f418-1
ii  libstdc++6                8.2.0-7
ii  libudev1                  239-10
ii  libx11-6                  2:1.6.7-1
ii  lxqt-qtplugin             0.13.0-2+b1
ii  lxqt-themes [lxqt-theme]  0.13.0-1
ii  x11-xkb-utils             7.7+4

Versions of packages lxqt-session recommends:
ii  lxqt-config           0.13.1~502-gfd3b8c7-4
ii  lxqt-notificationd    0.13.1~90-g41123bd-1
ii  lxqt-policykit        0.13.1~50-g5c1a745-1
ii  lxqt-powermanagement  0.13.1~137-gea33bfa-1
ii  lxqt-session-l10n     0.13.1~181-gab84e77-3
ii  lxqt-sudo             0.13.1~78-ga571dda-1
ii  pcmanfm-qt            0.13.0-2
ii  qlipper               1:5.1.2~13-g0e90641-1
ii  qps                   1.10.19~84-g38c3fe1-1
ii  xscreensaver          5.40-1

lxqt-session suggests no packages.

-- no debconf information

shirishag75 avatar Oct 18 '18 03:10 shirishag75

A user shouldn't need to go through such loopholes.

I agree completely.

@agaida Is it fixed in the latest git?

This isn't the first time that message box is shown in a report. I don't remember how the other reports were closed but, IMO, a user should never encounter it. Starting without any window manager is much better than showing this message and, if there is a WM installed on the user's system, it should be selected automatically.

I hope this has become totally impossible with the latest git; otherwise, it'll be a release blocker.

tsujan avatar Oct 18 '18 06:10 tsujan

This window is shown, if currently configured WM is not found:

    // If previuos WM was removed, we show dialog.
    if (mWindowManager.isEmpty() || ! findProgram(mWindowManager.split(QL1C(' '))[0]))
    {
        mWindowManager = showWmSelectDialog();
        settings->setValue(QL1S("window_manager"), mWindowManager);
        settings->sync();
    }

The list of known window managers is taken from {XDG}/lxqt/windowmanagers.conf:

WindowManagerList getWindowManagerList(bool onlyAvailable)
{   
    LXQt::Settings cfg(QSL("windowmanagers"));
    cfg.beginGroup(QSL("KnownManagers"));
    const QStringList names = cfg.childGroups();
    
    WindowManagerList ret;

    for (const QString &name : names)
    {
        bool exists = findProgram(name);
        if (!onlyAvailable || exists)
        {   
            cfg.beginGroup(name);
            WindowManager wm;
            wm.command = name;
            wm.name = cfg.localizedValue(QSL("Name"), wm.command).toString();
            wm.comment = cfg.localizedValue(QSL("Comment")).toString();
            wm.exists = exists;
            ret << wm;
            cfg.endGroup();
        }
    }

    return ret;
}

The default windowmanagers.conf config is here.

... and I agree that the dialog should have a "Leave session" button

palinek avatar Oct 18 '18 07:10 palinek

Apparently, it should never happen. Why has it been reported several times? This time, from Debian!

tsujan avatar Oct 18 '18 07:10 tsujan

Apparently, it should never happen. Why has it been reported several times?

IMO when the user removes all "known" window managers w/o setting some existing into lxqt-config-session

palinek avatar Oct 18 '18 07:10 palinek

Or there is a problem in the logic for checking if the window manager (its executable) is present...

palinek avatar Oct 18 '18 07:10 palinek

I have two desktops installed, one is debian-mate and the other debian-lxqt . The other thing I did find is that xfwm does not seem to be a dependency of anything if it's the default window manager. It should be at the very least be a dependency of task-lxqt-desktop or something more appropriate.

$ aptitude show task-lxqt-desktop Package: task-lxqt-desktop
Version: 3.46 State: installed Automatically installed: no Priority: optional Section: tasks Maintainer: Debian Install System Team [email protected] Architecture: all Uncompressed Size: 6,144 Depends: tasksel (= 3.46), task-desktop, sddm, sddm-theme-debian-elarun | sddm-theme-debian-elarun, lxqt Recommends: xsane, orca, libreoffice-gtk3, synaptic, libreoffice, libreoffice-help-en-us, mythes-en-us, hunspell-en-us, hyphen-en-us, system-config-printer Description: LXQt This task package is used to install the Debian desktop, featuring the LXQt desktop environment, and with other packages that Debian users expect to have available on the desktop.

The more perplexing question to me is why it couldn't find lightdm ? Perhaps because it's GTK2 based ?

The problem with this choice is it allows you to traverse through directories and folders if you click on other but most users would be clueless as to what to do.

shirishag75 avatar Oct 18 '18 08:10 shirishag75

Can anyone, please, test the "abort" functionality with lxqt/lxqt-session#181?

palinek avatar Oct 18 '18 08:10 palinek

The other thing I did find is that xfwm does not seem to be a dependency of anything.

How is that? I see it:

Package: task-lxqt-desktop Depends: tasksel (= 3.46), task-desktop, sddm, sddm-theme-debian-elarun | sddm-theme-debian-elarun, lxqt

Package: lxqt Depends: featherpad, lximage-qt, lxqt-core (= 27), lxqt-about, lxqt-admin, lxqt-openssh-askpass, lxqt-powermanagement, lxqt-sudo, pavucontrol-qt | pavucontrol, qlipper | clipit | xfce4-clipman, qps, qterminal, qttranslations5-l10n, sddm-theme-debian-maui | sddm-theme | lightdm | gdm3 | lxdm | slim | nodm, xarchiver | ark | engrampa, xfwm4 | x-window-manager Recommends: audacious | clementine | qmmp, calibre, cmst | nm-tray | network-manager-gnome | plasma-nm | wicd, smplayer, smtube, quassel | quassel-client | hexchat | irssi | weechat, qpdfview, gucharmap, firefox | www-browser, thunderbird | claws-mail | mutt

palinek avatar Oct 18 '18 08:10 palinek

will have a look later - and @palinek, you are right lxqt depend on xfwm4|x-window-manager means that there must be a window manager installed, with xfwm4 as default alternative. That also means that xfwm4 will not be installed when a different WM is installed. The delivered configuration defaults to xfwm4 - so one has to chose the WM - we need a windows manager, so an abort don't make any sense at this point.

Second notice: This is not an upstream problem. So we can close this here.

Edit: We should check the WM list - but thats a different problem.

agaida avatar Oct 18 '18 08:10 agaida

Second notice: This is not an upstream problem. So we can close this here.

I may be very ignorant in this case and what I'm going to say may sound irrational: It should not happen at all when there is a WM that works with LXQt.

tsujan avatar Oct 18 '18 08:10 tsujan

I mean, whether the user has chosen a WM or has left it blank, LXQt should behave more intelligently.

tsujan avatar Oct 18 '18 08:10 tsujan

It should not happen at all when there is a WM that works with LXQt.

It wouldn't happen if all WMs that work with LXQt would be listed in windowmanagers.conf ...

palinek avatar Oct 18 '18 08:10 palinek

If you mean /usr/share/lxqt/windowmanagers.conf, that's acceptable. Then why aren't they listed there for some users? Wrong compilation/package building? If @shirishag75 didn't use Debian, I'd say it was Ubuntu's fault. @agaida Do bad packages exist in Debian?

tsujan avatar Oct 18 '18 08:10 tsujan

Here, /usr/share/lxqt/windowmanagers.conf is:

[KnownManagers]
openbox/Name=Openbox
openbox/Comment=Light-weight window manager

kwin/Name=KWin
kwin/Comment=Window manager of the KDE Software Compilation

kwin_x11/Name=KWin
kwin_x11/Comment=Window manager of the KDE Software Compilation

metacity/Name=Metacity
metacity/Comment=Window manager of the GNOME desktop environment

windowmaker/Name=Windowmaker
windowmaker/Comment=A classical lightweight window manager

e16/Name=Enlightenement 16

fvwm2/Name=Fvwm2
fvwm2/Comment=A classical lightweight window manager

xfwm4/Name=Xfwm4
xfwm4/Comment=A window manager for the Xfce desktop environment

sawfish/Name=Sawfish
sawfish/Comment="A lightweight, flexible window manager"

And ~/.config/lxqt/windowmanagers.conf is:

[General]
__userfile__=true

tsujan avatar Oct 18 '18 08:10 tsujan

The issue is with the default settings - given that we deliver in debian with preconfigured xfwm4 - so if xfwm4 isn't installed the session management has to ask which WM to use. So possible WMs should be listed in the dialogue, we should test this. But an abort button will not help in this case we just need a WM :) - behave more intelligent would be a solution - if at least one WM from the list is found: Use that - if more than one WM is found and the WMs found are not the current config - display the dialogue.

Best outcome would be: We don't deliver any pre-configuration and if only one WM is installed we take this installed and recognized WM as default.

agaida avatar Oct 18 '18 09:10 agaida

if exactly one WM from the list is found: Use that - if more than one WM is found and the WMs found are not the current config - display the dialogue.

And that's exactly what happens right now:

QString LXQtModuleManager::showWmSelectDialog()
{
    WindowManagerList availableWM = getWindowManagerList(true);
    if (availableWM.count() == 1)
        return availableWM.at(0).command;

    WmSelectDialog dlg(availableWM);
    dlg.exec();
    return dlg.windowManager();
}

palinek avatar Oct 18 '18 10:10 palinek

... given that we deliver in debian with preconfigured xfwm4

Probably, the problem is how that's done in Debian.

tsujan avatar Oct 18 '18 10:10 tsujan

https://github.com/lxqt/lxqt-session/blob/master/config/session.conf - no comment without my lawyer :D

agaida avatar Oct 18 '18 12:10 agaida

So, this is only about incomplete installation :D can be closed.

BTW, to @agaida's lawyer: Why doesn't Debian have audacious-qt5? I saw audacious in the recommends while audacious-qt5 has been quite stable for a long time.

tsujan avatar Oct 18 '18 12:10 tsujan

But still: LXQt isn't intelligent enough in such cases..... So, maybe, there's still something to do.

tsujan avatar Oct 18 '18 12:10 tsujan

Possible solution:

if (mWindowManager.isEmpty() || ! findProgram(mWindowManager.split(QL1C(' '))[0]))
{
   if (!automatically_select_an_existent_window_manager())
  { // failure
    show_selection_dialog();
  }
}

tsujan avatar Oct 18 '18 12:10 tsujan

@tsujan - thats why i shared my thoughts how things could/should work

re: audacious-qt5 - a year ago the qt5 version was subpar, the parts that was not the frontend still depend on gtk - so the maintainer finally gave up. Maybe it's now time to re-evaluate. I dropped my own audacious packaging because of the same reasons.

Edit: tried to deliver siduction with audacious-qt, but the user experience was not that funny

agaida avatar Oct 18 '18 12:10 agaida

@agaida IMO, showWmSelectDialog() frightens users and it's better to show it only when no WM of the list can be found.

As for audacious-qt5, I use it for a long time to listen to local music and Internet radios (sometimes. instead of Cantata). It should be compilable under Debian.

EDIT: audacious-plugins-qt5 + audacious-qt5

tsujan avatar Oct 18 '18 12:10 tsujan

I think that xfwm4 being the default WM installed with LXQt on debian doesn't make sense. LXQt should not be requiring GTK when other WMs that don't require GTK, like openbox or kwin, exist.

E5ten avatar Oct 18 '18 13:10 E5ten

@E5ten Please don't start that discussion again! LXQt works with any DE-independent WM. Moreover, the subject is very different here.

tsujan avatar Oct 18 '18 13:10 tsujan

Hi all,

I think couple of points are missing. If it would have happened in the first session itself which didn't have all the packages having experimental snapshots then I would have been at fault. But this happened after I changed/upgraded to most packages having experimental-snapshots. The only package I didn't upgrade was the one which has the new virtual ABI .

Another thing which I should have written is -

lightdm is THE display manager instead of sddm , there is a serious/grave bug at least in Debian and anyways I have trusted lightdm for long.

marco is the window manager in debian-mate which is forked from metacity .

So, is it that lxqt-session would work ONLY with xfwm4 or also with metacity ?

If it works with metacity then maybe just adding marco to /usr/share/lxqt/windowmanagers.conf might be all that is needed ?

shirishag75 avatar Oct 18 '18 13:10 shirishag75

@E5ten - you shoudl read https://github.com/lxqt/lxqt/issues/1011 completely - if you have any new insights that was not mentioned there - add it in #1011

@shirishag75 - for you only we could make it short: https://github.com/lxqt/lxqt/issues/1011#issuecomment-389571461 -- a relod or two might be needed the numbers are in the hidden comments. And no, we don't consider lightdm as a good choice. And please forget about some bugs in debian - they are not relevant. I would guess all RC-bugs will be fixed before the next debian release (at least that is what the debian release team say: It is done, when it is done aka the release is finally ready when the RC-Bugcounter is exactly 0)

anyways - i know that the selection work fine once they are set - as @tsujan said we should make the selection a bit smarter.

agaida avatar Oct 18 '18 15:10 agaida

As for audacious-qt5, I use it for a long time to listen to local music and Internet radios (sometimes. instead of Cantata). It should be compilable under Debian.

@tsujan: it's, but as i said - that was not the problem

agaida avatar Oct 18 '18 16:10 agaida

@palinek - if i understand your comment right:

And that's exactly what happens right now ...

Wouldn't it be clever just to remove the WM setting from our default configuration?

agaida avatar Oct 18 '18 17:10 agaida

This isn't the first time that message box is shown in a report. I don't remember how the other reports were closed but, IMO, a user should never encounter it. Starting without any window manager is much better than showing this message and, if there is a WM installed on the user's system, it should be selected automatically.

@tsuan - with the explanation from @palinek the whole session should work unconfigured as long as at least one WM is found. So what to do with more than one installed and no one configured? Given that we remove the preset to openbox/xfwm4/anything_else - how should the system react. Having a windowmanager started will improve the usability of LXQt dramatically :sunglasses:

Edit: Second question - in a fictional system i have xfwm4, openbox, kwin_x11 and marco installed. My configured WM in user config is openbox. Now i get bored of it and purge openbox. How should the lxqt-session react on the next start (openbox is still configured in the user settings)

agaida avatar Oct 18 '18 17:10 agaida