From f6a09ef1a9b0a4f283be7bf52a7628c9aed199e1 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 7 Apr 2021 16:16:23 +0100 Subject: [PATCH] wayland: Drop support for kwin specific decoration management KWin has supported the shared and formalised zxdg_decoration since Plasma 5.16 which came out mid 2019. Whilst it made sense to support them both for a while, it should not be needed for future SDL releases. --- src/video/wayland/SDL_waylandvideo.c | 3 - src/video/wayland/SDL_waylandvideo.h | 1 - src/video/wayland/SDL_waylandwindow.c | 15 --- src/video/wayland/SDL_waylandwindow.h | 1 - ...org-kde-kwin-server-decoration-manager.xml | 94 ------------------- 5 files changed, 114 deletions(-) delete mode 100644 wayland-protocols/org-kde-kwin-server-decoration-manager.xml diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index 12203111e..b3b4691ac 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -49,7 +49,6 @@ #include "xdg-shell-client-protocol.h" #include "xdg-shell-unstable-v6-client-protocol.h" #include "xdg-decoration-unstable-v1-client-protocol.h" -#include "org-kde-kwin-server-decoration-manager-client-protocol.h" #include "keyboard-shortcuts-inhibit-unstable-v1-client-protocol.h" #include "idle-inhibit-unstable-v1-client-protocol.h" @@ -427,8 +426,6 @@ display_handle_global(void *data, struct wl_registry *registry, uint32_t id, d->data_device_manager = wl_registry_bind(d->registry, id, &wl_data_device_manager_interface, SDL_min(3, version)); } else if (strcmp(interface, "zxdg_decoration_manager_v1") == 0) { d->decoration_manager = wl_registry_bind(d->registry, id, &zxdg_decoration_manager_v1_interface, 1); - } else if (strcmp(interface, "org_kde_kwin_server_decoration_manager") == 0) { - d->kwin_server_decoration_manager = wl_registry_bind(d->registry, id, &org_kde_kwin_server_decoration_manager_interface, 1); #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH } else if (strcmp(interface, "qt_touch_extension") == 0) { diff --git a/src/video/wayland/SDL_waylandvideo.h b/src/video/wayland/SDL_waylandvideo.h index 867422440..7f5a60ae1 100644 --- a/src/video/wayland/SDL_waylandvideo.h +++ b/src/video/wayland/SDL_waylandvideo.h @@ -68,7 +68,6 @@ typedef struct { struct zwp_pointer_constraints_v1 *pointer_constraints; struct wl_data_device_manager *data_device_manager; struct zxdg_decoration_manager_v1 *decoration_manager; - struct org_kde_kwin_server_decoration_manager *kwin_server_decoration_manager; struct zwp_keyboard_shortcuts_inhibit_manager_v1 *key_inhibitor_manager; struct zwp_idle_inhibit_manager_v1 *idle_inhibit_manager; diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index e92aa4410..7f9031081 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -36,7 +36,6 @@ #include "xdg-shell-client-protocol.h" #include "xdg-shell-unstable-v6-client-protocol.h" #include "xdg-decoration-unstable-v1-client-protocol.h" -#include "org-kde-kwin-server-decoration-manager-client-protocol.h" #include "idle-inhibit-unstable-v1-client-protocol.h" static float get_window_scale_factor(SDL_Window *window) { @@ -673,9 +672,6 @@ Wayland_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) if ((viddata->decoration_manager) && (wind->server_decoration)) { const enum zxdg_toplevel_decoration_v1_mode mode = bordered ? ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE : ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE; zxdg_toplevel_decoration_v1_set_mode(wind->server_decoration, mode); - } else if ((viddata->kwin_server_decoration_manager) && (wind->kwin_server_decoration)) { - const enum org_kde_kwin_server_decoration_manager_mode mode = bordered ? ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_SERVER : ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_NONE; - org_kde_kwin_server_decoration_request_mode(wind->kwin_server_decoration, mode); } } @@ -866,13 +862,6 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window) const enum zxdg_toplevel_decoration_v1_mode mode = bordered ? ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE : ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE; zxdg_toplevel_decoration_v1_set_mode(data->server_decoration, mode); } - } else if (c->kwin_server_decoration_manager) { - data->kwin_server_decoration = org_kde_kwin_server_decoration_manager_create(c->kwin_server_decoration_manager, data->surface); - if (data->kwin_server_decoration) { - const SDL_bool bordered = (window->flags & SDL_WINDOW_BORDERLESS) == 0; - const enum org_kde_kwin_server_decoration_manager_mode mode = bordered ? ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_SERVER : ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_NONE; - org_kde_kwin_server_decoration_request_mode(data->kwin_server_decoration, mode); - } } region = wl_compositor_create_region(c->compositor); @@ -1054,10 +1043,6 @@ void Wayland_DestroyWindow(_THIS, SDL_Window *window) zxdg_toplevel_decoration_v1_destroy(wind->server_decoration); } - if (wind->kwin_server_decoration) { - org_kde_kwin_server_decoration_release(wind->kwin_server_decoration); - } - if (wind->idle_inhibitor) { zwp_idle_inhibitor_v1_destroy(wind->idle_inhibitor); } diff --git a/src/video/wayland/SDL_waylandwindow.h b/src/video/wayland/SDL_waylandwindow.h index 1545655a4..892be167a 100644 --- a/src/video/wayland/SDL_waylandwindow.h +++ b/src/video/wayland/SDL_waylandwindow.h @@ -64,7 +64,6 @@ typedef struct { EGLSurface egl_surface; struct zwp_locked_pointer_v1 *locked_pointer; struct zxdg_toplevel_decoration_v1 *server_decoration; - struct org_kde_kwin_server_decoration *kwin_server_decoration; struct zwp_keyboard_shortcuts_inhibitor_v1 *key_inhibitor; struct zwp_idle_inhibitor_v1 *idle_inhibitor; diff --git a/wayland-protocols/org-kde-kwin-server-decoration-manager.xml b/wayland-protocols/org-kde-kwin-server-decoration-manager.xml deleted file mode 100644 index 8bc106c7c..000000000 --- a/wayland-protocols/org-kde-kwin-server-decoration-manager.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - . - ]]> - - - This interface allows to coordinate whether the server should create - a server-side window decoration around a wl_surface representing a - shell surface (wl_shell_surface or similar). By announcing support - for this interface the server indicates that it supports server - side decorations. - - - - When a client creates a server-side decoration object it indicates - that it supports the protocol. The client is supposed to tell the - server whether it wants server-side decorations or will provide - client-side decorations. - - If the client does not create a server-side decoration object for - a surface the server interprets this as lack of support for this - protocol and considers it as client-side decorated. Nevertheless a - client-side decorated surface should use this protocol to indicate - to the server that it does not want a server-side deco. - - - - - - - - - - - - - This event is emitted directly after binding the interface. It contains - the default mode for the decoration. When a new server decoration object - is created this new object will be in the default mode until the first - request_mode is requested. - - The server may change the default mode at any time. - - - - - - - - - - - - - - - - - - - - - This event is emitted directly after the decoration is created and - represents the base decoration policy by the server. E.g. a server - which wants all surfaces to be client-side decorated will send Client, - a server which wants server-side decoration will send Server. - - The client can request a different mode through the decoration request. - The server will acknowledge this by another event with the same mode. So - even if a server prefers server-side decoration it's possible to force a - client-side decoration. - - The server may emit this event at any time. In this case the client can - again request a different mode. It's the responsibility of the server to - prevent a feedback loop. - - - - -