diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-27 22:44:57 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-27 22:51:37 +1000 |
commit | 21ff87d72b44604d348cf71da3175b85ac5b2f75 (patch) | |
tree | de0ecfd66fd3a6957e0f8a2eb5038c785b3965c2 /include | |
parent | Rename view_set_csd_from_client to view_update_csd_from_client (diff) | |
download | sway-21ff87d72b44604d348cf71da3175b85ac5b2f75.tar.gz sway-21ff87d72b44604d348cf71da3175b85ac5b2f75.tar.zst sway-21ff87d72b44604d348cf71da3175b85ac5b2f75.zip |
Improve CSD logic
This does the following:
* Removes the xdg-decoration surface_commit listener. I was under the
impression the client could ignore the server's preference and set
whatever decoration they like using this protocol, but I don't think
that's right.
* Adds a listener for the xdg-decoration request_mode signal. The
protocol states that the server should respond to this with its
preference. We'll always respond with SSD here.
* Makes it so tiled views which use CSD will still have sway decorations
rendered. To do this, using_csd had to be added back to the view struct,
and the border is changed when floating or unfloating a view.
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/tree/view.h | 11 | ||||
-rw-r--r-- | include/sway/xdg_decoration.h | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index e7aaffd7..2c7b4c2b 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -76,8 +76,19 @@ struct sway_view { | |||
76 | int natural_width, natural_height; | 76 | int natural_width, natural_height; |
77 | 77 | ||
78 | char *title_format; | 78 | char *title_format; |
79 | |||
80 | // Our border types are B_NONE, B_PIXEL, B_NORMAL and B_CSD. We normally | ||
81 | // just assign this to the border property and ignore the other two. | ||
82 | // However, when a view using CSD is tiled, we want to render our own | ||
83 | // borders as well. So in this case the border property becomes one of the | ||
84 | // first three, and using_csd is true. | ||
85 | // Lastly, views can change their decoration mode at any time. When an SSD | ||
86 | // view becomes CSD without our approval, we save the SSD border type so it | ||
87 | // can be restored if/when the view returns from CSD to SSD. | ||
79 | enum sway_container_border border; | 88 | enum sway_container_border border; |
80 | enum sway_container_border saved_border; | 89 | enum sway_container_border saved_border; |
90 | bool using_csd; | ||
91 | |||
81 | int border_thickness; | 92 | int border_thickness; |
82 | bool border_top; | 93 | bool border_top; |
83 | bool border_bottom; | 94 | bool border_bottom; |
diff --git a/include/sway/xdg_decoration.h b/include/sway/xdg_decoration.h index 46fb8d34..8bef4c6d 100644 --- a/include/sway/xdg_decoration.h +++ b/include/sway/xdg_decoration.h | |||
@@ -10,7 +10,7 @@ struct sway_xdg_decoration { | |||
10 | struct sway_view *view; | 10 | struct sway_view *view; |
11 | 11 | ||
12 | struct wl_listener destroy; | 12 | struct wl_listener destroy; |
13 | struct wl_listener surface_commit; | 13 | struct wl_listener request_mode; |
14 | }; | 14 | }; |
15 | 15 | ||
16 | struct sway_xdg_decoration *xdg_decoration_from_surface( | 16 | struct sway_xdg_decoration *xdg_decoration_from_surface( |