diff options
Diffstat (limited to 'rootston')
-rw-r--r-- | rootston/input.c | 3 | ||||
-rw-r--r-- | rootston/output.c | 1 | ||||
-rw-r--r-- | rootston/seat.c | 27 | ||||
-rw-r--r-- | rootston/xdg_shell.c | 11 | ||||
-rw-r--r-- | rootston/xdg_shell_v6.c | 11 |
5 files changed, 43 insertions, 10 deletions
diff --git a/rootston/input.c b/rootston/input.c index 657b0946..3e1b06fb 100644 --- a/rootston/input.c +++ b/rootston/input.c @@ -2,10 +2,13 @@ #include <stdlib.h> #include <wayland-server.h> #include <wlr/backend/libinput.h> +#include <wlr/config.h> #include <wlr/types/wlr_cursor.h> #include <wlr/util/log.h> #include <wlr/xcursor.h> +#ifdef WLR_HAS_XWAYLAND #include <wlr/xwayland.h> +#endif #include "rootston/config.h" #include "rootston/input.h" #include "rootston/keyboard.h" diff --git a/rootston/output.c b/rootston/output.c index 8d6444d6..52ece54d 100644 --- a/rootston/output.c +++ b/rootston/output.c @@ -3,6 +3,7 @@ #include <stdbool.h> #include <stdlib.h> #include <time.h> +#include <wlr/config.h> #include <wlr/types/wlr_matrix.h> #include <wlr/types/wlr_compositor.h> #include <wlr/types/wlr_output_layout.h> diff --git a/rootston/seat.c b/rootston/seat.c index d2d211ba..bdcad5c7 100644 --- a/rootston/seat.c +++ b/rootston/seat.c @@ -723,6 +723,33 @@ void roots_seat_set_focus(struct roots_seat *seat, struct roots_view *view) { wl_list_insert(&seat->input->server->desktop->views, &view->link); } + + bool unfullscreen = true; + +#ifdef WLR_HAS_XWAYLAND + if (view && view->type == ROOTS_XWAYLAND_VIEW && + view->xwayland_surface->override_redirect) { + unfullscreen = false; + } +#endif + + if (view && unfullscreen) { + struct roots_desktop *desktop = view->desktop; + struct roots_output *output; + struct wlr_box box; + view_get_box(view, &box); + wl_list_for_each(output, &desktop->outputs, link) { + if (output->fullscreen_view && + output->fullscreen_view != view && + wlr_output_layout_intersects( + desktop->layout, + output->wlr_output, &box)) { + view_set_fullscreen(output->fullscreen_view, + false, NULL); + } + } + } + struct roots_view *prev_focus = roots_seat_get_focus(seat); if (view == prev_focus) { return; diff --git a/rootston/xdg_shell.c b/rootston/xdg_shell.c index 923fbeb4..62b57641 100644 --- a/rootston/xdg_shell.c +++ b/rootston/xdg_shell.c @@ -353,7 +353,7 @@ void handle_xdg_shell_surface(struct wl_listener *listener, void *data) { wl_container_of(listener, desktop, xdg_shell_surface); wlr_log(L_DEBUG, "new xdg toplevel: title=%s, app_id=%s", - surface->title, surface->app_id); + surface->toplevel->title, surface->toplevel->app_id); wlr_xdg_surface_ping(surface); struct roots_xdg_surface *roots_surface = @@ -371,15 +371,16 @@ void handle_xdg_shell_surface(struct wl_listener *listener, void *data) { roots_surface->unmap.notify = handle_unmap; wl_signal_add(&surface->events.unmap, &roots_surface->unmap); roots_surface->request_move.notify = handle_request_move; - wl_signal_add(&surface->events.request_move, &roots_surface->request_move); + wl_signal_add(&surface->toplevel->events.request_move, + &roots_surface->request_move); roots_surface->request_resize.notify = handle_request_resize; - wl_signal_add(&surface->events.request_resize, + wl_signal_add(&surface->toplevel->events.request_resize, &roots_surface->request_resize); roots_surface->request_maximize.notify = handle_request_maximize; - wl_signal_add(&surface->events.request_maximize, + wl_signal_add(&surface->toplevel->events.request_maximize, &roots_surface->request_maximize); roots_surface->request_fullscreen.notify = handle_request_fullscreen; - wl_signal_add(&surface->events.request_fullscreen, + wl_signal_add(&surface->toplevel->events.request_fullscreen, &roots_surface->request_fullscreen); roots_surface->new_popup.notify = handle_new_popup; wl_signal_add(&surface->events.new_popup, &roots_surface->new_popup); diff --git a/rootston/xdg_shell_v6.c b/rootston/xdg_shell_v6.c index 8d1a340e..11bc0180 100644 --- a/rootston/xdg_shell_v6.c +++ b/rootston/xdg_shell_v6.c @@ -355,7 +355,7 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) { wl_container_of(listener, desktop, xdg_shell_v6_surface); wlr_log(L_DEBUG, "new xdg toplevel: title=%s, app_id=%s", - surface->title, surface->app_id); + surface->toplevel->title, surface->toplevel->app_id); wlr_xdg_surface_v6_ping(surface); struct roots_xdg_surface_v6 *roots_surface = @@ -373,15 +373,16 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) { roots_surface->unmap.notify = handle_unmap; wl_signal_add(&surface->events.unmap, &roots_surface->unmap); roots_surface->request_move.notify = handle_request_move; - wl_signal_add(&surface->events.request_move, &roots_surface->request_move); + wl_signal_add(&surface->toplevel->events.request_move, + &roots_surface->request_move); roots_surface->request_resize.notify = handle_request_resize; - wl_signal_add(&surface->events.request_resize, + wl_signal_add(&surface->toplevel->events.request_resize, &roots_surface->request_resize); roots_surface->request_maximize.notify = handle_request_maximize; - wl_signal_add(&surface->events.request_maximize, + wl_signal_add(&surface->toplevel->events.request_maximize, &roots_surface->request_maximize); roots_surface->request_fullscreen.notify = handle_request_fullscreen; - wl_signal_add(&surface->events.request_fullscreen, + wl_signal_add(&surface->toplevel->events.request_fullscreen, &roots_surface->request_fullscreen); roots_surface->new_popup.notify = handle_new_popup; wl_signal_add(&surface->events.new_popup, &roots_surface->new_popup); |