diff --git a/client/displayservers/Wayland/registry.c b/client/displayservers/Wayland/registry.c index 613edcd8..bc8045ad 100644 --- a/client/displayservers/Wayland/registry.c +++ b/client/displayservers/Wayland/registry.c @@ -71,6 +71,9 @@ static void registryGlobalHandler(void * data, struct wl_registry * registry, else if (!strcmp(interface, xdg_activation_v1_interface.name)) wlWm.xdgActivation = wl_registry_bind(wlWm.registry, name, &xdg_activation_v1_interface, 1); + else if (!strcmp(interface, wp_content_type_manager_v1_interface.name)) + wlWm.contentTypeManager = wl_registry_bind(wlWm.registry, name, + &wp_content_type_manager_v1_interface, 1); else if (wlWm.desktop->registryGlobalHandler( data, registry, name, interface, version)) return; diff --git a/client/displayservers/Wayland/wayland.h b/client/displayservers/Wayland/wayland.h index fc4da426..1c0b9367 100644 --- a/client/displayservers/Wayland/wayland.h +++ b/client/displayservers/Wayland/wayland.h @@ -48,6 +48,7 @@ #include "wayland-xdg-output-unstable-v1-client-protocol.h" #include "wayland-xdg-activation-v1-client-protocol.h" #include "wayland-fractional-scale-v1-client-protocol.h" +#include "wayland-content-type-v1-client-protocol.h" #include "scale.h" @@ -183,6 +184,9 @@ struct WaylandDSState struct wl_list surfaceOutputs; // SurfaceOutput::link bool useFractionalScale; + struct wp_content_type_manager_v1 * contentTypeManager; + struct wp_content_type_v1 * contentType; + LGEvent * frameEvent; struct wl_list poll; // WaylandPoll::link diff --git a/client/displayservers/Wayland/window.c b/client/displayservers/Wayland/window.c index 57aac61d..9e9f9d65 100644 --- a/client/displayservers/Wayland/window.c +++ b/client/displayservers/Wayland/window.c @@ -136,6 +136,13 @@ bool waylandWindowInit(const char * title, const char * appId, bool fullscreen, else wl_surface_add_listener(wlWm.surface, &wlSurfaceListener, NULL); + if (wlWm.contentTypeManager) + { + wlWm.contentType = wp_content_type_manager_v1_get_surface_content_type( + wlWm.contentTypeManager, wlWm.surface); + wp_content_type_v1_set_content_type(wlWm.contentType, WP_CONTENT_TYPE_V1_TYPE_GAME); + } + if (!wlWm.desktop->shellInit(wlWm.display, wlWm.surface, title, appId, fullscreen, maximize, borderless, resizable)) return false; @@ -148,6 +155,8 @@ void waylandWindowFree(void) { if (wlWm.fractionalScaleInterface) wp_fractional_scale_v1_destroy(wlWm.fractionalScaleInterface); + if (wlWm.contentType) + wp_content_type_v1_destroy(wlWm.contentType); wl_surface_destroy(wlWm.surface); lgFreeEvent(wlWm.frameEvent); }