mirror of
https://github.com/labwc/labwc.git
synced 2026-03-18 05:33:53 -04:00
view: save last placement info before layout change
I will add output name and relative view position in `view->last_placement` later, which needs to be saved before layout changes unlike the global position.
This commit is contained in:
parent
a964d41dd1
commit
f58b532214
3 changed files with 45 additions and 20 deletions
|
|
@ -166,7 +166,8 @@ static void
|
|||
handle_output_destroy(struct wl_listener *listener, void *data)
|
||||
{
|
||||
struct output *output = wl_container_of(listener, output, destroy);
|
||||
struct seat *seat = &output->server->seat;
|
||||
struct server *server = output->server;
|
||||
struct seat *seat = &server->seat;
|
||||
regions_evacuate_output(output);
|
||||
regions_destroy(seat, &output->regions);
|
||||
if (seat->overlay.active.output == output) {
|
||||
|
|
@ -189,8 +190,10 @@ handle_output_destroy(struct wl_listener *listener, void *data)
|
|||
output->workspace_osd = NULL;
|
||||
}
|
||||
|
||||
/* save the last placement before clearing view->output */
|
||||
views_save_last_placement(server);
|
||||
|
||||
struct view *view;
|
||||
struct server *server = output->server;
|
||||
wl_list_for_each(view, &server->views, link) {
|
||||
if (view->output == output) {
|
||||
view_on_output_destroy(view);
|
||||
|
|
@ -659,6 +662,7 @@ output_config_apply(struct server *server,
|
|||
{
|
||||
bool success = true;
|
||||
server->pending_output_layout_change++;
|
||||
views_save_last_placement(server);
|
||||
|
||||
struct wlr_output_configuration_head_v1 *head;
|
||||
wl_list_for_each(head, &config->heads, link) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue