diff options
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 3de9879e..065d00db 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -119,10 +119,10 @@ const char *view_get_shell(struct sway_view *view) { | |||
119 | return "unknown"; | 119 | return "unknown"; |
120 | } | 120 | } |
121 | 121 | ||
122 | void view_configure(struct sway_view *view, double ox, double oy, int width, | 122 | void view_configure(struct sway_view *view, double lx, double ly, int width, |
123 | int height) { | 123 | int height) { |
124 | if (view->impl->configure) { | 124 | if (view->impl->configure) { |
125 | view->impl->configure(view, ox, oy, width, height); | 125 | view->impl->configure(view, lx, ly, width, height); |
126 | } | 126 | } |
127 | } | 127 | } |
128 | 128 | ||
@@ -134,9 +134,8 @@ static void view_autoconfigure_floating(struct sway_view *view) { | |||
134 | view->natural_width > max_width ? max_width : view->natural_width; | 134 | view->natural_width > max_width ? max_width : view->natural_width; |
135 | int height = | 135 | int height = |
136 | view->natural_height > max_height ? max_height : view->natural_height; | 136 | view->natural_height > max_height ? max_height : view->natural_height; |
137 | struct sway_container *output = ws->parent; | 137 | int lx = ws->x + (ws->width - width) / 2; |
138 | int lx = output->x + (ws->width - width) / 2; | 138 | int ly = ws->y + (ws->height - height) / 2; |
139 | int ly = output->y + (ws->height - height) / 2; | ||
140 | 139 | ||
141 | view->border_left = view->border_right = view->border_bottom = true; | 140 | view->border_left = view->border_right = view->border_bottom = true; |
142 | view_set_tiled(view, false); | 141 | view_set_tiled(view, false); |
@@ -152,8 +151,7 @@ void view_autoconfigure(struct sway_view *view) { | |||
152 | struct sway_container *output = container_parent(view->swayc, C_OUTPUT); | 151 | struct sway_container *output = container_parent(view->swayc, C_OUTPUT); |
153 | 152 | ||
154 | if (view->is_fullscreen) { | 153 | if (view->is_fullscreen) { |
155 | view_configure(view, 0, 0, output->width, output->height); | 154 | view_configure(view, output->x, output->y, output->width, output->height); |
156 | view->x = view->y = 0; | ||
157 | return; | 155 | return; |
158 | } | 156 | } |
159 | 157 | ||
@@ -560,6 +558,9 @@ void view_unmap(struct sway_view *view) { | |||
560 | } | 558 | } |
561 | 559 | ||
562 | void view_update_position(struct sway_view *view, double lx, double ly) { | 560 | void view_update_position(struct sway_view *view, double lx, double ly) { |
561 | if (view->x == lx && view->y == ly) { | ||
562 | return; | ||
563 | } | ||
563 | if (!container_is_floating(view->swayc)) { | 564 | if (!container_is_floating(view->swayc)) { |
564 | return; | 565 | return; |
565 | } | 566 | } |