diff options
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r-- | sway/desktop/xwayland.c | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 7c5dde53..40288f97 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -6,7 +6,6 @@ #include <wlr/types/wlr_output_layout.h> #include <wlr/types/wlr_output.h> #include <wlr/xwayland.h> -#include <xcb/xcb_icccm.h> #include "log.h" #include "sway/desktop.h" #include "sway/desktop/transaction.h" @@ -122,20 +121,6 @@ static void unmanaged_handle_unmap(struct wl_listener *listener, void *data) { } } -static void unmanaged_handle_request_activate(struct wl_listener *listener, void *data) { - struct wlr_xwayland_surface *xsurface = data; - if (!xsurface->mapped) { - return; - } - struct sway_seat *seat = input_manager_current_seat(); - struct sway_container *focus = seat_get_focused_container(seat); - if (focus && focus->view && focus->view->pid != xsurface->pid) { - return; - } - - seat_set_focus_surface(seat, xsurface->surface, false); -} - static void unmanaged_handle_destroy(struct wl_listener *listener, void *data) { struct sway_xwayland_unmanaged *surface = wl_container_of(listener, surface, destroy); @@ -144,7 +129,6 @@ static void unmanaged_handle_destroy(struct wl_listener *listener, void *data) { wl_list_remove(&surface->unmap.link); wl_list_remove(&surface->destroy.link); wl_list_remove(&surface->override_redirect.link); - wl_list_remove(&surface->request_activate.link); free(surface); } @@ -192,8 +176,6 @@ static struct sway_xwayland_unmanaged *create_unmanaged( surface->destroy.notify = unmanaged_handle_destroy; wl_signal_add(&xsurface->events.set_override_redirect, &surface->override_redirect); surface->override_redirect.notify = unmanaged_handle_override_redirect; - wl_signal_add(&xsurface->events.request_activate, &surface->request_activate); - surface->request_activate.notify = unmanaged_handle_request_activate; return surface; } @@ -312,7 +294,7 @@ static bool wants_floating(struct sway_view *view) { } } - xcb_size_hints_t *size_hints = surface->size_hints; + struct wlr_xwayland_surface_size_hints *size_hints = surface->size_hints; if (size_hints != NULL && size_hints->min_width > 0 && size_hints->min_height > 0 && (size_hints->max_width == size_hints->min_width || @@ -366,7 +348,7 @@ static void destroy(struct sway_view *view) { static void get_constraints(struct sway_view *view, double *min_width, double *max_width, double *min_height, double *max_height) { struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface; - xcb_size_hints_t *size_hints = surface->size_hints; + struct wlr_xwayland_surface_size_hints *size_hints = surface->size_hints; if (size_hints == NULL) { *min_width = DBL_MIN; @@ -595,8 +577,7 @@ static void handle_request_move(struct wl_listener *listener, void *data) { if (!xsurface->mapped) { return; } - if (!container_is_floating(view->container) || - view->container->pending.fullscreen_mode) { + if (!container_is_floating(view->container)) { return; } struct sway_seat *seat = input_manager_current_seat(); @@ -685,15 +666,14 @@ static void handle_set_hints(struct wl_listener *listener, void *data) { if (!xsurface->mapped) { return; } - const bool hints_urgency = xcb_icccm_wm_hints_get_urgency(xsurface->hints); - if (!hints_urgency && view->urgent_timer) { + if (!xsurface->hints_urgency && view->urgent_timer) { // The view is in the timeout period. We'll ignore the request to // unset urgency so that the view remains urgent until the timer clears // it. return; } if (view->allow_request_urgent) { - view_set_urgent(view, hints_urgency); + view_set_urgent(view, (bool)xsurface->hints_urgency); } } |