@@ -296,6 +296,62 @@ if have_wayland
296296 clutter_backend_private_headers += clutter_wayland_private_headers
297297endif
298298
299+ if have_wayland_client
300+ # Generate Wayland client protocols
301+ wayland_scanner = find_program (' wayland-scanner' )
302+ wayland_protocols_dir = wayland_protocols_dep.get_variable (pkgconfig : ' pkgdatadir' )
303+
304+ # xdg-shell protocol (required by layer-shell)
305+ xdg_shell_xml = join_paths (wayland_protocols_dir, ' stable' , ' xdg-shell' , ' xdg-shell.xml' )
306+
307+ xdg_shell_client_header = custom_target (' xdg-shell-client-protocol.h' ,
308+ input : xdg_shell_xml,
309+ output : ' xdg-shell-client-protocol.h' ,
310+ command : [wayland_scanner, ' client-header' , ' @INPUT@' , ' @OUTPUT@' ],
311+ )
312+
313+ xdg_shell_protocol_code = custom_target (' xdg-shell-protocol.c' ,
314+ input : xdg_shell_xml,
315+ output : ' xdg-shell-protocol.c' ,
316+ command : [wayland_scanner, ' private-code' , ' @INPUT@' , ' @OUTPUT@' ],
317+ )
318+
319+ # layer-shell protocol
320+ layer_shell_xml = files (' wayland-client/wlr-layer-shell-unstable-v1.xml' )
321+
322+ layer_shell_client_header = custom_target (' wlr-layer-shell-client-protocol.h' ,
323+ input : layer_shell_xml,
324+ output : ' wlr-layer-shell-unstable-v1-client-protocol.h' ,
325+ command : [wayland_scanner, ' client-header' , ' @INPUT@' , ' @OUTPUT@' ],
326+ )
327+
328+ layer_shell_protocol_code = custom_target (' wlr-layer-shell-protocol.c' ,
329+ input : layer_shell_xml,
330+ output : ' wlr-layer-shell-unstable-v1-protocol.c' ,
331+ command : [wayland_scanner, ' private-code' , ' @INPUT@' , ' @OUTPUT@' ],
332+ )
333+
334+ clutter_wayland_client_sources = [
335+ ' wayland-client/clutter-backend-wayland-client.c' ,
336+ ' wayland-client/clutter-stage-wayland-client.c' ,
337+ ' wayland-client/clutter-seat-wayland-client.c' ,
338+ ' wayland-client/clutter-keymap-wayland-client.c' ,
339+ xdg_shell_protocol_code,
340+ layer_shell_protocol_code,
341+ ]
342+ clutter_backend_sources += clutter_wayland_client_sources
343+
344+ clutter_wayland_client_private_headers = [
345+ ' wayland-client/clutter-backend-wayland-client.h' ,
346+ ' wayland-client/clutter-stage-wayland-client.h' ,
347+ ' wayland-client/clutter-seat-wayland-client.h' ,
348+ ' wayland-client/clutter-keymap-wayland-client.h' ,
349+ xdg_shell_client_header,
350+ layer_shell_client_header,
351+ ]
352+ clutter_backend_private_headers += clutter_wayland_client_private_headers
353+ endif
354+
299355cally_headers = [
300356 ' cally/cally-actor.h' ,
301357 ' cally/cally-clone.h' ,
@@ -334,6 +390,7 @@ cdata = configuration_data()
334390cdata.set_quoted(' MUFFIN_VERSION' , meson .project_version())
335391cdata.set(' CLUTTER_DRIVERS' , ' "*"' )
336392cdata.set(' HAVE_EVDEV' , have_native_backend)
393+ cdata.set(' HAVE_WAYLAND_CLIENT' , have_wayland_client)
337394cdata.set(' HAVE_LIBWACOM' , have_libwacom)
338395cdata.set(' HAVE_PANGO_FT2' , have_pango_ft2)
339396
@@ -364,6 +421,11 @@ if have_native_backend
364421 ' #define CLUTTER_INPUT_EVDEV "evdev"' ,
365422 ]
366423endif
424+ if have_wayland_client
425+ clutter_config_defines += [
426+ ' #define CLUTTER_WINDOWING_WAYLAND_CLIENT "wayland-client"' ,
427+ ]
428+ endif
367429clutter_config_defines += [
368430 ' #define CLUTTER_INPUT_NULL "null"' ,
369431]
0 commit comments