summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-04-05 16:54:04 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-04-05 16:54:04 -0400
commit992e04feb29b0b30633b2c963e500e1d6c22cd1d (patch)
tree70a48fca58df8e32fc28ab861b81a34397bfb0f9
parentae7af6b8ef7a29968fafe01017179b12638970fb (diff)
downloadenlightenment-992e04feb29b0b30633b2c963e500e1d6c22cd1d.tar.gz
wayland client maximize/fullscreen cleanups
ref da74e690f0139aa85272314f1d688a717c52668c
-rw-r--r--src/bin/e_comp_wl.c20
-rw-r--r--src/modules/wl_desktop_shell/e_mod_main.c11
2 files changed, 25 insertions, 6 deletions
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 0617a3ae0e..64dd5097c1 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -1059,6 +1059,7 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
Eina_Bool placed = EINA_TRUE;
int x = 0, y = 0, w, h;
Eina_Rectangle saved;
+ Eina_Bool saved_frame;
first = !e_pixmap_usable_get(ec->pixmap);
#ifndef HAVE_WAYLAND_ONLY
@@ -1078,6 +1079,7 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
memcpy(&saved, &ec->client, sizeof(Eina_Rectangle));
saved.x -= ec->zone->x;
saved.y -= ec->zone->y;
+ saved_frame = !e_comp_object_frame_allowed(ec->frame);
if (state->new_attach)
_e_comp_wl_surface_state_attach(ec, state);
@@ -1204,16 +1206,28 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
if (ec->comp_data->shell.surface)
{
- if (ec->comp_data->shell.set.fullscreen)
+ if (ec->comp_data->shell.set.fullscreen && (!ec->fullscreen))
{
e_client_fullscreen(ec, E_FULLSCREEN_RESIZE);
memcpy(&ec->saved, &saved, sizeof(Eina_Rectangle));
+ ec->saved.frame = saved_frame;
}
if (ec->comp_data->shell.set.unfullscreen)
e_client_unfullscreen(ec);
if (ec->comp_data->shell.set.maximize)
- e_client_maximize(ec,
- (e_config->maximize_policy & E_MAXIMIZE_TYPE) | E_MAXIMIZE_BOTH);
+ {
+ unsigned int max = (e_config->maximize_policy & E_MAXIMIZE_TYPE) | E_MAXIMIZE_BOTH;
+
+ if (ec->maximized != max)
+ {
+ e_client_maximize(ec, max);
+ if (!ec->maximize_override)
+ {
+ memcpy(&ec->saved, &saved, sizeof(Eina_Rectangle));
+ ec->saved.frame = saved_frame;
+ }
+ }
+ }
if (ec->comp_data->shell.set.unmaximize)
e_client_unmaximize(ec, E_MAXIMIZE_BOTH);
if (ec->comp_data->shell.set.minimize)
diff --git a/src/modules/wl_desktop_shell/e_mod_main.c b/src/modules/wl_desktop_shell/e_mod_main.c
index 57ca1bc825..ba385a7d07 100644
--- a/src/modules/wl_desktop_shell/e_mod_main.c
+++ b/src/modules/wl_desktop_shell/e_mod_main.c
@@ -641,7 +641,7 @@ _xdg_shell_surface_send_configure(struct wl_resource *resource, Eina_Bool fullsc
shd = ec->comp_data->shell.data;
if ((shd->edges == edges) && (shd->width == width) && (shd->height == height) &&
(shd->fullscreen == fullscreen) &&
- ((!fullscreen) || (shd->maximized == maximized)) &&
+ (shd->maximized == maximized) &&
(shd->activated == focused)) return;
shd->edges = edges;
shd->width = width;
@@ -703,7 +703,7 @@ _e_xdg_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges
}
if (ec->netwm.type == E_WINDOW_TYPE_POPUP_MENU) return;
- _xdg_shell_surface_send_configure(resource, ec->fullscreen, ec->maximized, edges, ec->focused, width, height);
+ _xdg_shell_surface_send_configure(resource, ec->fullscreen, !!ec->maximized, edges, ec->focused, width, height);
}
static void
@@ -977,6 +977,7 @@ static void
_e_xdg_shell_surface_cb_maximized_unset(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
E_Client *ec;
+ int w, h;
/* get the client for this resource */
if (!(ec = wl_resource_get_user_data(resource)))
@@ -988,7 +989,11 @@ _e_xdg_shell_surface_cb_maximized_unset(struct wl_client *client EINA_UNUSED, st
}
if (ec->lock_user_maximize) return;
- _xdg_shell_surface_send_configure(resource, ec->fullscreen, 0, 0, ec->focused, ec->saved.w, ec->saved.h);
+ if (e_config->window_maximize_animate)
+ w = ec->w, h = ec->h;
+ else
+ w = ec->saved.w, h = ec->saved.h;
+ _xdg_shell_surface_send_configure(resource, ec->fullscreen, 0, 0, ec->focused, w, h);
}
static void