diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-05 12:36:50 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-05 22:29:37 +1000 |
commit | 228c478e8d11dd14972b237574146fd0d2d6b96c (patch) | |
tree | 819dfc4d6151ebb28d7db5b862d0ac4314d82fc3 /include/sway/tree/view.h | |
parent | Merge pull request #1918 from RyanDwyer/title-scissor (diff) | |
download | sway-228c478e8d11dd14972b237574146fd0d2d6b96c.tar.gz sway-228c478e8d11dd14972b237574146fd0d2d6b96c.tar.zst sway-228c478e8d11dd14972b237574146fd0d2d6b96c.zip |
Implement title_format
This implements the title_format command, with a new placeholder %shell
which gets substituted with the view type (xwayland, xdg_shell_v6 or
wl_shell).
Example config:
for_window [title=".*"] title_format %title (class=%class instance=%instance shell=%shell)
Diffstat (limited to 'include/sway/tree/view.h')
-rw-r--r-- | include/sway/tree/view.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 21127ab1..9d4256f7 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -48,6 +48,7 @@ struct sway_view { | |||
48 | 48 | ||
49 | bool is_fullscreen; | 49 | bool is_fullscreen; |
50 | 50 | ||
51 | char *title_format; | ||
51 | enum sway_container_border border; | 52 | enum sway_container_border border; |
52 | int border_thickness; | 53 | int border_thickness; |
53 | 54 | ||
@@ -164,6 +165,8 @@ const char *view_get_class(struct sway_view *view); | |||
164 | 165 | ||
165 | const char *view_get_instance(struct sway_view *view); | 166 | const char *view_get_instance(struct sway_view *view); |
166 | 167 | ||
168 | const char *view_get_type(struct sway_view *view); | ||
169 | |||
167 | void view_configure(struct sway_view *view, double ox, double oy, int width, | 170 | void view_configure(struct sway_view *view, double ox, double oy, int width, |
168 | int height); | 171 | int height); |
169 | 172 | ||
@@ -207,4 +210,11 @@ void view_child_init(struct sway_view_child *child, | |||
207 | 210 | ||
208 | void view_child_destroy(struct sway_view_child *child); | 211 | void view_child_destroy(struct sway_view_child *child); |
209 | 212 | ||
213 | /** | ||
214 | * Re-read the view's title property and update any relevant title bars. | ||
215 | * The force argument makes it recreate the title bars even if the title hasn't | ||
216 | * changed. | ||
217 | */ | ||
218 | void view_update_title(struct sway_view *view, bool force); | ||
219 | |||
210 | #endif | 220 | #endif |