summaryrefslogtreecommitdiffstats
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.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index c1adc7fe..49305b39 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -30,23 +30,18 @@ static const char *get_prop(struct sway_view *view, enum sway_view_prop prop) {
30 } 30 }
31} 31}
32 32
33static void set_size(struct sway_view *view, int width, int height) { 33static void configure(struct sway_view *view, double ox, double oy, int width,
34 int height) {
34 if (!assert_xdg(view)) { 35 if (!assert_xdg(view)) {
35 return; 36 return;
36 } 37 }
38
39 view_update_position(view, ox, oy);
37 view->sway_xdg_surface_v6->pending_width = width; 40 view->sway_xdg_surface_v6->pending_width = width;
38 view->sway_xdg_surface_v6->pending_height = height; 41 view->sway_xdg_surface_v6->pending_height = height;
39 wlr_xdg_toplevel_v6_set_size(view->wlr_xdg_surface_v6, width, height); 42 wlr_xdg_toplevel_v6_set_size(view->wlr_xdg_surface_v6, width, height);
40} 43}
41 44
42static void set_position(struct sway_view *view, double ox, double oy) {
43 if (!assert_xdg(view)) {
44 return;
45 }
46 view->swayc->x = ox;
47 view->swayc->y = oy;
48}
49
50static void set_activated(struct sway_view *view, bool activated) { 45static void set_activated(struct sway_view *view, bool activated) {
51 if (!assert_xdg(view)) { 46 if (!assert_xdg(view)) {
52 return; 47 return;
@@ -57,7 +52,7 @@ static void set_activated(struct sway_view *view, bool activated) {
57 } 52 }
58} 53}
59 54
60static void close(struct sway_view *view) { 55static void _close(struct sway_view *view) {
61 if (!assert_xdg(view)) { 56 if (!assert_xdg(view)) {
62 return; 57 return;
63 } 58 }
@@ -69,10 +64,9 @@ static void close(struct sway_view *view) {
69 64
70static const struct sway_view_impl view_impl = { 65static const struct sway_view_impl view_impl = {
71 .get_prop = get_prop, 66 .get_prop = get_prop,
72 .set_size = set_size, 67 .configure = configure,
73 .set_position = set_position,
74 .set_activated = set_activated, 68 .set_activated = set_activated,
75 .close = close, 69 .close = _close,
76}; 70};
77 71
78static void handle_commit(struct wl_listener *listener, void *data) { 72static void handle_commit(struct wl_listener *listener, void *data) {
@@ -82,8 +76,8 @@ static void handle_commit(struct wl_listener *listener, void *data) {
82 // NOTE: We intentionally discard the view's desired width here 76 // NOTE: We intentionally discard the view's desired width here
83 // TODO: Store this for restoration when moving to floating plane 77 // TODO: Store this for restoration when moving to floating plane
84 // TODO: Let floating views do whatever 78 // TODO: Let floating views do whatever
85 view->width = sway_surface->pending_width; 79 view_update_size(view, sway_surface->pending_width,
86 view->height = sway_surface->pending_height; 80 sway_surface->pending_height);
87 view_damage_from(view); 81 view_damage_from(view);
88} 82}
89 83