From 95589fd4f84c60fe4441dcb9d9b3462eb6b1643f Mon Sep 17 00:00:00 2001 From: emersion Date: Sat, 10 Nov 2018 19:45:58 +0100 Subject: wayland: remove KDE server-decoration support --- video/out/wayland_common.c | 53 +++++++++++----------------------------------- 1 file changed, 12 insertions(+), 41 deletions(-) (limited to 'video/out/wayland_common.c') diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 1e0659fc8f..45071c8f35 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -35,9 +35,6 @@ // Generated from xdg-decoration-unstable-v1.xml #include "video/out/wayland/xdg-decoration-v1.h" -// Generated from server-decoration.xml -#include "video/out/wayland/srv-decor.h" - static void xdg_shell_ping(void *data, struct xdg_wm_base *shell, uint32_t serial) { xdg_wm_base_pong(shell, serial); @@ -826,10 +823,6 @@ static void registry_handle_add(void *data, struct wl_registry *reg, uint32_t id wl->dnd_devman = wl_registry_bind(reg, id, &wl_data_device_manager_interface, 3); } - if (!strcmp(interface, org_kde_kwin_server_decoration_manager_interface.name) && found++) { - wl->server_decoration_manager = wl_registry_bind(reg, id, &org_kde_kwin_server_decoration_manager_interface, 1); - } - if (!strcmp(interface, zxdg_decoration_manager_v1_interface.name) && found++) { wl->xdg_decoration_manager = wl_registry_bind(reg, id, &zxdg_decoration_manager_v1_interface, 1); } @@ -977,31 +970,19 @@ static int create_xdg_surface(struct vo_wayland_state *wl) static int set_border_decorations(struct vo_wayland_state *wl, int state) { - if (wl->xdg_toplevel_decoration) { - enum zxdg_toplevel_decoration_v1_mode mode; - if (state) { - MP_VERBOSE(wl, "Enabling server decorations\n"); - mode = ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE; - } else { - MP_VERBOSE(wl, "Disabling server decorations\n"); - mode = ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE; - } - zxdg_toplevel_decoration_v1_set_mode(wl->xdg_toplevel_decoration, mode); - return VO_TRUE; - } else if (wl->server_decoration) { - enum org_kde_kwin_server_decoration_mode mode; - if (state) { - MP_VERBOSE(wl, "Enabling server decorations\n"); - mode = ORG_KDE_KWIN_SERVER_DECORATION_MODE_SERVER; - } else { - MP_VERBOSE(wl, "Disabling server decorations\n"); - mode = ORG_KDE_KWIN_SERVER_DECORATION_MODE_NONE; - } - org_kde_kwin_server_decoration_request_mode(wl->server_decoration, mode); - return VO_TRUE; - } else { + if (!wl->xdg_toplevel_decoration) return VO_NOTIMPL; + + enum zxdg_toplevel_decoration_v1_mode mode; + if (state) { + MP_VERBOSE(wl, "Enabling server decorations\n"); + mode = ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE; + } else { + MP_VERBOSE(wl, "Disabling server decorations\n"); + mode = ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE; } + zxdg_toplevel_decoration_v1_set_mode(wl->xdg_toplevel_decoration, mode); + return VO_TRUE; } int vo_wayland_init(struct vo *vo) @@ -1059,12 +1040,8 @@ int vo_wayland_init(struct vo *vo) if (wl->xdg_decoration_manager) { wl->xdg_toplevel_decoration = zxdg_decoration_manager_v1_get_toplevel_decoration(wl->xdg_decoration_manager, wl->xdg_toplevel); set_border_decorations(wl, vo->opts->border); - } else if (wl->server_decoration_manager) { - wl->server_decoration = org_kde_kwin_server_decoration_manager_create(wl->server_decoration_manager, wl->surface); - set_border_decorations(wl, vo->opts->border); } else { - MP_VERBOSE(wl, "Compositor doesn't support the %s or %s protocols!\n", - org_kde_kwin_server_decoration_manager_interface.name, + MP_VERBOSE(wl, "Compositor doesn't support the %s protocol!\n", zxdg_decoration_manager_v1_interface.name); } @@ -1110,12 +1087,6 @@ void vo_wayland_uninit(struct vo *vo) if (wl->dnd_devman) wl_data_device_manager_destroy(wl->dnd_devman); - if (wl->server_decoration) - org_kde_kwin_server_decoration_destroy(wl->server_decoration); - - if (wl->server_decoration_manager) - org_kde_kwin_server_decoration_manager_destroy(wl->server_decoration_manager); - if (wl->xdg_toplevel_decoration) zxdg_toplevel_decoration_v1_destroy(wl->xdg_toplevel_decoration); -- cgit v1.2.3