From 9675137749459b2ade8d68fb8b6fe5b587f87a7b Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Sun, 12 Nov 2023 13:54:58 +0900 Subject: [PATCH] e_zone: consider maximize state while handling fullscreen/unfullscreen Change-Id: I2c98ecff4e82ad1560106d07e0b7cad43af4d532 --- src/bin/e_zone.c | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/src/bin/e_zone.c b/src/bin/e_zone.c index 6155a05..6532a8c 100644 --- a/src/bin/e_zone.c +++ b/src/bin/e_zone.c @@ -1027,7 +1027,6 @@ _zone_cb_client_fullscreen(struct wl_listener *listener, void *data) E_Zone *zone; E_Client *ec; E_Desk *desk; - int x, y, w, h; E_Fullscreen fullscreen_policy; zone_client = wl_container_of(listener, zone_client, client_fullscreen); @@ -1046,14 +1045,7 @@ _zone_cb_client_fullscreen(struct wl_listener *listener, void *data) desk->fullscreen_clients = eina_list_append(desk->fullscreen_clients, ec); ec->pre_res_change.valid = 0; - if (ec->maximized) - { - x = ec->saved.x; - y = ec->saved.y; - w = ec->saved.w; - h = ec->saved.h; - } - else + if (!ec->maximized) { ec->saved.x = ec->client.x - zone->x; ec->saved.y = ec->client.y - zone->y; @@ -1063,15 +1055,6 @@ _zone_cb_client_fullscreen(struct wl_listener *listener, void *data) ec->saved.maximized = ec->maximized; ec->saved.zone = zone->num; - if (ec->maximized) - { - e_client_unmaximize(ec, E_MAXIMIZE_BOTH); - ec->saved.x = x; - ec->saved.y = y; - ec->saved.w = w; - ec->saved.h = h; - } - ec->saved.layer = ec->layer; e_client_layer_set(ec, E_LAYER_CLIENT_FULLSCREEN); @@ -1110,13 +1093,24 @@ _zone_cb_client_unfullscreen(struct wl_listener *listener, void *data) evas_object_smart_callback_call(ec->frame, "unfullscreen", NULL); - e_client_util_move_resize_without_frame(ec, zone->x + ec->saved.x, - zone->y + ec->saved.y, - ec->saved.w, ec->saved.h); - - if (ec->saved.maximized) - e_client_maximize(ec, (ec->maximize_type & E_MAXIMIZE_TYPE) | - ec->saved.maximized); + if (ec->maximized) + { + int saved_x = ec->saved.x; + int saved_y = ec->saved.y; + int saved_w = ec->saved.w; + int saved_h = ec->saved.h; + e_client_maximize_update(ec); + ec->saved.x = saved_x; + ec->saved.y = saved_y; + ec->saved.w = saved_w; + ec->saved.h = saved_h; + } + else + { + e_client_util_move_resize_without_frame(ec, zone->x + ec->saved.x, + zone->y + ec->saved.y, + ec->saved.w, ec->saved.h); + } e_client_layer_set(ec, ec->saved.layer); -- 2.7.4