diff options
author | sghctoma <sghctoma@gmail.com> | 2018-09-03 08:57:17 +0200 |
---|---|---|
committer | sghctoma <sghctoma@gmail.com> | 2018-09-03 08:57:17 +0200 |
commit | df730a88919b078093dbc322926ada219a60d036 (patch) | |
tree | f2837f24092c7be5dfccdf448e47062cb5718549 /sway/desktop/xwayland.c | |
parent | 67188b7cba2a985926647e049ed32c72b6ee98c8 (diff) | |
parent | c9276f04c9fae7a211164003bc9cb8b4369db5fd (diff) |
Merge remote-tracking branch 'upstream/master' into fix-freebsd-build
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r-- | sway/desktop/xwayland.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 4e401008..10faf91d 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -17,6 +17,7 @@ #include "sway/tree/view.h" static const char *atom_map[ATOM_LAST] = { + "_NET_WM_WINDOW_TYPE_NORMAL", "_NET_WM_WINDOW_TYPE_DIALOG", "_NET_WM_WINDOW_TYPE_UTILITY", "_NET_WM_WINDOW_TYPE_TOOLBAR", @@ -217,7 +218,9 @@ static bool wants_floating(struct sway_view *view) { struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface; struct sway_xwayland *xwayland = &server.xwayland; - // TODO: return true if the NET_WM_STATE is MODAL + if (surface->modal) { + return true; + } for (size_t i = 0; i < surface->window_type_len; ++i) { xcb_atom_t type = surface->window_type[i]; @@ -334,6 +337,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) { wl_list_remove(&xwayland_view->request_fullscreen.link); wl_list_remove(&xwayland_view->request_move.link); wl_list_remove(&xwayland_view->request_resize.link); + wl_list_remove(&xwayland_view->request_activate.link); wl_list_remove(&xwayland_view->set_title.link); wl_list_remove(&xwayland_view->set_class.link); wl_list_remove(&xwayland_view->set_window_type.link); @@ -460,6 +464,19 @@ static void handle_request_resize(struct wl_listener *listener, void *data) { seat_begin_resize_floating(seat, view->swayc, seat->last_button, e->edges); } +static void handle_request_activate(struct wl_listener *listener, void *data) { + struct sway_xwayland_view *xwayland_view = + wl_container_of(listener, xwayland_view, request_activate); + struct sway_view *view = &xwayland_view->view; + struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; + if (!xsurface->mapped) { + return; + } + view_request_activate(view); + + transaction_commit_dirty(); +} + static void handle_set_title(struct wl_listener *listener, void *data) { struct sway_xwayland_view *xwayland_view = wl_container_of(listener, xwayland_view, set_title); @@ -552,6 +569,10 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) { &xwayland_view->request_fullscreen); xwayland_view->request_fullscreen.notify = handle_request_fullscreen; + wl_signal_add(&xsurface->events.request_activate, + &xwayland_view->request_activate); + xwayland_view->request_activate.notify = handle_request_activate; + wl_signal_add(&xsurface->events.request_move, &xwayland_view->request_move); xwayland_view->request_move.notify = handle_request_move; |