From a5c07dde6aba87584ddb6c6a2769472a6003623a Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 28 Apr 2017 20:32:05 -0400 Subject: Implement KDE's server-side decoration protocol --- sway/handlers.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sway/handlers.c') diff --git a/sway/handlers.c b/sway/handlers.c index da765d6d..0aa35c26 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -345,6 +345,8 @@ static bool handle_view_created(wlc_handle handle) { swayc_t *current_ws = swayc_active_workspace(); bool return_to_workspace = false; struct wl_client *client = wlc_view_get_wl_client(handle); + struct wl_resource *resource = wlc_surface_get_wl_resource( + wlc_view_get_surface(handle)); pid_t pid; struct panel_config *panel_config = NULL; struct background_config *background_config = NULL; @@ -483,6 +485,14 @@ static bool handle_view_created(wlc_handle handle) { if (workspace && workspace->fullscreen) { set_focused_container(workspace->fullscreen); } + for (int i = 0; i < decoration_state.csd_resources->length; ++i) { + struct wl_resource *res = decoration_state.csd_resources->items[i]; + if (res == resource) { + list_del(decoration_state.csd_resources, i); + server_decoration_enable_csd(handle); + break; + } + } } else { swayc_t *output = swayc_parent_by_type(focused, C_OUTPUT); wlc_handle *h = malloc(sizeof(wlc_handle)); -- cgit v1.2.3