Xpra: Ticket #2390: GTK2: pcmanfm: some mouse events missing

Debian bullseye with xpra v3.0-r23522

pcmanfm (GTK2) does not react on some mouse events. This affects e.g. OK/Close buttons and checkboxes in "Settings". However, opening folders and choosing menu entries works.

This does not affect pcmanfm-qt (QT5).

Example to reproduce:

xpra start :30 --xvfb="/usr/bin/Xvfb :30" --start "pcmanfm" --daemon=no
xpra attach :30


Sun, 18 Aug 2019 13:27:54 GMT - mviereck: version, component changed


Sun, 18 Aug 2019 16:15:51 GMT - Antoine Martin: status changed

I don't see any "Settings" when I run pcmanfm, but I do have a "Preferences" dialog - I assume this is the one you meant. When running on Fedora 30, I don't have any problems with mouse events, but I do see a difference: all the windows are slightly greyed out, like it does when running natively and you take the focus away. Maybe we're not sending all the focus events that the application expects.


Sun, 18 Aug 2019 16:24:16 GMT - mviereck:

I don't see any "Settings" when I run pcmanfm, but I do have a "Preferences" dialog - I assume this is the one you meant.

Yes.

I do see a difference: all the windows are slightly greyed out, like it does when running natively and you take the focus away.

I've seen this sometimes, too, but not in my current tests.

When running on Fedora 30, I don't have any problems with mouse events

I just checked again. If I click multiple times on a button, randomly one click works.


Sun, 18 Aug 2019 16:42:27 GMT - mviereck:

Maybe related: I have an odd issue if I use xpra to show firefox in a Docker container.

This only applies to firefox in container shown with xpra. It does not apply to firefox on host shown with xpra. It does not apply to firefox in container shown with nxagent or Xephyr. Changing many xpra or X options does not make a difference.

This issue is odd and quite special. I cannot track it down properly, so I hesitated to open a ticket so far. However, it might be a focus event issue, too.

To reproduce you need Docker and x11docker:

x11docker --xpra -- --shm-size=4G -- jess/firefox

Mon, 19 Aug 2019 02:50:14 GMT - Antoine Martin:

The cursor thing is probably unrelated, maybe GTK fails to load the default cursors - for whatever reason. The server's log with -d cursor should show us what is going on.


Mon, 19 Aug 2019 07:40:40 GMT - mviereck:

I've check with xpra v2.5-r23270 (Latest v2.5 available): Both pcmanfm and firefox behave as expected. Issue occures with v3.0-r22234 and v3.0-r23522 (oldest and latest v3.0 I have available)

The cursor thing is probably unrelated, maybe GTK fails to load the default cursors - for whatever reason.

The actions are missing, too. E.g. showing the UrL at the bottom of the browser window if the cursor is above a link. It seems the mouse position is not submitted until I click a mouse button.

The server's log with -d cursor should show us what is going on.

Actions:


Mon, 19 Aug 2019 08:08:04 GMT - mviereck:

Additional check show that it is not a version difference but a python2/3 backend difference.

The issues occur with v2.5 and v3.0 as well if using the python3 backend. The issues do not occur with v2.5 and v3.0 if using the python2 backend.

Both checked with firefox and pcmanfm.


Tue, 20 Aug 2019 08:35:22 GMT - Antoine Martin:

xpra GTK3 X11 version 3.0-r22234 64-bit (..) Weird corruption in _NET_WM_ICON: unpack requires a buffer of 16 bytes

Can you try something more recent? I'm pretty sure the _NET_WM_ICON bug got squashed, and maybe others too.


Tue, 20 Aug 2019 09:32:30 GMT - mviereck:

Can you try something more recent?

Now with xpra v3.0-r23522. Same actions as above; this time the cursor becomes an "edit cursor" on the new website.

