mirror of
https://github.com/labwc/labwc.git
synced 2025-10-31 22:25:34 -04:00
Decorations: respect earlier client side decoration negotion result
Before this patch, it was impossible to differentiate between negotiations resulting in client side decorations and no negotiations at all. By adding an enum we are now able to differentiate between the two states.
This commit is contained in:
parent
082dc79555
commit
35e71ada82
3 changed files with 26 additions and 3 deletions
|
|
@ -28,10 +28,22 @@ xdg_deco_request_mode(struct wl_listener *listener, void *data)
|
|||
enum wlr_xdg_toplevel_decoration_v1_mode client_mode =
|
||||
xdg_deco->wlr_decoration->requested_mode;
|
||||
|
||||
if (client_mode == WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_NONE) {
|
||||
switch (client_mode) {
|
||||
case WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE:
|
||||
xdg_deco->view->ssd_preference = LAB_SSD_PREF_SERVER;
|
||||
break;
|
||||
case WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE:
|
||||
xdg_deco->view->ssd_preference = LAB_SSD_PREF_CLIENT;
|
||||
break;
|
||||
case WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_NONE:
|
||||
xdg_deco->view->ssd_preference = LAB_SSD_PREF_UNSPEC;
|
||||
client_mode = rc.xdg_shell_server_side_deco
|
||||
? WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE
|
||||
: WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE;
|
||||
break;
|
||||
default:
|
||||
wlr_log(WLR_ERROR, "Unspecified decoration variant requested: %u",
|
||||
client_mode);
|
||||
}
|
||||
|
||||
wlr_xdg_toplevel_decoration_v1_set_mode(xdg_deco->wlr_decoration, client_mode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue