#include "libds/log.h"
+#include "util.h"
#include "subcompositor.h"
#include "surface.h"
#include "region.h"
struct wl_resource *resource;
resource = wl_resource_create(client, &wl_compositor_interface,
- version, id);
+ DS_MIN((int)version, COMPOSITOR_VERSION), id);
if (resource == NULL) {
wl_client_post_no_memory(client);
return;
#include <wayland-server.h>
#include "libds/log.h"
+#include "util.h"
#include "data_device_private.h"
#define DATA_DEVICE_MANAGER_VERSION 3
struct wl_resource *resource;
resource = wl_resource_create(client, &wl_data_device_manager_interface,
- version, id);
+ DS_MIN((int)version, DATA_DEVICE_MANAGER_VERSION), id);
if (!resource) {
wl_client_post_no_memory(client);
return;
struct ds_output *output = data;
struct wl_resource *resource;
- resource = wl_resource_create(client, &wl_output_interface, version, id);
+ resource = wl_resource_create(client, &wl_output_interface,
+ DS_MIN((int)version, OUTPUT_VERSION), id);
if (!resource) {
wl_client_post_no_memory(client);
return;
struct wl_resource *resource;
resource = wl_resource_create(client, &wp_presentation_interface,
- version, id);
+ DS_MIN((int)version, PRESENTATION_VERSION), id);
if (!resource) {
wl_client_post_no_memory(client);
return;
struct ds_seat_client *seat_client;
struct wl_resource *resource;
- resource = wl_resource_create(wl_client, &wl_seat_interface, version, id);
+ resource = wl_resource_create(wl_client, &wl_seat_interface,
+ DS_MIN((int)version, SEAT_VERSION), id);
if (!resource) {
wl_client_post_no_memory(wl_client);
return;
#include "libds/log.h"
#include "libds/shell.h"
+#include "util.h"
#include "shell.h"
#define WL_SHELL_VERSION 1
wl_list_init(&client->shell_surfaces);
- client->resource =
- wl_resource_create(wl_client, &wl_shell_interface, version, id);
+ client->resource = wl_resource_create(wl_client, &wl_shell_interface,
+ DS_MIN((int)version, WL_SHELL_VERSION), id);
if (client->resource == NULL) {
free(client);
wl_client_post_no_memory(wl_client);
#include "libds/log.h"
+#include "util.h"
#include "subcompositor.h"
#include "surface.h"
struct ds_subcompositor *subcomp = data;
struct wl_resource *resource;
- resource = wl_resource_create(client, &wl_subcompositor_interface, 1, id);
+ resource = wl_resource_create(client, &wl_subcompositor_interface,
+ DS_MIN((int)version, SUBCOMPOSITOR_VERSION), id);
if (resource == NULL) {
wl_client_post_no_memory(client);
return;
#include "libds/log.h"
#include "libds/xdg_shell.h"
+#include "util.h"
#include "xdg_shell.h"
#define XDG_WM_BASE_VERSION 2
wl_list_init(&client->surfaces);
- client->resource =
- wl_resource_create(wl_client, &xdg_wm_base_interface, version, id);
+ client->resource = wl_resource_create(wl_client, &xdg_wm_base_interface,
+ DS_MIN((int)version, XDG_WM_BASE_VERSION), id);
if (client->resource == NULL) {
free(client);
wl_client_post_no_memory(wl_client);
#include "libds/log.h"
#include "libds/xdg_shell_v6.h"
+#include "util.h"
#include "xdg_shell_v6.h"
#define XDG_SHELL_V6_BASE_VERSION 1
wl_list_init(&client->surfaces);
- client->resource =
- wl_resource_create(wl_client, &zxdg_shell_v6_interface, version, id);
+ client->resource = wl_resource_create(wl_client, &zxdg_shell_v6_interface,
+ DS_MIN((int)version, XDG_SHELL_V6_BASE_VERSION), id);
if (client->resource == NULL) {
free(client);
wl_client_post_no_memory(wl_client);