mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
Decorations: respect earlier decoration negotiation results
Before this patch, setting `<decoration>` to `client` would cause applications which prefer server side decorations to not have any decorations at all. This patch fixes it by respecting the result of earlier negotiations via the xdg-decoration-unstable-v1 protocol. Fixes #297 Fixes #831
This commit is contained in:
parent
f5c4651c67
commit
4e75125995
1 changed files with 13 additions and 0 deletions
13
src/xdg.c
13
src/xdg.c
|
|
@ -48,7 +48,16 @@ handle_new_xdg_popup(struct wl_listener *listener, void *data)
|
||||||
static bool
|
static bool
|
||||||
has_ssd(struct view *view)
|
has_ssd(struct view *view)
|
||||||
{
|
{
|
||||||
|
if (view->ssd_enabled) {
|
||||||
|
/* View prefers server side decorations */
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!rc.xdg_shell_server_side_deco) {
|
if (!rc.xdg_shell_server_side_deco) {
|
||||||
|
/*
|
||||||
|
* User prefers client side decorations and
|
||||||
|
* the view didn't negotiate server side ones.
|
||||||
|
*/
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -56,6 +65,10 @@ has_ssd(struct view *view)
|
||||||
* Some XDG shells refuse to disable CSD in which case their
|
* Some XDG shells refuse to disable CSD in which case their
|
||||||
* geometry.{x,y} seems to be greater than zero. We filter on that
|
* geometry.{x,y} seems to be greater than zero. We filter on that
|
||||||
* on the assumption that this will remain true.
|
* on the assumption that this will remain true.
|
||||||
|
*
|
||||||
|
* TODO: Replace this with a proper implementation of
|
||||||
|
* the KDE decoration variant as can be seen at
|
||||||
|
* https://github.com/swaywm/sway/blob/master/sway/decoration.c
|
||||||
*/
|
*/
|
||||||
struct wlr_xdg_surface_state *current =
|
struct wlr_xdg_surface_state *current =
|
||||||
&xdg_surface_from_view(view)->current;
|
&xdg_surface_from_view(view)->current;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue