Issue #5066: Fix saved_border initialization in view_map

In view_map, the function view_update_csd_from_client
is called conditionally before the container's border
types are initialized from the configuration. This
results in view_border being initialized inside
view_update_csd_from_client from garbage values.

This results in applications that take this path
not having their borders restored when set to floating
and then back to tiled.

Moved this conditional call just after the next block
that initializes the containers borders.
This commit is contained in:
Dimitris Triantafyllidis 2020-09-10 00:18:03 +03:00
parent 7ca9ef12f8
commit a44c82cb1c

View file

@ -743,10 +743,6 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface,
&view->surface_new_subsurface); &view->surface_new_subsurface);
view->surface_new_subsurface.notify = view_handle_surface_new_subsurface; view->surface_new_subsurface.notify = view_handle_surface_new_subsurface;
if (decoration) {
view_update_csd_from_client(view, decoration);
}
if (view->impl->wants_floating && view->impl->wants_floating(view)) { if (view->impl->wants_floating && view->impl->wants_floating(view)) {
view->container->border = config->floating_border; view->container->border = config->floating_border;
view->container->border_thickness = config->floating_border_thickness; view->container->border_thickness = config->floating_border_thickness;
@ -757,6 +753,10 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface,
view_set_tiled(view, true); view_set_tiled(view, true);
} }
if (decoration) {
view_update_csd_from_client(view, decoration);
}
if (config->popup_during_fullscreen == POPUP_LEAVE && if (config->popup_during_fullscreen == POPUP_LEAVE &&
view->container->workspace && view->container->workspace &&
view->container->workspace->fullscreen && view->container->workspace->fullscreen &&