Skip to content

3 issues encountered with GTk3 apps using the wayland GDK backend #20

@RJVB

Description

@RJVB

Continued from issue #13 ...

I've built Owl and also managed to build GTk3 with the Wayland backend. I notice 2 things:

  1. GTk3 uses wl_pointer_add_listener() to get pointer events, notably clicks. Some clicks do come through but for the most part it is as if there are no mouse events being transmitted. At least the button click handler doesn't appear to be called at all.

  2. When I try to open a menu in any GTk3 application the compositor aborts under wl_invoke_closure() because there's a NULL listener for "opcode 1" in xdg_wm_base (whatever that means). When I skip the abort and simply don't do the callback the compositor survives but the client is terminated with an error instead of a crash - which I find much preferable.

  3. After testing this menu-related failure a few time I witnessed this error (for a 2nd time):

2025-03-06 02:13:30.214 Owl[38330:d07] Running compositor on Wayland display wayland-0
2025-03-06 02:13:30.215 Owl[38330:d07] Checked in with the bootstrap server as io.github.bugaevc.Owl
listener function for opcode 1 of xdg_wm_base is NULL
error in client communication (pid 38334)
listener function for opcode 1 of xdg_wm_base is NULL
error in client communication (pid 38379)
listener function for opcode 1 of xdg_wm_base is NULL
error in client communication (pid 38408)
Buffer address requested when its parent pool has an external reference and a deferred resize pending.
2025-03-06 02:14:59.978 Owl[38330:d07] Unknown shm format
Owl(38330,0x7fff746e2310) malloc: *** mach_vm_map(size=18392700977636450304) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug

with backtrace

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libwayland-server.0.dylib     	0x00000001048ed2eb wl_shm_buffer_begin_access + 11 (wayland-shm.c:637)
1   io.github.bugaevc.Owl         	0x00000001048a52c7 -[OwlShmBuffer invalidate] + 167 (OwlShmBuffer.m:74)
2   libffi.8.dylib                	0x0000000104925052 ffi_call_unix64 + 82
3   libffi.8.dylib                	0x0000000104929ba7 ffi_call_int.llvm.BC09A206 + 807
4   libwayland-server.0.dylib     	0x00000001048efc14 wl_closure_invoke + 596
5   libwayland-server.0.dylib     	0x00000001048eae4b wl_client_connection_data + 523 (wayland-server.c:445)
6   libwayland-server.0.dylib     	0x00000001048ede8b wl_event_loop_dispatch + 123
7   io.github.bugaevc.Owl         	0x00000001048aaf71 socketCallback + 17 (OwlRunLoopSource.m:49)
8   com.apple.CoreFoundation      	0x00007fff8ed04057 __CFSocketPerformV0 + 855

Not an Owl issue but for completeness: using OpenGL will probably require building Mesa with both EGL and Wayland support. Or would it require going through Apple's OpenGL instead?? Anyone got an idea about that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions