zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.25k stars 1.91k forks source link

Blank window under Wayland (and XWayland) #3597

Open jbhanks opened 1 year ago

jbhanks commented 1 year ago

Trilium Version

0.58.7

What operating system are you using?

Other Linux

What is your setup?

Local + server sync

Operating System Version

OpenSuse Tumbleweed 20230207 (kernel 6.1.10-1-default).

Description

When I open Trilium under Wayland, I get a blank window, like this: image

The result is the same if I launch without flags (which uses XWayland, confirmed by testing with xeyes) and if I launch with Wayland flags --enable-features=UseOzonePlatform --ozone-platform=wayland. If I start under an X11 desktop, all is well.

I am using KDE and NVIDIA with proprietary drivers (a necessity for me). Now that NVIDIA supports GBM, Wayland/wlroots shouldn't be a problem. Unless perhaps the underlying version of Electron has not caught up to this development?

Error logs

With XWayland (result: blank window the color of my theme):

$ /opt/trilium-linux-x64/trilium --no-gpu
DB size: 2187 KB
Trusted reverse proxy: false
App HTTP server starting up at port 37840
{
  "appVersion": "0.58.7",
  "dbVersion": 212,
  "syncVersion": 29,
  "buildDate": "2023-01-17T23:14:58+01:00",
  "buildRevision": "a3149aecf41bac3c559ebbd1865e916264985ac3",
  "dataDirectory": "/home/james/.local/share/trilium-data",
  "clipperProtocolVersion": "1.0",
  "utcDateTime": "2023-02-08T21:27:47.910Z"
}
CPU model: AMD Ryzen 9 5950X 16-Core Processor, logical cores: 32 freq: 2200 Mhz
Listening on port 37840
Becca (note cache) load took 2ms
Registered global shortcut Ctrl+Alt+P for action createNoteIntoInbox
Generated CSRF token lBPSOCYe-xUxELKcXJwTsIRDsi5t0x1vb1CE with secret _csrf=FjbEUgVJYIck3GkADuJtFL24; Path=/
200 GET /api/options with 5798 bytes took 1ms
200 GET /api/tree with 13088 bytes took 1ms
200 GET /api/keyboard-actions with 12183 bytes took 0ms
200 GET /api/script/widgets with 2 bytes took 0ms
websocket client connected
200 GET /api/keyboard-shortcuts-for-notes with 2 bytes took 0ms
200 POST /api/tree/load with 6324 bytes took 0ms
200 POST /api/tree/load with 18636 bytes took 1ms
200 GET /api/notes/V021VelvCYJy with 433 bytes took 1ms
200 GET /api/note-map/V021VelvCYJy/backlink-count with 11 bytes took 0ms
200 GET /api/script/startup with 2 bytes took 1ms
Table counts: notes: 157, note_revisions: 612, branches: 168, attributes: 161, etapi_tokens: 0
All consistency checks passed with no errors detected (took 7ms)
Nothing to push
Finished pull
Nothing to push
Content hash computation took 7ms
Content hash checks PASSED
Sending message to all clients: {"type":"sync-finished","lastSyncedPush":3491}

With Wayland explicitly specified (result: no window at all)

DB size: 2187 KB
Trusted reverse proxy: false
App HTTP server starting up at port 37840
{
  "appVersion": "0.58.7",
  "dbVersion": 212,
  "syncVersion": 29,
  "buildDate": "2023-01-17T23:14:58+01:00",
  "buildRevision": "a3149aecf41bac3c559ebbd1865e916264985ac3",
  "dataDirectory": "/home/james/.local/share/trilium-data",
  "clipperProtocolVersion": "1.0",
  "utcDateTime": "2023-02-08T21:27:47.910Z"
}
CPU model: AMD Ryzen 9 5950X 16-Core Processor, logical cores: 32 freq: 2200 Mhz
Listening on port 37840
Becca (note cache) load took 2ms
Registered global shortcut Ctrl+Alt+P for action createNoteIntoInbox
Generated CSRF token lBPSOCYe-xUxELKcXJwTsIRDsi5t0x1vb1CE with secret _csrf=FjbEUgVJYIck3GkADuJtFL24; Path=/
200 GET /api/options with 5798 bytes took 1ms
200 GET /api/tree with 13088 bytes took 1ms
200 GET /api/keyboard-actions with 12183 bytes took 0ms
200 GET /api/script/widgets with 2 bytes took 0ms
websocket client connected
200 GET /api/keyboard-shortcuts-for-notes with 2 bytes took 0ms
200 POST /api/tree/load with 6324 bytes took 0ms
200 POST /api/tree/load with 18636 bytes took 1ms
200 GET /api/notes/V021VelvCYJy with 433 bytes took 1ms
200 GET /api/note-map/V021VelvCYJy/backlink-count with 11 bytes took 0ms
200 GET /api/script/startup with 2 bytes took 1ms
Table counts: notes: 157, note_revisions: 612, branches: 168, attributes: 161, etapi_tokens: 0
All consistency checks passed with no errors detected (took 7ms)
Nothing to push
Finished pull
Nothing to push
Content hash computation took 7ms
Content hash checks PASSED
Sending message to all clients: {"type":"sync-finished","lastSyncedPush":3491}

With Wayland implied (this fixes problems with Brave Browser for me, so I thought it might help). It launches in XWayland mode with the same result as before (blank window):

$ /opt/trilium-linux-x64/trilium --no-gpu
DB size: 2187 KB
Trusted reverse proxy: false
App HTTP server starting up at port 37840
{
  "appVersion": "0.58.7",
  "dbVersion": 212,
  "syncVersion": 29,
  "buildDate": "2023-01-17T23:14:58+01:00",
  "buildRevision": "a3149aecf41bac3c559ebbd1865e916264985ac3",
  "dataDirectory": "/home/james/.local/share/trilium-data",
  "clipperProtocolVersion": "1.0",
  "utcDateTime": "2023-02-08T21:27:47.910Z"
}
CPU model: AMD Ryzen 9 5950X 16-Core Processor, logical cores: 32 freq: 2200 Mhz
Listening on port 37840
Becca (note cache) load took 2ms
Registered global shortcut Ctrl+Alt+P for action createNoteIntoInbox
Generated CSRF token lBPSOCYe-xUxELKcXJwTsIRDsi5t0x1vb1CE with secret _csrf=FjbEUgVJYIck3GkADuJtFL24; Path=/
200 GET /api/options with 5798 bytes took 1ms
200 GET /api/tree with 13088 bytes took 1ms
200 GET /api/keyboard-actions with 12183 bytes took 0ms
200 GET /api/script/widgets with 2 bytes took 0ms
websocket client connected
200 GET /api/keyboard-shortcuts-for-notes with 2 bytes took 0ms
200 POST /api/tree/load with 6324 bytes took 0ms
200 POST /api/tree/load with 18636 bytes took 1ms
200 GET /api/notes/V021VelvCYJy with 433 bytes took 1ms
200 GET /api/note-map/V021VelvCYJy/backlink-count with 11 bytes took 0ms
200 GET /api/script/startup with 2 bytes took 1ms
Table counts: notes: 157, note_revisions: 612, branches: 168, attributes: 161, etapi_tokens: 0
All consistency checks passed with no errors detected (took 7ms)
Nothing to push
Finished pull
Nothing to push
Content hash computation took 7ms
Content hash checks PASSED
Sending message to all clients: {"type":"sync-finished","lastSyncedPush":3491}
zadam commented 1 year ago

Hi, you might try running also with --disable-gpu, that helps with some graphics issues.

jbhanks commented 1 year ago

Hi, you might try running also with --disable-gpu, that helps with some graphics issues.

As you can see from my error log, that did not help. In combination with specifying Wayland, it crashed with a core dump:

sherman% /opt/trilium-linux-x64/trilium --enable-features=UseOzonePlatform --ozone-platform=wayland --no-gpu
DB size: 2187 KB
Trusted reverse proxy: false
App HTTP server starting up at port 37840
{
  "appVersion": "0.58.7",
  "dbVersion": 212,
  "syncVersion": 29,
  "buildDate": "2023-01-17T23:14:58+01:00",
  "buildRevision": "a3149aecf41bac3c559ebbd1865e916264985ac3",
  "dataDirectory": "/home/james/.local/share/trilium-data",
  "clipperProtocolVersion": "1.0",
  "utcDateTime": "2023-02-10T22:03:06.807Z"
}
CPU model: AMD Ryzen 9 5950X 16-Core Processor, logical cores: 32 freq: 2879 Mhz
Listening on port 37840
Becca (note cache) load took 2ms
interface 'wl_output' has no event 4
[1]    8307 trace trap (core dumped)  /opt/trilium-linux-x64/trilium --enable-features=UseOzonePlatform  --no-gpu
zadam commented 1 year ago

You have --no-gpu there (which I don't think exists), not --disable-gpu.

jbhanks commented 1 year ago

--disable-gpu

You're right, my bad. It does draw the window with --disable-gpu, however there is some flickering and glitching though. Seems usable though.

jbhanks commented 1 year ago

@zadam here is an example of the glitchy video I get with --disable-gpu. I get similar-looking artifacts on other Chromium-based apps, so it isn't just Trilium or even Electron.

https://user-images.githubusercontent.com/12942318/218665037-bf29019a-efb4-440d-8baf-411002f17d2c.mp4

plabadens commented 1 year ago

@zadam Please consider updating to a newer version of electron, as they have much better support for Wayland. This would go a long way towards solving all these issues. In particular, the issue with "interface 'wl_output' has no event 4" has been fixed upstream: electron/electron#32487

zadam commented 1 year ago

@plabadens 0.61 (in branch next61) is already running on electron 25, so it is coming.