@ -20,6 +20,7 @@
# include "sway/tree/arrange.h"
# include "sway/tree/arrange.h"
# include "sway/tree/view.h"
# include "sway/tree/view.h"
# include "sway/tree/workspace.h"
# include "sway/tree/workspace.h"
# include "sway/xdg_decoration.h"
# include "list.h"
# include "list.h"
# include "log.h"
# include "log.h"
# include "stringop.h"
# include "stringop.h"
@ -835,7 +836,13 @@ void container_set_floating(struct sway_container *container, bool enable) {
if ( container - > view ) {
if ( container - > view ) {
view_set_tiled ( container - > view , false ) ;
view_set_tiled ( container - > view , false ) ;
if ( container - > view - > using_csd ) {
if ( container - > view - > using_csd ) {
container - > saved_border = container - > pending . border ;
container - > pending . border = B_CSD ;
container - > pending . border = B_CSD ;
if ( container - > view - > xdg_decoration ) {
struct sway_xdg_decoration * deco = container - > view - > xdg_decoration ;
wlr_xdg_toplevel_decoration_v1_set_mode ( deco - > wlr_xdg_decoration ,
WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE ) ;
}
}
}
}
}
container_floating_set_default_size ( container ) ;
container_floating_set_default_size ( container ) ;
@ -873,6 +880,11 @@ void container_set_floating(struct sway_container *container, bool enable) {
view_set_tiled ( container - > view , true ) ;
view_set_tiled ( container - > view , true ) ;
if ( container - > view - > using_csd ) {
if ( container - > view - > using_csd ) {
container - > pending . border = container - > saved_border ;
container - > pending . border = container - > saved_border ;
if ( container - > view - > xdg_decoration ) {
struct sway_xdg_decoration * deco = container - > view - > xdg_decoration ;
wlr_xdg_toplevel_decoration_v1_set_mode ( deco - > wlr_xdg_decoration ,
WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE ) ;
}
}
}
}
}
container - > width_fraction = 0 ;
container - > width_fraction = 0 ;