diff options
author | 2018-05-01 15:31:02 +0100 | |
---|---|---|
committer | 2018-05-01 15:31:02 +0100 | |
commit | 0e51c7be449dd68025d5acd8c634f8dcacb10a16 (patch) | |
tree | c2c7e713a150c7f9a947b100e0fa4c56efb5c3b2 /include | |
parent | Merge pull request #1876 from RyanDwyer/view-unmap-segfault (diff) | |
parent | Remove unnecessary pointers (diff) | |
download | sway-0e51c7be449dd68025d5acd8c634f8dcacb10a16.tar.gz sway-0e51c7be449dd68025d5acd8c634f8dcacb10a16.tar.zst sway-0e51c7be449dd68025d5acd8c634f8dcacb10a16.zip |
Merge pull request #1874 from RyanDwyer/borders
Implement borders
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/config.h | 12 | ||||
-rw-r--r-- | include/sway/tree/container.h | 2 | ||||
-rw-r--r-- | include/sway/tree/view.h | 13 |
3 files changed, 20 insertions, 7 deletions
diff --git a/include/sway/config.h b/include/sway/config.h index 87123289..a0113e98 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -204,11 +204,11 @@ struct bar_config { | |||
204 | }; | 204 | }; |
205 | 205 | ||
206 | struct border_colors { | 206 | struct border_colors { |
207 | uint32_t border; | 207 | float border[4]; |
208 | uint32_t background; | 208 | float background[4]; |
209 | uint32_t text; | 209 | float text[4]; |
210 | uint32_t indicator; | 210 | float indicator[4]; |
211 | uint32_t child_border; | 211 | float child_border[4]; |
212 | }; | 212 | }; |
213 | 213 | ||
214 | enum edge_border_types { | 214 | enum edge_border_types { |
@@ -338,7 +338,7 @@ struct sway_config { | |||
338 | struct border_colors unfocused; | 338 | struct border_colors unfocused; |
339 | struct border_colors urgent; | 339 | struct border_colors urgent; |
340 | struct border_colors placeholder; | 340 | struct border_colors placeholder; |
341 | uint32_t background; | 341 | float background[4]; |
342 | } border_colors; | 342 | } border_colors; |
343 | 343 | ||
344 | // floating view | 344 | // floating view |
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 9c921fc4..d092af49 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h | |||
@@ -72,8 +72,8 @@ struct sway_container { | |||
72 | // For C_ROOT, this has no meaning | 72 | // For C_ROOT, this has no meaning |
73 | // For C_OUTPUT, this is the output position in layout coordinates | 73 | // For C_OUTPUT, this is the output position in layout coordinates |
74 | // For other types, this is the position in output-local coordinates | 74 | // For other types, this is the position in output-local coordinates |
75 | // Includes borders | ||
75 | double x, y; | 76 | double x, y; |
76 | // does not include borders or gaps. | ||
77 | double width, height; | 77 | double width, height; |
78 | double saved_width, saved_height; | 78 | double saved_width, saved_height; |
79 | 79 | ||
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index a4ad9971..21127ab1 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -41,9 +41,16 @@ struct sway_view { | |||
41 | 41 | ||
42 | struct sway_container *swayc; // NULL for unmapped views | 42 | struct sway_container *swayc; // NULL for unmapped views |
43 | struct wlr_surface *surface; // NULL for unmapped views | 43 | struct wlr_surface *surface; // NULL for unmapped views |
44 | |||
45 | // Geometry of the view itself (excludes borders) | ||
46 | double x, y; | ||
44 | int width, height; | 47 | int width, height; |
48 | |||
45 | bool is_fullscreen; | 49 | bool is_fullscreen; |
46 | 50 | ||
51 | enum sway_container_border border; | ||
52 | int border_thickness; | ||
53 | |||
47 | union { | 54 | union { |
48 | struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6; | 55 | struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6; |
49 | struct wlr_xwayland_surface *wlr_xwayland_surface; | 56 | struct wlr_xwayland_surface *wlr_xwayland_surface; |
@@ -160,6 +167,12 @@ const char *view_get_instance(struct sway_view *view); | |||
160 | void view_configure(struct sway_view *view, double ox, double oy, int width, | 167 | void view_configure(struct sway_view *view, double ox, double oy, int width, |
161 | int height); | 168 | int height); |
162 | 169 | ||
170 | /** | ||
171 | * Configure the view's position and size based on the swayc's position and | ||
172 | * size, taking borders into consideration. | ||
173 | */ | ||
174 | void view_autoconfigure(struct sway_view *view); | ||
175 | |||
163 | void view_set_activated(struct sway_view *view, bool activated); | 176 | void view_set_activated(struct sway_view *view, bool activated); |
164 | 177 | ||
165 | void view_set_fullscreen_raw(struct sway_view *view, bool fullscreen); | 178 | void view_set_fullscreen_raw(struct sway_view *view, bool fullscreen); |