diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-04-30 21:24:13 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-04-30 21:24:13 +1000 |
commit | e67f3543332349e63b5099a241fdd85ce28ea54b (patch) | |
tree | 54bede11d48f561693d1288e0980660c644b4dc3 /include | |
parent | Merge pull request #1873 from RyanDwyer/remove-arrange-windows (diff) | |
download | sway-e67f3543332349e63b5099a241fdd85ce28ea54b.tar.gz sway-e67f3543332349e63b5099a241fdd85ce28ea54b.tar.zst sway-e67f3543332349e63b5099a241fdd85ce28ea54b.zip |
Implement borders
Implements rendering of borders. Title text is still to do.
Implements the following configuration directives:
* client.focused
* client.focused_inactive
* client.unfocused
* client.urgent
* border
* default_border
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 | 11 |
3 files changed, 16 insertions, 9 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..352a62bc 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,8 @@ 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 | void view_autoconfigure(struct sway_view *view); | ||
171 | |||
163 | void view_set_activated(struct sway_view *view, bool activated); | 172 | void view_set_activated(struct sway_view *view, bool activated); |
164 | 173 | ||
165 | void view_set_fullscreen_raw(struct sway_view *view, bool fullscreen); | 174 | void view_set_fullscreen_raw(struct sway_view *view, bool fullscreen); |
@@ -184,8 +193,6 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface); | |||
184 | 193 | ||
185 | void view_unmap(struct sway_view *view); | 194 | void view_unmap(struct sway_view *view); |
186 | 195 | ||
187 | void view_update_position(struct sway_view *view, double ox, double oy); | ||
188 | |||
189 | void view_update_size(struct sway_view *view, int width, int height); | 196 | void view_update_size(struct sway_view *view, int width, int height); |
190 | 197 | ||
191 | void view_child_init(struct sway_view_child *child, | 198 | void view_child_init(struct sway_view_child *child, |