aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Ankit Pandey <anpandey@protonmail.com>2022-12-11 16:44:48 -0800
committerLibravatar Ronan Pigott <ronan@rjp.ie>2023-03-14 23:26:42 -0700
commit90c2d631e2dc4c7633bb8fcd92f300a4a2dffb86 (patch)
tree218db72a61c8e7b55cf39d241e51ee0780636670 /include
parentman: add warning for hide_cursor configuration (diff)
downloadsway-90c2d631e2dc4c7633bb8fcd92f300a4a2dffb86.tar.gz
sway-90c2d631e2dc4c7633bb8fcd92f300a4a2dffb86.tar.zst
sway-90c2d631e2dc4c7633bb8fcd92f300a4a2dffb86.zip
root: Try to preserve relative positions of floating containers
This makes the behavior of floating containers more consistent with i3. The coordinates of the container are scaled when the size of the workspace it is on changes or when the container is moved between workspaces on different outputs. For scratchpad containers, add a new state that preserves the dimensions of the last output the window appeared on. This is necessary because after a container is hidden in the scratchpad, we expect it to be in the same relative position on the output when it reappears. We can't just use the container's attached workspace because that workspace's dimensions might have been changed or the workspace as a whole could have been destroyed.
Diffstat (limited to 'include')
-rw-r--r--include/sway/tree/container.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index 751612e2..fe3ee8a8 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -113,6 +113,11 @@ struct sway_container {
113 // Hidden scratchpad containers have a NULL parent. 113 // Hidden scratchpad containers have a NULL parent.
114 bool scratchpad; 114 bool scratchpad;
115 115
116 // Stores last output size and position for adjusting coordinates of
117 // scratchpad windows.
118 // Unused for non-scratchpad windows.
119 struct wlr_box transform;
120
116 float alpha; 121 float alpha;
117 122
118 struct wlr_texture *title_focused; 123 struct wlr_texture *title_focused;
@@ -196,6 +201,9 @@ size_t container_titlebar_height(void);
196void floating_calculate_constraints(int *min_width, int *max_width, 201void floating_calculate_constraints(int *min_width, int *max_width,
197 int *min_height, int *max_height); 202 int *min_height, int *max_height);
198 203
204void floating_fix_coordinates(struct sway_container *con,
205 struct wlr_box *old, struct wlr_box *new);
206
199void container_floating_resize_and_center(struct sway_container *con); 207void container_floating_resize_and_center(struct sway_container *con);
200 208
201void container_floating_set_default_size(struct sway_container *con); 209void container_floating_set_default_size(struct sway_container *con);