-
Notifications
You must be signed in to change notification settings - Fork 187
Changes to get screen cast portals working #461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Ensures we use the wlr desktop portal Signed-off-by: Joshua Ashton <joshua@froggi.es>
e66ff8e to
612ce8a
Compare
|
merge! merge! merge! 🎉 |
Initialize systemd and dbus with our relevant variables which are needed for some desktop portal use. This fixes things such as OBS screen casting not working. In the worst case, on non-systemd/dbus systems, this will just not do anything. Signed-off-by: Joshua Ashton <joshua@froggi.es>
612ce8a to
6b2b7e5
Compare
|
You need to make sure it works for those not running systemd. If /run/systemd/system/ exists then systemd is in use, just check and bracket with an if. |
|
We don't need to check anything, it will just silently fail and continue on. |
|
Why are you not running those commands from autostart? |
|
Because making users put stuff in their personal configs to make basic functionality that should work out of the box work is a bad thing. |
|
The change for Regarding the hardcoded (and blocking) I'd be completely fine to add these two commands (and the corresponding comment) to |
|
If we're going yo use /* use type or command -v ? */
if(system("type systemctl >/dev/null 2>&1") == 0) {
...
} |
|
@Consolatis This is not user configuration, this is completing basic setup of the session needed for things such as portals to work. Other DEs like KDE and Gnome do essentially the same thing, and the Arch packages for Sway even inject a config to do this. I am fine with changing it from system to something else that is non-blocking and cleaner. |
Labwc is not a desktop environment though, its a compositor. For the same reason labwc doesn't depend on (or tries to start if available)
I assume the reason they do this is that sway itself doesn't want to hard-code it either. |
|
If you "prefer" to use applications that don't use it, you can just not use them. You are just arguing that some applications should just randomly be broken unless a user puts magic incantations to bother to finish setting up the session in their autostart. Setting up your panels is absolutely a user configuration, but this is (and has already to me and others who use labwc) just going to be a useless footgun otherwise. I agree the current implementation is slightly ugly but it is also simple. For the dbus-stuff, perhaps call it directly, if preferred, etc and use a non-blocking call for the systemd part. |
I completely agree that this is a pain point and thus both commands / |
|
hm.. I still think that providing a proper example in I am not completely against merging this when
|
|
Does anyone really cares about the one guy that will use labwc in a non-systemd system? |
yes |
I know at least 3 not including me and there will be a whole bunch more when I release... |
okay, so what would be a solution to get desktop-portal working without hurting the 4 guys using non-systemd systems? |
Add to XDG_CURRENT_DESKTOP=wlrootsAdd to systemctl --user import-environment DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOPRestart labwc. |
that can work, what you think @Joshua-Ashton? |
|
A few comments.
Add the lines to autostart AND add a little description to either the generic doc/wiki and/or man pages mentioning this and what it's used for and why. |
Can you give a genuine reason other than inconveniencing users?
This is not configuration.
Then they wouldn't have them installed! This just makes them work, if they are installed. |
|
I am willing to compromise on doing this only when |
|
Thanks for all the contributions here. Good discussion, although I note a slight harshness in tone and politely ask everyone stay respectful at all times. I’m okay with the proposed patch - although think spawn_async_no_shell() or similar is preferable. My initial reaction was similar to that of @Consolatis thinking that this is the role of a session-file or autostart. I did even contemplate the openbox approach of loading both (rather than one or the other) system wide and user autostart, and then shipping a system autostart template with the systemd/dbus calls. However, on consideration, I think Josh’s patch makes sense. We want labwc to be easy to run without too much tweaking and reading of man pages. I also think it’s a shame when distros/OSs have to patch software - better to implement upstream as long as it does not create problems for others or result in technical debt which I don’t think it will in this case. If we later regret the implementation we can move to a system-wide autostart approach without regression (except that a system wide installation will be required) |
This allows xdg-desktop-portal-wlr to work out of the box for screen-recording. If systemd or dbus is not available the environmemt update will fail gracefully. This patch will set XDG_CURRENT_DESKTOP=wlroots but a user can change this by either having the environment variable set before starting labwc or by having a different value set in ~/.config/labwc/environment. Based on PR labwc#461 by @Joshua-Ashton
|
Gave it a try: Differences to this PR:
Same to this PR:
|
This allows xdg-desktop-portal-wlr to work out of the box for screen-recording. If systemd or dbus is not available the environmemt update will fail gracefully. This patch will set XDG_CURRENT_DESKTOP=wlroots but a user may change this by either having the environment variable set before starting labwc or by having a different value set in ~/.config/labwc/environment. Based on PR labwc#461 by @Joshua-Ashton
This allows xdg-desktop-portal-wlr to work out of the box for screen-recording. If systemd or dbus is not available the environment update will fail gracefully. This patch will set XDG_CURRENT_DESKTOP=wlroots but a user may change this by either having the environment variable set before starting labwc or by having a different value set in ~/.config/labwc/environment. Based on PR labwc#461 by @Joshua-Ashton
This allows xdg-desktop-portal-wlr to work out of the box for screen-recording. If systemd or dbus is not available the environment update will fail gracefully. This patch will set XDG_CURRENT_DESKTOP=wlroots but a user may change this by either having the environment variable set before starting labwc or by having a different value set in ~/.config/labwc/environment. Based on PR labwc#461 by @Joshua-Ashton
This allows xdg-desktop-portal-wlr to work out of the box for screen-recording. If systemd or dbus is not available the environment update will fail gracefully. This patch will set XDG_CURRENT_DESKTOP=wlroots but a user may change this by either having the environment variable set before starting labwc or by having a different value set in ~/.config/labwc/environment. Based on PR #461 by @Joshua-Ashton
Sets the desktop name for the session and initializes some variables dbus/systemd need to call the right things.
With these changes, I can successfully screencast with OBS Studio, previously it would ask the global portal interface and there would be none.
It doesn't find portals itself to talk to like some other applications do.