aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/xdg_shell_v6.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/xdg_shell_v6.c')
-rw-r--r--sway/desktop/xdg_shell_v6.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index 175416f3..b23d4577 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -10,10 +10,12 @@
#include "sway/desktop/transaction.h"
#include "sway/input/input-manager.h"
#include "sway/input/seat.h"
+#include "sway/output.h"
#include "sway/server.h"
#include "sway/tree/arrange.h"
#include "sway/tree/container.h"
#include "sway/tree/view.h"
+#include "sway/tree/workspace.h"
static const struct sway_view_child_impl popup_impl;
@@ -51,15 +53,15 @@ static void popup_unconstrain(struct sway_xdg_popup_v6 *popup) {
struct sway_view *view = popup->child.view;
struct wlr_xdg_popup_v6 *wlr_popup = popup->wlr_xdg_surface_v6->popup;
- struct sway_container *output = container_parent(view->swayc, C_OUTPUT);
+ struct sway_output *output = view->container->workspace->output;
// the output box expressed in the coordinate system of the toplevel parent
// of the popup
struct wlr_box output_toplevel_sx_box = {
- .x = output->x - view->x,
- .y = output->y - view->y,
- .width = output->width,
- .height = output->height,
+ .x = output->wlr_output->lx - view->x,
+ .y = output->wlr_output->ly - view->y,
+ .width = output->wlr_output->width,
+ .height = output->wlr_output->height,
};
wlr_xdg_popup_v6_unconstrain_from_box(wlr_popup, &output_toplevel_sx_box);
@@ -249,11 +251,7 @@ static void handle_commit(struct wl_listener *listener, void *data) {
struct sway_view *view = &xdg_shell_v6_view->view;
struct wlr_xdg_surface_v6 *xdg_surface_v6 = view->wlr_xdg_surface_v6;
- if (!view->swayc) {
- return;
- }
-
- if (view->swayc->instruction) {
+ if (view->container->node.instruction) {
wlr_xdg_surface_v6_get_geometry(xdg_surface_v6, &view->geometry);
transaction_notify_view_ready_by_serial(view,
xdg_surface_v6->configure_serial);
@@ -262,7 +260,7 @@ static void handle_commit(struct wl_listener *listener, void *data) {
wlr_xdg_surface_v6_get_geometry(xdg_surface_v6, &new_geo);
if ((new_geo.width != view->width || new_geo.height != view->height) &&
- container_is_floating(view->swayc)) {
+ container_is_floating(view->container)) {
// A floating view has unexpectedly sent a new size
desktop_damage_view(view);
view_update_size(view, new_geo.width, new_geo.height);
@@ -316,10 +314,9 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data)
return;
}
- container_set_fullscreen(view->swayc, e->fullscreen);
+ container_set_fullscreen(view->container, e->fullscreen);
- struct sway_container *output = container_parent(view->swayc, C_OUTPUT);
- arrange_windows(output);
+ arrange_workspace(view->container->workspace);
transaction_commit_dirty();
}
@@ -327,13 +324,13 @@ static void handle_request_move(struct wl_listener *listener, void *data) {
struct sway_xdg_shell_v6_view *xdg_shell_v6_view =
wl_container_of(listener, xdg_shell_v6_view, request_move);
struct sway_view *view = &xdg_shell_v6_view->view;
- if (!container_is_floating(view->swayc)) {
+ if (!container_is_floating(view->container)) {
return;
}
struct wlr_xdg_toplevel_v6_move_event *e = data;
struct sway_seat *seat = e->seat->seat->data;
if (e->serial == seat->last_button_serial) {
- seat_begin_move(seat, view->swayc, seat->last_button);
+ seat_begin_move(seat, view->container, seat->last_button);
}
}
@@ -341,13 +338,13 @@ static void handle_request_resize(struct wl_listener *listener, void *data) {
struct sway_xdg_shell_v6_view *xdg_shell_v6_view =
wl_container_of(listener, xdg_shell_v6_view, request_resize);
struct sway_view *view = &xdg_shell_v6_view->view;
- if (!container_is_floating(view->swayc)) {
+ if (!container_is_floating(view->container)) {
return;
}
struct wlr_xdg_toplevel_v6_resize_event *e = data;
struct sway_seat *seat = e->seat->seat->data;
if (e->serial == seat->last_button_serial) {
- seat_begin_resize_floating(seat, view->swayc,
+ seat_begin_resize_floating(seat, view->container,
seat->last_button, e->edges);
}
}
@@ -396,11 +393,14 @@ static void handle_map(struct wl_listener *listener, void *data) {
view_map(view, view->wlr_xdg_surface_v6->surface);
if (xdg_surface->toplevel->client_pending.fullscreen) {
- container_set_fullscreen(view->swayc, true);
- struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
- arrange_windows(ws);
+ container_set_fullscreen(view->container, true);
+ arrange_workspace(view->container->workspace);
} else {
- arrange_windows(view->swayc->parent);
+ if (view->container->parent) {
+ arrange_container(view->container->parent);
+ } else {
+ arrange_workspace(view->container->workspace);
+ }
}
transaction_commit_dirty();