Xpra: Ticket #2243: basic gtk wayland client

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



Mon, 01 Apr 2019 09:24:23 GMT - Antoine Martin: status changed

Updates:

Still TODO:

Links:


Sat, 13 Apr 2019 03:31:28 GMT - Antoine Martin: description changed


Sun, 30 Jun 2019 12:36:14 GMT - 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.


Sun, 30 Jun 2019 17:15:09 GMT - 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.


Tue, 02 Jul 2019 09:28:01 GMT - 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.


Wed, 03 Jul 2019 11:41:41 GMT - 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.


Thu, 04 Jul 2019 22:08:44 GMT - 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.


Sat, 06 Jul 2019 10:22:08 GMT - 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.


Thu, 25 Jul 2019 09:40:41 GMT - Antoine Martin: attachment set

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


Thu, 25 Jul 2019 13:07:32 GMT - Antoine Martin: status changed; resolution set

Minor updates:

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


Sun, 28 Jul 2019 06:10:48 GMT - 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)


Thu, 01 Aug 2019 16:48:44 GMT - Antoine Martin:

r23305 broke non-opengl GTK2 rendering: #2377


Sun, 04 Aug 2019 12:09:09 GMT - Antoine Martin:

Missed from the refactoring: r23429.


Sat, 17 Aug 2019 19:14:52 GMT - 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!


Thu, 07 Nov 2019 15:05:09 GMT - Antoine Martin:

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


Sat, 23 Jan 2021 05:46:00 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2243