[client] wayland: set content type to game
Some checks are pending
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / module (push) Waiting to run
build / host-linux (push) Waiting to run
build / host-windows-cross (push) Waiting to run
build / host-windows-native (push) Waiting to run
build / idd (push) Waiting to run
build / obs (clang) (push) Waiting to run
build / obs (gcc) (push) Waiting to run
build / docs (push) Waiting to run

This commit is contained in:
Quantum
2026-06-06 16:26:33 -04:00
committed by Geoffrey McRae
parent 8d7b45e240
commit e203bca480
3 changed files with 16 additions and 0 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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);
}