Giter Club home page Giter Club logo

Comments (8)

Hjdskes avatar Hjdskes commented on August 20, 2024

You're hitting on a piece of functionality that I'm not sure how to best handle. As you know, the idea of Cage (or any kiosk in general) is to limit user input and run only a single application at the same time.

The idea was that Cage would start a "primary client" (for lack of a better name), whose window it would maximize and whose dialogs it would manage. That would be it; any other toplevel windows would be ignored because they would represent other applications, indicating that the user has "broken out" of the kiosk[1]. Imagine, for example, a kiosk at a public location with a questionnaire. If you would be able to open the settings or a browser, you've broken out of the system. I can also imagine, however, use cases where the application would temporarily launch a new window that would not be a dialog.

Clearly, Cage in its current form falls in the middle of these two approaches and does not deal well with either. As you've found out, it is allowed to open new toplevel windows and they are managed properly. However, as you've also found out, as soon as a toplevel window is closed, Cage exits[2].

So ideally, we'd decide on one of these approaches and commit to that choice. Personally, I'm leaning towards the case where we would manage new toplevel windows in the way that you expect them to. That is: any new toplevel window takes over the Cage display, hiding any previous toplevels until it is closed. Only when the last toplevel is closed, does Cage exit as well. I think this is the way to go because not only does it seem to be the easy way forward, it also supports more use cases. And, locking the system down to prevent the user from doing unwanted things is as much the administrator's problem as it is Cage's. Cage cannot (realistically) do everything.

I'd appreciate any viewpoints or opinions, from anyone reading this issue.

[1] To be honest, I don't know if a compositor can ignore new surfaces and prevent them from spawning at all, since Cage is only involved once its surface handlers are called from wlroots. It could probably close them immediately, though.
[2] It shouldn't segfault though. When I run cage termite and from termite launch another instance of termite which I close, Cage exits cleanly.

from cage.

ddevault avatar ddevault commented on August 20, 2024

The use-case I have in mind for Cage is to implement a desktop experience which is comparible to plan9's rio.

from cage.

 avatar commented on August 20, 2024

The use-case I have in mind when I started to loosely follow cage is the following:
We have a box running Linux running a single application - the UI of the application is a huge bunch of react code running on top of chromium.
We want in some situations to launch another application that as long as it runs should take full control of display and input. All input is touch. When this application exits the former application should get focus again and take over input again.
This looks like a good match for the use case described.

Note:
Today we are running the application op top of QtWebEngine (which is Chromium based).
I really do not know what would be required to make this run in another environment - I would love to have Chromium running of top of wayland but being a bit ignorant I do not know if this is what I get if I run Chromium in a cage.
In other words - I am not really sure if Cage will help me here or I am just adding some extra layer to something that is not providing me anything extra.

from cage.

Hjdskes avatar Hjdskes commented on August 20, 2024

Seems like the both of you prefer the same approach as I do. I'll work towards making this happen.

The use-case I have in mind for Cage is to implement a desktop experience which is comparible to plan9's rio.

Just to be sure, you're referring to the feature where the spawned application "re-uses" the window of the terminal it was spawned from? I'm not entirely sure, but isn't Wayland's fullscreen-shell possibly a better approach here? Although I think that really only manages a single application, so you might not be able to spawn something to "replace" the terminal...

I would love to have Chromium running of top of wayland but being a bit ignorant I do not know if this is what I get if I run Chromium in a cage.

When you run Chromium in Cage, you run Chromium in Wayland. However, at the moment Chromium does not run inside Cage (#19), so we'll need to get that fixed first.

from cage.

ddevault avatar ddevault commented on August 20, 2024

Just to be sure, you're referring to the feature where the spawned application "re-uses" the window of the terminal it was spawned from?

Right. I want to open a cage session for each client application.

I'm not entirely sure, but isn't Wayland's fullscreen-shell possibly a better approach here?

I think the odds of getting a substantial subset of end-user applications to support fullscreen-shell is almost nil. Also, won't work for Xwayland. I think this is the better approach.

from cage.

Hjdskes avatar Hjdskes commented on August 20, 2024

I have some work ready in #26. I'd appreciate if you could take this for a spin and see if it works the way you expect it to.

from cage.

ddevault avatar ddevault commented on August 20, 2024

Yep, works great!

from cage.

Hjdskes avatar Hjdskes commented on August 20, 2024

Great! Curious to see what you come up with, keep me updated :)

from cage.

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.