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

No header bar when launching Logseq with native Wayland flags #5010

Closed
VarLad opened this issue Apr 20, 2022 · 17 comments · Fixed by #6500
Closed

No header bar when launching Logseq with native Wayland flags #5010

VarLad opened this issue Apr 20, 2022 · 17 comments · Fixed by #6500
Labels
electron os:linux upstream Blocked by upstream deps

Comments

@VarLad
Copy link

VarLad commented Apr 20, 2022

What happened?

Launching Logseq using flatpak run com.logseq.Logseq --socket=wayland --enable-features=UseOzonePlatform --ozone-platform=wayland on GNOME 41 Wayland

image

No visible window decoration.

Reproduce the Bug

  1. Install Logseq from Flathub using flatpak install flathub com.logseq.Logseq
  2. Launching it with flatpak run com.logseq.Logseq --socket=wayland --enable-features=UseOzonePlatform --ozone-platform=wayland for native Wayland
  3. No window decorations can be seen

Expected Behavior

Proper window decorations when launching Logseq in native Wayland mode.

Screenshots

No response

Desktop Platform Information

Fedora 35 Workstation on Wayland
Logseq 0.6.6

Mobile Platform Information

No response

Additional Context

Window decorations for GNOME has been present in Electron from 17.x.y versions, while a stable Wayland support is available in 18.x.y versions.
The best way to fix this in my opinion is to update the Electron version used by Logseq to 18.x.y

@cnrpman cnrpman added electron upstream Blocked by upstream deps os:linux labels Apr 20, 2022
@cnrpman
Copy link
Collaborator

cnrpman commented Apr 20, 2022

@VarLad Thanks for report.
Upgrading electron requires thorough consideration as it could easily break the dependencies based on our previous records..

@VarLad
Copy link
Author

VarLad commented Apr 20, 2022

@cnrpman Thanks for the reply and I do understand the problem here.

Wayland is what most Linux users are now shifting to, and I hope an upgrade will be made considering that only the recent versions of Electron support window decorations on GNOME and some other features on Wayland.

@glyh
Copy link

glyh commented Apr 29, 2022

Old electron also causes problem like #4288

@VarLad
Copy link
Author

VarLad commented May 15, 2022

For now, the current implementation has problems upstream. electron/electron#33161
I'd suggest that this issue be put on hold for now.
We can do something after it gets resolved and released upstream

@GrantMoyer
Copy link
Contributor

GrantMoyer commented Jul 14, 2022

I tested on electron 19.0.8. Passing --enable-features=WaylandWindowDecorations in addition to the other wayland arguments does make window decorations, but they're unusable due to electron/electron#34820.

Note that the other issue, electron/electron#33161, is ugly but doesn't otherwise impact usability.

@GrantMoyer
Copy link
Contributor

GrantMoyer commented Jul 20, 2022

Passing --enable-features=WaylandWindowDecorations in addition to the other wayland arguments does make window decorations, but they're unusable due to electron/electron#34820.

This issue should be fixed when electron/electron#34955 lands. Of course, it will require another electron dependency upgrade, though hopefully just a minor version.

@VarLad
Copy link
Author

VarLad commented Aug 5, 2022

@GrantMoyer It landed and was backported to 19-x-y. Now to wait for a release

@kanru
Copy link
Contributor

kanru commented Aug 17, 2022

It looks like electron 19.0.12 should include the fixes, but my flatpak build still has the window decoration mangled.

Will try to build the Logseq nightly..

@cnrpman
Copy link
Collaborator

cnrpman commented Aug 17, 2022

@kanru
Copy link
Contributor

kanru commented Aug 17, 2022

@cnrpman Yes, I know. I patched my wayland branch to 19.0.12, but I think I missed one place.

@kanru
Copy link
Contributor

kanru commented Aug 17, 2022

I can confirm that upgrading to electron 19.0.12 does fix the no window decorator issue.

However my IME does not work in wayland mode. I think we need more testing before making it the default (--ozone-platform-hint=auto)

@VarLad
Copy link
Author

VarLad commented Aug 17, 2022

@kanru For the flatpak, how about doing --ozone-platform-hint=auto and removing "Wayland" socket by default
That way, those who wanna use the native Wayland version can just enable the Wayland socket from Flatseal

Also, the above issue is https://bugs.chromium.org/p/chromium/issues/detail?id=1022724 and I doubt it'll be solved soon

@kanru
Copy link
Contributor

kanru commented Sep 1, 2022

@VarLad using --ozone-platform-hint=auto without wayland socket currently will segment fault.

flatpak run com.logseq.Logseq --ozone-platform-hint=auto
LaunchProcess: failed to execvp:
xdg-settings
[3:0901/235320.219183:ERROR:wayland_connection.cc(209)] Failed to connect to Wayland display
[3:0901/235320.219198:ERROR:ozone_platform_wayland.cc(226)] Failed to initialize Wayland platform
[3:0901/235320.219204:ERROR:env.cc(226)] The platform failed to initialize.  Exiting.
/app/bin/run.sh: line 2:     3 Segmentation fault      (core dumped) zypak-wrapper.sh /app/logseq/Logseq "$@"

So for now I will not add the default flags to 0.8.3 flatpak build.

@queeup
Copy link
Contributor

queeup commented Sep 1, 2022

you forgot to put --socket=wayland argument.

flatpak run --socket=wayland com.logseq.Logseq --ozone-platform-hint=auto
With this command there is No header bar unfortunately.

Need to add --enable-features=WaylandWindowDecorations also.

Final command is:
flatpak run --socket=wayland com.logseq.Logseq --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations

Now my eyes can rest while I am working on Wayland with Logseq

@kanru
Copy link
Contributor

kanru commented Sep 1, 2022

I intentionally left out --socket=wayland because I want it to use x11 by default. Proposed by #5010 (comment)

I'm glad the final command works for you.

Please open a ticket in https://github.com/flathub/com.logseq.Logseq/issues to discuss how to make this easier to use, for example ship two different desktop files?

@queeup
Copy link
Contributor

queeup commented Sep 1, 2022

Yes I will but there is a problem about --ozone-platform-hint=auto here. It's not trigger WaylandWindowDecorations on wayland detect. We need to declare manually.

I don't know how to solve that.

@cab404
Copy link

cab404 commented Oct 18, 2022

Final command is: flatpak run --socket=wayland com.logseq.Logseq --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations

Now my eyes can rest while I am working on Wayland with Logseq

Wow that actually works for the latest sway! Even while logseq Electron still has old wayland bindings!
Amazing, thank you!
How dumb am I not enabling wayland socket in flatpak :D

Alas cursors are becoming bodged with scaling, but still better than before)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
electron os:linux upstream Blocked by upstream deps
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants