xpra icon
Bug tracker and wiki

Opened 8 months ago

Closed 4 months ago

Last modified 2 weeks ago

#2243 closed task (fixed)

basic gtk wayland client

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: 3.0
Component: platforms Version: 2.5.x
Keywords: Cc:

Description (last modified by Antoine Martin)

Needs many workarounds for the never ending API deprecation in GTK3.
Many API calls now fail or return nothing: no default screen, no root window, etc. No x11 gl code, no x11 clipboard, no keyboard layout, etc

We should be able to at least run the client without xwayland:

DISPLAY="" GDK_BACKEND=wayland /usr/bin/python3 /usr/bin/xpra attach tcp://localhost:10000/

Related to #1925. For server support, see #387

Attachments (1)

fix-wayland-client-offsets.patch (9.6 KB) - added by Antoine Martin 4 months ago.
we have to use a drawing area to get the correct coordinates

Download all attachments as: .zip

Change History (15)

comment:1 Changed 8 months ago by Antoine Martin

Status: newassigned

Updates:

  • r22236 transparency issue: GTK3 on wayland always paints with alpha
  • r22237 don't try to load the native X11 clipboard (#812)
  • r22239 keymap, dpi, transparency check, x11 display check, etc..

Still TODO:

  • re-implement all the functionality currently using the x11 bindings (ie: workspace, etc)
  • get DPI from somewhere
  • get_mouse_position : make sure the server will ignore this (-1, -1) position if we can't get a real value
  • get_current_modifiers : as above - #1942 may help
  • icon theme missing : gtk bug? do we care?
  • get the keymap from somewhere
  • get_root_size : query all monitors? Add them up? (we can still get monitors from the default display, example: https://askubuntu.com/a/1104252/14126)
  • window has no decorations
  • opengl context adapter

Links:

Last edited 8 months ago by Antoine Martin (previous) (diff)

comment:2 Changed 7 months ago by Antoine Martin

Description: modified (diff)

comment:3 Changed 5 months ago by mviereck

I gave this a try running in Weston v5.0.0 and xpra v3.0-r23019 on Debian buster.

I found one issue with the xpra server: It fails if started with GDK_BACKEND=wayland. It must be started with GKD_BACKEND=x11 (or unset) instead.

The xpra client needs GDK_BACKEND=wayland as noted above. It starts up, but does not show a client window. The log shows an error, but the client does not terminate. The server looks like it gets a valid connection:

==> /home/lauscher/.cache/x11docker/xterm-9065ed/xpraclient.log <==
2019-06-30 14:01:04,176 Xpra GTK3 client version 3.0-r23019 64-bit
2019-06-30 14:01:04,178  running on Linux Debian 10 buster
2019-06-30 14:01:04,178  window manager is 'wayland'
2019-06-30 14:01:04,530 Error: failed to load posix keyboard bindings
2019-06-30 14:01:04,530  cannot load X11 bindings with wayland under python3 / GTK3
2019-06-30 14:01:04,564 keyboard bindings are not available, expect keyboard mapping problems
2019-06-30 14:01:04,568 OpenGL safety warning (enabled at your own risk):
2019-06-30 14:01:04,569  disabled under wayland with GTK3 (buggy)
2019-06-30 14:01:04,655 No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'
2019-06-30 14:01:05,063 Error loading OpenGL support:
2019-06-30 14:01:05,063  no X11 display registered
2019-06-30 14:01:05,117  using default keyboard settings
2019-06-30 14:01:05,123  desktop size is 1824x984 with 1 screen:
2019-06-30 14:01:05,123   wayland-102 (482x259 mm - DPI: 96x96)
2019-06-30 14:01:05,124     weston-X11 none
2019-06-30 14:01:05,126 failed to get antialias info from xsettings: 'NoneType' object is not callable
2019-06-30 14:01:05,136 error preparing connection: 'NoneType' object is not callable
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/xpra/client/client_base.py", line 336, in send_hello
    hello.update(self.make_hello())
  File "/usr/lib/python3/dist-packages/xpra/client/gtk_base/gtk_client_base.py", line 673, in make_hello
    capabilities = UIXpraClient.make_hello(self)
  File "/usr/lib/python3/dist-packages/xpra/client/ui_client_base.py", line 361, in make_hello
    caps.update(c.get_caps(self))
  File "/usr/lib/python3/dist-packages/xpra/client/mixins/window_manager.py", line 271, in get_caps
    "double_click.time"         : get_double_click_time(),
  File "/usr/lib/python3/dist-packages/xpra/platform/xposix/gui.py", line 400, in get_double_click_time
    return _get_xsettings_int("Net/DoubleClickTime", -1)
  File "/usr/lib/python3/dist-packages/xpra/platform/xposix/gui.py", line 390, in _get_xsettings_int
    d = _get_xsettings_dict()
  File "/usr/lib/python3/dist-packages/xpra/platform/xposix/gui.py", line 152, in _get_xsettings_dict
    v = _get_xsettings()
  File "/usr/lib/python3/dist-packages/xpra/platform/xposix/gui.py", line 136, in _get_xsettings
    X11Window = X11WindowBindings()
TypeError: 'NoneType' object is not callable
==> /home/lauscher/.cache/x11docker/xterm-9065ed/xpraserver.log <==
2019-06-30 14:01:05,556 watching for applications menu changes in:
2019-06-30 14:01:05,556  '/usr/share/xfce4/applications'
2019-06-30 14:01:05,556  '/usr/local/share/applications'
2019-06-30 14:01:05,556  '/usr/share/applications'
2019-06-30 14:01:05,557  '/usr/share/applications'
2019-06-30 14:01:05,557 6.5GB of system memory
2019-06-30 14:01:06,099 New unix-domain connection received on /home/lauscher/.cache/x11docker/xterm-9065ed/buster-104
2019-06-30 14:01:06,177 New unix-domain connection received on /home/lauscher/.cache/x11docker/xterm-9065ed/buster-104

get the keymap from somewhere

/etc/default/keyboard might help.

comment:4 Changed 5 months ago by Antoine Martin

2019-06-30 14:01:05,126 failed to get antialias info from xsettings: 'NoneType' object is not callable

Thanks for pointing that out, fixed in r23057.

get the keymap from somewhere

/etc/default/keyboard might help.

That's a Debian thing, it doesn't exist on other distros..
As for wayland, there is no "standard" way of doing this that I can find.
Looks like every compositor is going to have its own way of configuring things: Does Wayland use XKB for keyboard layouts?: But Wayland does not define how this keymap is decided on. This decision is up to the compositor.

comment:5 Changed 5 months ago by Antoine Martin

Note: if we cannot support the native Wayland client well enough before the 3.0 release then we will have to force it to switch to the X11 backend.

comment:6 Changed 5 months ago by mviereck

There is SirCmpwn, a developer of wlroots and Wayland compositor sway. I believe he likes to help others in Wayland development. It might be worth to contact him for questions like keyboard layouts.

https://swaywm.org/
https://github.com/swaywm/sway

Looks like every compositor is going to have its own way of configuring things

There is some work done to develop an additional standard that includes more than the core Wayland protocol, the xdg_shell interface. That might help.

Last edited 4 months ago by Antoine Martin (previous) (diff)

comment:7 Changed 5 months ago by mviereck

I accidently found that the xpra client fails with "Cannot open display" even on x11 if GDK_BACKEND is set but empty.
To avoid this you could unset GDK_BACKEND if it is empty.

comment:8 Changed 5 months ago by mviereck

I'd like to test xpra Wayland client in a fedora VM.
I get the slightly outdated version xpra v3.0-r23019 from winswitch beta repository with the bug mentioned in comment 3.
Could you please push an update for fedora?

I've encountered issues on Debian buster with outdated Weston 5.0.0 (window decoration mismatches window content).
I think it makes sense to test with more recent versions of Weston before reporting bugs here, so I want to try in a fedora 30 VM.

Changed 4 months ago by Antoine Martin

we have to use a drawing area to get the correct coordinates

comment:9 Changed 4 months ago by Antoine Martin

Resolution: fixed
Status: assignedclosed

Minor updates:

  • r23295 + r23296 + r23297: workarounds for flaky GTK3 cursors under wayland (better solution in #2367)
  • r23305 fix rendering offsets (use a widget context rather than a window context - may help with #2217)

This is as good as it is going to get for this release.
To test from an X11 desktop, run weston then from a terminal:

GDK_BACKEND=wayland python3 /usr/bin/xpra attach

Things that are just not supported in this release: clipboard, keyboard layout, etc
That's why the default remains the X11 backend.

Will follow up in #2368

comment:10 Changed 4 months ago by Antoine Martin

We detect the keyboard layout using localectl status as of r23321 - which is better than nothing.

As for the clipboard, we removed the GTK clipboard in #812... And that was a lot of work.
Re-adding something like it would allow some sort of clipboard synchronization with wayland clients, but the big problem here is that there is no notification change support on wayland, so this would not work well at all.
(removing things without providing a replacement is an improvement / feature apparently)

comment:11 Changed 4 months ago by Antoine Martin

r23305 broke non-opengl GTK2 rendering: #2377

comment:12 Changed 4 months ago by Antoine Martin

Missed from the refactoring: r23429.

comment:13 Changed 3 months ago by mviereck

I can confirm that xpra client on Wayland works well on Weston v5.0.0 and kwin_wayland 5.14.5.
The window content now fits into the window border and the keyboard matches the system setting.

Tested on Debian bullseye with xpra v3.0-r23522

Thank you!

comment:14 Changed 2 weeks ago by Antoine Martin

Wayland, at least when testing via Weston, is afflicted by a GTK3 CSD geometry bug: #2475 / #2457.

Note: See TracTickets for help on using tickets.