Skip to content
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

element.sh: Add Electron flags for improved UX under Wayland #325

Merged
merged 2 commits into from
Feb 2, 2023

Conversation

LorbusChris
Copy link
Contributor

No description provided.

If a Wayland session is detected, add the following Electron flags for an
improved user experience:

```
--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations,WebRTCPipeWireCapturer
```

For Wayland sessions, this will:
- enable scaling of the application window
- add decorations (i.e. the close window button) to the application window
- enable screensharing of the application window
Always add the `--enable-features=WebRTCPipeWireCapturer` Electron flag
in order to enable screensharing  in non-Wayland sessions on systems
running Pipewire, too.
@flathubbot
Copy link
Contributor

Started test build 18579

@flathubbot
Copy link
Contributor

Build 18579 successful
To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/1208/im.riot.Riot.flatpakref

@DashieTM
Copy link

DashieTM commented Jan 22, 2023

Some important things to note.

I understand that previously, the idea was to not deviate from upstream element.
However, wayland is becoming the norm on big linux distributions and will essentially replace x11 as the default.
With this, we should at least be able to use the application natively on wayland, which is currently locked to users who know exactly how to configure a .desktop file.
This makes the entry on wayland harder for new users, as xwayland was and will never be a proper replacement for native applications. Things like screenshare, scaling, hotkeys, and more features often either do not work at all, or only work partially.

The problem we face with electron is that everyone tries to pass the burden of doing the change upstream.
Since this is a community maintained version of element, the upstream is element. They then pass it to electron, which passes it to chromium.
Problem is that both chromium and electron will not make the change, as linux is only a fraction of their user base, and they have to make sure that basically all apps would still work.
This means that the change should happen on element. There is an open issue on element, which sadly lead to nothing.
I am sure it is partially because they are busy doing other things, but it means that the issue is not being handled.

When the change is made here, it could fix the issue for the userbase that is directly affected by that issue.
For the other packaging solutions like deb, rpm etc the distributions should put in the flag.

Either way, many thanks for maintaining the flatpak version of element, and of cource Lorbus for this PR.

@LorbusChris
Copy link
Contributor Author

cc @SISheogorath for comment

@LorbusChris LorbusChris changed the title element.sh: Add Electron flags for improved UX element.sh: Add Electron flags for improved UX under Wayland Jan 31, 2023
@LorbusChris
Copy link
Contributor Author

cc @ananace @TingPing @barthalion

@ananace
Copy link
Contributor

ananace commented Feb 2, 2023

It looks reasonable to me, though it will change the window classes and therefore probably cause any user-defined window settings to be reset.
But there's not really much that can be done about that.

@SISheogorath
Copy link
Collaborator

I'm still not a big fan of doing this differently than upstream. However, I guess we end up with a chicken-egg problem, as in: The defaults won't change because no one uses the new stuff, and the new stuff won't be used due to defaults not changing.

Let's be brave and go forward with it. Let's go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants