trilium icon indicating copy to clipboard operation
trilium copied to clipboard

Blank window under Wayland (and XWayland)

Open jbhanks opened this issue 1 year ago • 5 comments

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}

jbhanks avatar Feb 08 '23 21:02 jbhanks

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

zadam avatar Feb 10 '23 11:02 zadam

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

jbhanks avatar Feb 10 '23 22:02 jbhanks

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

zadam avatar Feb 11 '23 20:02 zadam

--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 avatar Feb 12 '23 13:02 jbhanks

@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

jbhanks avatar Feb 14 '23 07:02 jbhanks

@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

plabadens avatar Jun 10 '23 13:06 plabadens

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

zadam avatar Jun 12 '23 21:06 zadam