GithubHelp home page GithubHelp logo

Comments (8)

ahesford avatar ahesford commented on July 21, 2024

The notion of a "session" not defined by the lifetime of the compositor itself seems like a nebulous concept. This works for X11 window managers because the session is defined by the lifetime of the X server, and the window manager will die automatically when its server terminates.

An argument could be made that, when launching labwc with a single client (as in your qterminal example), the compositor should die when the client dies. That's certainly how cage behaves. However, cage is generally built on a "single instance" interaction model, while labwc is designed around simultaneous interactions with many clients and even provides a means to start more that aren't children of the "key" client. Nominating one as special because it was started at launch would be a bit kludgey and would probably feel unintuitive.

Defining an external "session" concept and making labwc tie its fate to that session seems like it would make labwc particularly opinionated in undesirable ways. Unless there's a Wayland protocol for sending session events that we can implement, this starts to wade into the same kind of territory occupied by things like nonstandard IPC; this project expressly avoids that realm.

My view is that this is beyond the scope of labwc. LXQt should implement a helper, launchable via the autostart script, that can monitor whatever defines a session and send SIGTERM to $LABWC_PID at the appropriate time.

from labwc.

johanmalm avatar johanmalm commented on July 21, 2024

@stefonarch

I had a quick look at kwin, but don't follow the logic. Could you help us understand the mechanism you're trying to achieve.

Let me describe how I understand it, so that you can educate me and help the jigsaw pieces fall into place.

If we take the simplest case (according to my understanding) a session is a script that sets up an environment and then launches labwc (sometimes using exec so that it is not a separate PID). So if the session closes, in my mind labwc goes with it.

Could you describe what starts what - and then how you wish it to close.

from labwc.

stefonarch avatar stefonarch commented on July 21, 2024

Under X11 startlxqt is a script that sets mainly env vars and launches lxqt-session which isn't a script.

Under wayland I'm using a similar script _startlxqtlabwc_ which at the end starts labwc -s lxqt-session.

So we have 2 "sessions": labwc and lxqt in some way. LXQt sends sigterms to all open apps and exits and you end up at the labwc root window and it would be nice to exit also there without action.

We have found no way to exit labwc or another compositor by a detached script or similar from inside lxqt-session, only my fork of wlogout works, otherwise you need always twice to logout, first lxqt, then exit labwc. That is basically the same with all my start scripts, except kwin which has this option mentioned. I've no idea how it works there but I think it was needed for the plasma-wayland session for the same reason.

The name --exit-with-session is not quite appropriate because it can be any GUI application -once closed kwin exits.

I tested shortly without success a loop script in /labwc/autostart

#!/bin/bash

while true; do
    if pgrep -f "lxqt-session" >/dev/null; then
    else
        labwc --exit
    fi
    sleep 4
done

but it looks like it won't be killed if labwc exits and at next login there are 2 processes, have to test more.

from labwc.

johanmalm avatar johanmalm commented on July 21, 2024

I see. So labwc starts lxqt-session. I didn't realize that.

I just want to try to understand a bit more about it:

  • On X, does openbox start lxqt-session also?
  • I assume there is a good reason - but out of curiosity what is the logic behind not using lxqt-session start labwc?
  • Don't worry if you don't know, but any idea what projects like Xfce and Raspbian do?

I don't know enough about this topic to offer much of an opinion, but if it provides a neat solution for Desktop Environments then let's do it. Making this work with projects such as LXQt, Xfce, Raspbian is quite important to us (as long as it doesn't paint us into corner or mortgages technical debt - which I can't see this doing).

Would the cage approach work? https://github.com/cage-kiosk/cage/blob/e7d8780f46277af87881e0be91cb2092541bb1d5/cage.c#L103-L143

I can draft a PR based on the cage approach to test/evaluate/etc if helpful.

from labwc.

ahesford avatar ahesford commented on July 21, 2024

I assume lxqt-session is an X11 and Wayland client. This works in X11 because xinit starts the server and keeps it alive as long as lxqt-session runs. Either lxqt-session starts Openbox, or Openbox can be launched independently first. (I doubt Openbox can launch the session client.)

This doesn't work with Wayland because the compositor needs to be up before the client can function. So the alternatives are:

  1. Rework lxqt-session as a two-part application, where one process starts and manages labwc and then makes sure that a client also launches after that (by some means); the supervisor and client can communicate by some mechanism, so that the supervisor can kill labwc when the client dies.
  2. Allow labwc to launch a "preferred" client that will cause labwc to die when the client dies.

I think an approach like cage would work, and is probably the only reasonable (and most general) way for labwc to accommodate this.

from labwc.

stefonarch avatar stefonarch commented on July 21, 2024
  • On X, does openbox start lxqt-session also?

The other way round: in "Session Settings" a WM is set, which can be any, and lxqt-session starts it.

  • I assume there is a good reason - but out of curiosity what is the logic behind not using lxqt-session start labwc?

Being a Qt application it can't.

  • Don't worry if you don't know, but any idea what projects like Xfce and Raspbian do?

No idea, raspian uses wayfire afaik and didn't check out how xfce's wayland session works.

The point is about closing gently all opened applications, which is done be lxqt-leave. If an application is launched by a shortcut in rx.xml it get's killed, and things like "last opened files" and or settings changed at closing will be lost. I didn't investigate if sway exit or hyprctl dispatch exit do that.

  1. Allow labwc to launch a "preferred" client that will cause labwc to die when the client dies.

I think an approach like cage would work, and is probably the only reasonable (and most general) way for labwc to accommodate this.

Sorry for my ignorance: what is cage (it's hard to search for I guess)?

from labwc.

Consolatis avatar Consolatis commented on July 21, 2024

If an application is launched by a shortcut in rx.xml it get's killed, and things like "last opened files" and or settings changed at closing will be lost. I didn't investigate if sway exit or hyprctl dispatch exit do that.

Labwc doesn't actually kill any applications on exit (nor does it even track them in any way). They kill themselves when the loose their wayland connection though. That might also happen indirectly via libwayland, not sure about that right now.

what is cage (it's hard to search for I guess)?

Another wlroots based wayland compositor, the main idea is to only run a single fullscreen application.

from labwc.

stefonarch avatar stefonarch commented on July 21, 2024

Another wlroots based wayland compositor that only supports a single fullscreen application.

Thanks.

from labwc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.