x11docker [11:26:21,342]: Starting Xpra server
2019-08-20 11:26:22,823 created unix domain socket: /home/lauscher/.cache/x11docker/test-9317742/buster-102
2019-08-20 11:26:23,036 pointer device emulation using XTest
2019-08-20 11:26:24,439 4x AMD A6-7310 APU with AMD Radeon R4 Graphics
2019-08-20 11:26:24,465 Warning: no XShm support on display :102
2019-08-20 11:26:24,494 xvfb pid not found
2019-08-20 11:26:24,498 get_default_cursor=[960, 540, 16, 16, 7, 7, 1, b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff', b'']
(Xpra:29320): Gtk-CRITICAL **: 11:26:24.679: gtk_widget_realize: assertion 'widget->priv->anchored || GTK_IS_INVISIBLE (widget)' failed
2019-08-20 11:26:24,798 xpra is ready.
2019-08-20 11:26:24,807 xpra GTK3 X11 version 3.0-r23522 64-bit
2019-08-20 11:26:24,920 6.8GB of system memory
2019-08-20 11:26:25,000 New unix-domain connection received on /home/lauscher/.cache/x11docker/test-9317742/buster-102
2019-08-20 11:26:25,064 Handshake complete; enabling connection
2019-08-20 11:26:25,097  mmap is enabled using 256MB area in /run/user/1000/xpra/xpra.hs_o2zw2.mmap
2019-08-20 11:26:25,105 Python/GTK3 Linux Debian testing bullseye x11 client version 3.0-r23522 64-bit
2019-08-20 11:26:25,105  connected from 'buster' as 'lauscher' - 'Lauscher'
2019-08-20 11:26:25,125 setting key repeat rate from client: 500ms delay / 37ms interval
2019-08-20 11:26:25,128 setting keymap:
2019-08-20 11:26:25,251 setting keyboard layout to 'de'
2019-08-20 11:26:25,544  uid=1000 (lauscher), gid=1000 (lauscher)
2019-08-20 11:26:25,556  running with pid 29320 on Linux Debian testing bullseye
2019-08-20 11:26:25,695  client root window size is 1920x1080 with 1 display:
2019-08-20 11:26:25,696   :0.0 (508x285 mm - DPI: 96x96) workarea: 1871x1045 at 49x35
2019-08-20 11:26:25,696     eDP (344x193 mm - DPI: 141x142)
2019-08-20 11:26:25,712 cannot find a temporary resolution for Xinerama workaround!
2019-08-20 11:26:25,717 server virtual display now set to 1920x1080
2019-08-20 11:26:25,730 send_initial_cursors() cursor_sizes=(22, (width=128, height=128))
2019-08-20 11:26:25,734  connected to X11 display :102 with 24 bit colors
2019-08-20 11:26:25,738 DPI set to 96 x 96
2019-08-20 11:26:25,747 get_cursor_image() cursor=[960, 540, 16, 16, 7, 7, 1, '1024 bytes', b'']
2019-08-20 11:26:25,747 get_cursor_data(): default cursor - clearing it
2019-08-20 11:26:25,749 client   1 @03.298 Xpra GTK3 X11 server version 3.0-r23522 64-bit
2019-08-20 11:26:25,749 send_empty_cursor(..)
2019-08-20 11:26:25,751 client   1 @03.301  running on Linux Debian testing bullseye
2019-08-20 11:26:25,766 client   1 @03.305 Attached to socket:///home/lauscher/.cache/x11docker/test-9317742/buster-102
2019-08-20 11:26:25,767 client   1 @03.306  (press Control-C to detach)
2019-08-20 11:26:25,855 client   1 @03.407 server does not support xi input devices
2019-08-20 11:26:25,856 client   1 @03.408  server uses: xtest
2019-08-20 11:26:26,036 New unix-domain connection received on /home/lauscher/.cache/x11docker/test-9317742/buster-102
2019-08-20 11:26:26,039 New unix-domain connection received on /home/lauscher/.cache/x11docker/test-9317742/buster-102
2019-08-20 11:26:33,782 cursor_event: <X11:CursorNotify {'send_event': '0', 'serial': '0x517', 'delivered_to': '<GdkX11.X11Window object at 0x7f37c99713c0 (GdkX11Window at 0x14fc320)>', 'window': '<GdkX11.X11Window object at 0x7f37c99713c0 (GdkX11Window at 0x14fc320)>', 'cursor_serial': '2', 'cursor_name': 'left_ptr'}>
2019-08-20 11:26:33,793 get_cursor_image() cursor=[960, 540, 24, 24, 4, 4, 2, '2304 bytes', b'left_ptr']
2019-08-20 11:26:33,794 do_send_cursor(..) pixels=LevelCompressed(cursor: 763 bytes as lz4/21)
2019-08-20 11:26:33,794 do_send_cursor(..) 24x24 raw cursor name='left_ptr', serial=0x2 with delay=10 (cursor_encodings=['raw'])
2019-08-20 11:26:39,681 cursor_event: <X11:CursorNotify {'send_event': '0', 'serial': '0xa83', 'delivered_to': '<GdkX11.X11Window object at 0x7f37c99713c0 (GdkX11Window at 0x14fc320)>', 'window': '<GdkX11.X11Window object at 0x7f37c99713c0 (GdkX11Window at 0x14fc320)>', 'cursor_serial': '3', 'cursor_name': 'xterm'}>
2019-08-20 11:26:39,693 get_cursor_image() cursor=[1316, 119, 24, 24, 11, 12, 3, '2304 bytes', b'xterm']
2019-08-20 11:26:39,694 do_send_cursor(..) pixels=LevelCompressed(cursor: 281 bytes as lz4/21)
2019-08-20 11:26:39,694 do_send_cursor(..) 24x24 raw cursor name='xterm', serial=0x3 with delay=10 (cursor_encodings=['raw'])
2019-08-20 11:26:46,208 cursor_event: <X11:CursorNotify {'send_event': '0', 'serial': '0x10a4', 'delivered_to': '<GdkX11.X11Window object at 0x7f37c99713c0 (GdkX11Window at 0x14fc320)>', 'window': '<GdkX11.X11Window object at 0x7f37c99713c0 (GdkX11Window at 0x14fc320)>', 'cursor_serial': '4', 'cursor_name': 'hand2'}>
2019-08-20 11:26:46,226 get_cursor_image() cursor=[1300, 803, 24, 24, 8, 5, 4, '2304 bytes', b'hand2']
2019-08-20 11:26:46,227 do_send_cursor(..) pixels=LevelCompressed(cursor: 826 bytes as lz4/21)
2019-08-20 11:26:46,227 do_send_cursor(..) 24x24 raw cursor name='hand2', serial=0x4 with delay=10 (cursor_encodings=['raw'])
2019-08-20 11:26:47,806 cursor_event: <X11:CursorNotify {'send_event': '0', 'serial': '0x12d2', 'delivered_to': '<GdkX11.X11Window object at 0x7f37c99713c0 (GdkX11Window at 0x14fc320)>', 'window': '<GdkX11.X11Window object at 0x7f37c99713c0 (GdkX11Window at 0x14fc320)>', 'cursor_serial': '2', 'cursor_name': 'left_ptr'}>
2019-08-20 11:26:47,825 get_cursor_image() cursor=[907, 775, 24, 24, 4, 4, 2, '2304 bytes', b'left_ptr']
2019-08-20 11:26:47,827 do_send_cursor(..) pixels=LevelCompressed(cursor: 763 bytes as lz4/21)
2019-08-20 11:26:47,828 do_send_cursor(..) 24x24 raw cursor name='left_ptr', serial=0x2 with delay=10 (cursor_encodings=['raw'])
2019-08-20 11:26:47,843 cursor_event: <X11:CursorNotify {'send_event': '0', 'serial': '0x12ea', 'delivered_to': '<GdkX11.X11Window object at 0x7f37c99713c0 (GdkX11Window at 0x14fc320)>', 'window': '<GdkX11.X11Window object at 0x7f37c99713c0 (GdkX11Window at 0x14fc320)>', 'cursor_serial': '3', 'cursor_name': 'xterm'}>
2019-08-20 11:26:47,883 get_cursor_image() cursor=[905, 775, 24, 24, 11, 12, 3, '2304 bytes', b'xterm']
2019-08-20 11:26:47,884 do_send_cursor(..) pixels=LevelCompressed(cursor: 281 bytes as lz4/21)
2019-08-20 11:26:47,885 do_send_cursor(..) 24x24 raw cursor name='xterm', serial=0x3 with delay=10 (cursor_encodings=['raw'])

Tue, 20 Aug 2019 12:54:50 GMT - Antoine Martin:

Well, that's interesting. The focus issue I'm seeing (pcmanfm showing slightly greyed out) occurs with all client + server combinations except with a python2 client + server. Could there be 2 bugs? Or maybe in the X11 bindings used by both the client and the server.

Here's the -d focus log output when clicking inside the file manager window:

client   1 @23.895 do_xpra_focus_in_event(<X11:FocusIn {'delivered_to': '0x3800075L', 'send_event': '0', 'detail': '3', 'window': '0x3800075L', 'mode': '0', 'serial': '0x2261'}>)
client   1 @23.896 focus-in-event for wid=2
client   1 @23.897 do_xpra_focus_in_event(<gtk.gdk.Event at 0x7f0551c7ed28: GDK_FOCUS_CHANGE>)
client   1 @23.898 GLClientWindow(2 : gtk2.GLDrawingArea(2, (1005, 762), None)) focus_change(GLClientWindow(2 : gtk2.GLDrawingArea(2, (1005, 762), None)), <GParamBoolean 'has-toplevel-focus'>) has-toplevel-focus=True, _been_mapped=True
client   1 @23.900 update_focus(2, True) focused=None, grabbed=None
client   1 @23.900 send_focus(2)
client   1 @23.901 recheck_focus() wid=2, focused=2, latest=True
process_focus: wid=2
focus wid=2 has_focus=0
focus: giving focus to WindowModel(0xc00007)
Giving focus to 0xc00007
... using XSetInputFocus
... using WM_TAKE_FOCUS
sending WM_TAKE_FOCUS: 0xc00007, X11 timestamp=15832800L
focus: will set modified mask to ('mod2',) using <bound method ClientConnection.make_keymask_match of ClientConnection(1 : Protocol(unix-domain socket:/run/user/1000/xpra/localhost.localdomain-2))>
world window lost focus: <gtk.gdk.Event at 0x7f32146f3d00: GDK_FOCUS_CHANGE>
focus_in_event(<X11:FocusIn {'delivered_to': '0xc00007L', 'send_event': '0', 'detail': '3', 'window': '0xc00007L', 'mode': '0', 'serial': '0x15e6'}>) mode=NotifyNormal, detail=NotifyNonlinear
focus_out_event(<X11:FocusOut {'delivered_to': '0xc00007L', 'send_event': '0', 'detail': '2', 'window': '0xc00007L', 'mode': '0', 'serial': '0x15eb'}>) mode=NotifyNormal, detail=NotifyInferior
client   1 @23.916 do_xpra_focus_out_event(<X11:FocusOut {'delivered_to': '0x3800075L', 'send_event': '0', 'detail': '2', 'window': '0x3800075L', 'mode': '0', 'serial': '0x2274'}>)
client   1 @23.918 do_xpra_focus_in_event(<X11:FocusIn {'delivered_to': '0x3800075L', 'send_event': '0', 'detail': '0', 'window': '0x3800075L', 'mode': '0', 'serial': '0x2274'}>)
client   1 @23.919 recheck_focus() wid=2, focused=2, latest=True

With a python3 client:

client   2 @14.567 focus-in-event for wid=2
client   2 @14.568 do_xpra_focus_in_event(<Gdk.EventFocus object at 0x7fba70752fb0 (void at 0x561e704eb5d0)>)
client   2 @14.569 GLClientWindow(2 : gtk3.GLDrawingArea(2, (1005, 762), None)) focus_change(GLClientWindow(2 : gtk3.GLDrawingArea(2, (1005, 762), None)), <GParamBoolean 'has-toplevel-focus'>) has-toplevel-focus=True, _been_mapped=True
client   2 @14.569 update_focus(2, True) focused=None, grabbed=None
client   2 @14.570 send_focus(2)
process_focus: wid=2
focus wid=2 has_focus=0
focus: giving focus to WindowModel(0xc00007)
Giving focus to 0xc00007
client   2 @14.573 recheck_focus() wid=2, focused=2, latest=True
... using XSetInputFocus
... using WM_TAKE_FOCUS
sending WM_TAKE_FOCUS: 0xc00007, X11 timestamp=16098494L
focus: will set modified mask to ('mod2',) using <bound method ClientConnection.make_keymask_match of ClientConnection(2 : Protocol(unix-domain socket:/run/user/1000/xpra/localhost.localdomain-2))>
world window lost focus: <gtk.gdk.Event at 0x7f32159ecb48: GDK_FOCUS_CHANGE>
focus_in_event(<X11:FocusIn {'delivered_to': '0xc00007L', 'send_event': '0', 'detail': '3', 'window': '0xc00007L', 'mode': '0', 'serial': '0x29c6'}>) mode=NotifyNormal, detail=NotifyNonlinear
focus_out_event(<X11:FocusOut {'delivered_to': '0xc00007L', 'send_event': '0', 'detail': '2', 'window': '0xc00007L', 'mode': '0', 'serial': '0x29cc'}>) mode=NotifyNormal, detail=NotifyInferior

So the only difference is that the python2 client ends up calling do_xpra_focus_out_event + do_xpra_focus_in_event + recheck_focus.

Starting with XPRA_X11_DEBUG_EVENTS=FocusIn,FocusOut python2 /usr/bin/xpra ..., the X11 focus events look like this:

client   1 @31.304 FocusOut event 0x1c70 : <X11:FocusOut {'delivered_to': '0x380007eL', 'send_event': '0', 'detail': '2', 'window': '0x380007eL', 'mode': '0', 'serial': '0x1c70'}>
client   1 @31.305   delivering event to window itself: 0x380007e  (signal=xpra-focus-out-event)
client   1 @31.305   forwarding event to a GLClientWindow window 0x380007e handler's xpra-focus-out-event signal
client   1 @31.306 do_xpra_focus_out_event(<X11:FocusOut {'delivered_to': '0x380007eL', 'send_event': '0', 'detail': '2', 'window': '0x380007eL', 'mode': '0', 'serial': '0x1c70'}>)
client   1 @31.307   forwarded
client   1 @31.307   no handler registered for catchall-signal (None), ignoring event
client   1 @31.308 FocusIn event 0x1c70 : <X11:FocusIn {'delivered_to': '0x380007eL', 'send_event': '0', 'detail': '0', 'window': '0x380007eL', 'mode': '0', 'serial': '0x1c70'}>
client   1 @31.309   delivering event to window itself: 0x380007e  (signal=xpra-focus-in-event)
client   1 @31.309   forwarding event to a GLClientWindow window 0x380007e handler's xpra-focus-in-event signal
client   1 @31.310 do_xpra_focus_in_event(<X11:FocusIn {'delivered_to': '0x380007eL', 'send_event': '0', 'detail': '0', 'window': '0x380007eL', 'mode': '0', 'serial': '0x1c70'}>)
client   1 @31.310   forwarded
client   1 @31.310   no handler registered for catchall-signal (None), ignoring event
client   1 @31.311 recheck_focus() wid=2, focused=2, latest=True

Looks like the X11 filter is not running with python3 / gtk3? Could be related to r23369, #812, #2342.


Tue, 20 Aug 2019 14:10:21 GMT - Antoine Martin:

With full x11 debug logging, the python2 client sees (amongst dozens of other X11 events):

parse_event(..)=<X11:FocusOut {'delivered_to': '0x3800063L', 'send_event': '0', 'detail': '3', 'window': '0x3800063L', 'mode': '0', 'serial': '0x93a'}>
FocusOut event 0x93a : <X11:FocusOut {'delivered_to': '0x3800063L', 'send_event': '0', 'detail': '3', 'window': '0x3800063L', 'mode': '0', 'serial': '0x93a'}>
  delivering event to window itself: 0x3800063  (signal=xpra-focus-out-event)
  forwarding event to a GLClientWindow window 0x3800063 handler's xpra-focus-out-event signal

Whereas the python3 / gtk3 client does not see any focus events...

We need to call X11Window.selectFocusChange with GTK3, this was not needed with GTK2. To do that and correctly register the gobject signals for focus events, we have to re-arrange the window class hierarchy a bit. And even then, I'm still getting the greyed out window..


Tue, 20 Aug 2019 14:10:58 GMT - Antoine Martin: attachment set

work in progress patch


Wed, 21 Aug 2019 08:49:04 GMT - Antoine Martin:

With the patch, the client debug shows:

So the key difference is that GTK2 gets a FocusIn event immediately after the FocusOut (that's why we have the recheck_focus() code), but GTK3 does not. This may be caused by the extra widget? Maybe we need to receive events on that?


Wed, 21 Aug 2019 12:09:16 GMT - Antoine Martin:

Adding extra debug, the missing FocusIn event is a detail=NotifyAncestor. According to 10.7.1 Normal Focus Events and Focus Events While Grabbed the only NotifyAncestor FocusIn event happens when When the focus moves from window A to window B, B is an inferior of A, and the pointer is in window P, the X server does the following: (...) It generates a FocusIn event on window B, with the detail member of the XFocusInEvent structure set to NotifyAncestor


Thu, 22 Aug 2019 01:30:01 GMT - Antoine Martin: priority changed

Looking at the window hierarchy:

So that's not it since python2 with opengl has the same structure: the window manager frame, the window, the widget (+ a 1x1 event window)

Raising priority has this has to be fixed before the release.


Thu, 22 Aug 2019 01:56:13 GMT - Antoine Martin:

r23556 adds a simple test case showing the differences in events received by the window when running under python2 + gtk2 vs python3 + gtk3.


Thu, 22 Aug 2019 06:47:35 GMT - Antoine Martin:

Summary of focus events received:

I believe we can drop the FocusOut: NotifyInferior since this is only sent when the focus goes to a sub-window (ie: the drawing area widget) - this is actually a better way of doing things than the current recheck_focus method. But that's not all... The "focus" is still incorrect with python3, the reason why the window shows up as greyed out is because the python2 client correctly sends a:

configure-window : ['configure-window', 1, 0, 71, 499, 316, {}, 0, {'focused': True}, True, 1, (347, 245), ('mod2',)]

There are many different types of focus... this one is part of the metadata and affects the _NET_WM_STATE, not the X11 focus!

And with python3, the property_changed code doesn't fire because the atom value is no longer a string with GTK3 (though it looks like one in the debug output..)

Client side fix on its way. Next... the server side, which has another bug!?


Thu, 22 Aug 2019 09:54:15 GMT - Antoine Martin: owner, status changed

Fixes in:

Backports in r23564 + r23565.

@mviereck: does that fix things for you? (updated beta buster packages are available)


Thu, 22 Aug 2019 10:58:01 GMT - mviereck:

@mviereck: does that fix things for you?

Unfortunately no. Tested with xpra v3.0-r23563. Same issues as before with pcmanfm on host and in container, and with firefox in container.

Meanwhile I found that I could reproduce the greyed-out effect with mousepad (GTK3, text editor of xfce). Its menu is still greyed out, too. But it behaves correctly after clicking into the menu the first time. Than the grey-out follows the window focus. With previous xpra versions it stayed to be grey. However, the full functionality of mousepad was and is given.

If I can provide debug logs or do any tests, please tell me.


Fri, 23 Aug 2019 05:16:42 GMT - Antoine Martin: owner, status changed

I have just found two more bugs related to focus (amazing how many bugs are lurking in this one seemingly small and simple area!):

I'll make some new builds shortly.

Are you running under wayland? Does it happen under Xorg? I did see some weirdness under weston. But then again, it doesn't seem ready for production use as I can crash the whole thing at will 100% reliably:

(gdb) bt
#0  0x00007fc1ab8d3609 in weston_surface_destroy () at /lib64/libweston-6.so.0
#1  0x00007fc1a7bf4d74 in  () at /usr/lib64/weston/desktop-shell.so
#2  0x00007fc1ab8b02d3 in wl_event_loop_dispatch_idle () at /lib64/libwayland-server.so.0
#3  0x00007fc1ab8b038a in wl_event_loop_dispatch () at /lib64/libwayland-server.so.0
#4  0x00007fc1ab8aef25 in wl_display_run () at /lib64/libwayland-server.so.0
#5  0x000055bf52f69e9f in  ()
#6  0x00007fc1ab66ef33 in __libc_start_main () at /lib64/libc.so.6
#7  0x000055bf52f6b02e in _start ()

Compare that to Xorg which is nearly impossible to crash from a userspace application... I'm not anti-wayland, but there is some way to go. And mixing the window manager with the display manager, as is done in all implementations, it just asking for trouble.


Fri, 23 Aug 2019 06:40:21 GMT - mviereck:

amazing how many bugs are lurking in this one seemingly small and simple area!

Good that you take it with some humor. :-)

Are you running under wayland? Does it happen under Xorg?

Xfce under Xorg. For Wayland tests I use a nested Weston or KWin running in an Xfce window.

Compare that to Xorg which is nearly impossible to crash from a userspace application...

Sometimes I manage to crash Weston, too. That's a no-go. And Gnome 3 has its own serious issues, under Xorg and Wayland as well.

I'm not anti-wayland, but there is some way to go. And mixing the window manager with the display manager, as is done in all implementations, it just asking for trouble.

I totally agree.


Fri, 23 Aug 2019 07:22:28 GMT - Antoine Martin:

New beta builds uploaded... For DEB only as a unit test is failing, and now I have to figure out what broke.


Fri, 23 Aug 2019 07:41:46 GMT - mviereck:

Now with xpra v3.0-r23570:


Fri, 23 Aug 2019 15:33:26 GMT - Antoine Martin:

now I have to figure out what broke.

r23571 fixes that: there is no "focused" state with GTK2, which is why we didn't have it until now.

I can reproduce the pointer issue with both firefox and pcmanfm, but only with a debian server, which makes it harder to work on. I thought it might be related to how we skip calling raise_window(), but forcing it does not help (see r23574). Using Firefox, if I click and drag over a link, the URL is shown. So something is behaving differently when the mouse buttons are pressed.


Fri, 23 Aug 2019 17:11:05 GMT - Antoine Martin: owner, status changed

One noticeable difference with the GTK3 server is how we are now missing the "motion-signal". So on a hunch, I switched from GTK to native calls for setting the client window's event mask: r23575. This seems to have fixed the problem on Debian bullseye. My guess is that the GTK version shipped in Debian removes some of the events in the mask.

New beta packages posted, including beta for "bullseye". @mviereck: can you still find something wrong with those builds?


Fri, 23 Aug 2019 17:32:04 GMT - mviereck:

@mviereck: can you still find something wrong with those builds?

Great! All issues are gone in xpra v3.0-r23575. firefox, mousepad and pcmanfm behave correctly in all setups.

My guess is that the GTK version shipped in Debian removes some of the events in the mask.

That's odd.

It should be possible to use GTK only instead of calling X11 directly. It is often recommended to use pure GTK3 or QT5 to be compatible with Wayland and X as well. I hope you'll find a solution. However, for now I am happy. Thank you! This was a hard one.


Sat, 24 Aug 2019 03:53:49 GMT - Antoine Martin: status changed; resolution set

Great! All issues are gone in xpra v3.0-r23575.

Closing at last! Thanks for your patience.

It should be possible to use GTK only instead of calling X11 directly.

For xpra, it tends to be the opposite: GTK made it easier to get things implemented originally but now is just getting in the way by adding an extra abstraction layer.

It is often recommended to use pure GTK3 or QT5 to be compatible with Wayland and X as well.

Wayland servers will require a complete rewrite of that low-level window layer anyway, likely in Cython since there aren't any viable or complete python bindings.


Tue, 15 Oct 2019 12:16:44 GMT - Antoine Martin:

Caused a regression: #2423


Tue, 03 Dec 2019 06:38:27 GMT - Antoine Martin:

And another regression on macos with opengl: #2491


Sat, 23 Jan 2021 05:50:01 GMT - migration script:

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