diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-31 20:28:36 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-31 23:56:20 +1000 |
commit | 528c7495bb09e18a8b63e1c741b90f65ff5541c6 (patch) | |
tree | b1dddeefb15f2511b33f7bed52d0df3b4110d8f8 /include/sway | |
parent | Merge pull request #3031 from atomnuker/master (diff) | |
download | sway-528c7495bb09e18a8b63e1c741b90f65ff5541c6.tar.gz sway-528c7495bb09e18a8b63e1c741b90f65ff5541c6.tar.zst sway-528c7495bb09e18a8b63e1c741b90f65ff5541c6.zip |
Move view border properties to container struct
This will be needed to implement layout saving and restoring, as we need
to be able to configure borders on a placeholder container which has no
view.
Diffstat (limited to 'include/sway')
-rw-r--r-- | include/sway/tree/container.h | 20 | ||||
-rw-r--r-- | include/sway/tree/view.h | 16 |
2 files changed, 16 insertions, 20 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 1dd23341..c0c803f1 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h | |||
@@ -53,16 +53,16 @@ struct sway_container_state { | |||
53 | struct sway_container *focused_inactive_child; | 53 | struct sway_container *focused_inactive_child; |
54 | bool focused; | 54 | bool focused; |
55 | 55 | ||
56 | // View properties | ||
57 | double view_x, view_y; | ||
58 | double view_width, view_height; | ||
59 | |||
60 | enum sway_container_border border; | 56 | enum sway_container_border border; |
61 | int border_thickness; | 57 | int border_thickness; |
62 | bool border_top; | 58 | bool border_top; |
63 | bool border_bottom; | 59 | bool border_bottom; |
64 | bool border_left; | 60 | bool border_left; |
65 | bool border_right; | 61 | bool border_right; |
62 | |||
63 | // View properties | ||
64 | double view_x, view_y; | ||
65 | double view_width, view_height; | ||
66 | }; | 66 | }; |
67 | 67 | ||
68 | struct sway_container { | 68 | struct sway_container { |
@@ -91,6 +91,18 @@ struct sway_container { | |||
91 | 91 | ||
92 | bool is_fullscreen; | 92 | bool is_fullscreen; |
93 | 93 | ||
94 | enum sway_container_border border; | ||
95 | |||
96 | // Used when the view changes to CSD unexpectedly. This will be a non-B_CSD | ||
97 | // border which we use to restore when the view returns to SSD. | ||
98 | enum sway_container_border saved_border; | ||
99 | |||
100 | int border_thickness; | ||
101 | bool border_top; | ||
102 | bool border_bottom; | ||
103 | bool border_left; | ||
104 | bool border_right; | ||
105 | |||
94 | // The gaps currently applied to the container. | 106 | // The gaps currently applied to the container. |
95 | double current_gaps; | 107 | double current_gaps; |
96 | 108 | ||
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 0240f294..67f17914 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -80,24 +80,8 @@ struct sway_view { | |||
80 | 80 | ||
81 | char *title_format; | 81 | char *title_format; |
82 | 82 | ||
83 | // Our border types are B_NONE, B_PIXEL, B_NORMAL and B_CSD. We normally | ||
84 | // just assign this to the border property and ignore the other two. | ||
85 | // However, when a view using CSD is tiled, we want to render our own | ||
86 | // borders as well. So in this case the border property becomes one of the | ||
87 | // first three, and using_csd is true. | ||
88 | // Lastly, views can change their decoration mode at any time. When an SSD | ||
89 | // view becomes CSD without our approval, we save the SSD border type so it | ||
90 | // can be restored if/when the view returns from CSD to SSD. | ||
91 | enum sway_container_border border; | ||
92 | enum sway_container_border saved_border; | ||
93 | bool using_csd; | 83 | bool using_csd; |
94 | 84 | ||
95 | int border_thickness; | ||
96 | bool border_top; | ||
97 | bool border_bottom; | ||
98 | bool border_left; | ||
99 | bool border_right; | ||
100 | |||
101 | struct timespec urgent; | 85 | struct timespec urgent; |
102 | bool allow_request_urgent; | 86 | bool allow_request_urgent; |
103 | struct wl_event_source *urgent_timer; | 87 | struct wl_event_source *urgent_timer; |