aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/xdg_shell_v6.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-04-02 10:57:45 -0400
committeremersion <contact@emersion.fr>2018-04-02 10:57:45 -0400
commit61fabede14bb3a8fe9ee5a249352cd405fd1b9bf (patch)
treede0cc1378f2edba5cc194c8dcebe4d5fdaeda647 /sway/desktop/xdg_shell_v6.c
parent1d68f9ecca8870f2f2a6823072c77657436b123a (diff)
Address review comments
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) {
}
}
-static void set_size(struct sway_view *view, int width, int height) {
+static void configure(struct sway_view *view, double ox, double oy, int width,
+ int height) {
if (!assert_xdg(view)) {
return;
}
+
+ view_update_position(view, ox, oy);
view->sway_xdg_surface_v6->pending_width = width;
view->sway_xdg_surface_v6->pending_height = height;
wlr_xdg_toplevel_v6_set_size(view->wlr_xdg_surface_v6, width, height);
}
-static void set_position(struct sway_view *view, double ox, double oy) {
- if (!assert_xdg(view)) {
- return;
- }
- view->swayc->x = ox;
- view->swayc->y = oy;
-}
-
static void set_activated(struct sway_view *view, bool activated) {
if (!assert_xdg(view)) {
return;
@@ -57,7 +52,7 @@ static void set_activated(struct sway_view *view, bool activated) {
}
}
-static void close(struct sway_view *view) {
+static void _close(struct sway_view *view) {
if (!assert_xdg(view)) {
return;
}
@@ -69,10 +64,9 @@ static void close(struct sway_view *view) {
static const struct sway_view_impl view_impl = {
.get_prop = get_prop,
- .set_size = set_size,
- .set_position = set_position,
+ .configure = configure,
.set_activated = set_activated,
- .close = close,
+ .close = _close,
};
static void handle_commit(struct wl_listener *listener, void *data) {
@@ -82,8 +76,8 @@ static void handle_commit(struct wl_listener *listener, void *data) {
// NOTE: We intentionally discard the view's desired width here
// TODO: Store this for restoration when moving to floating plane
// TODO: Let floating views do whatever
- view->width = sway_surface->pending_width;
- view->height = sway_surface->pending_height;
+ view_update_size(view, sway_surface->pending_width,
+ sway_surface->pending_height);
view_damage_from(view);
}