summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-07-28 15:12:59 -0500
committerDerek Foreman <derekf@osg.samsung.com>2016-07-29 13:01:18 -0500
commit23afcd648fe57258a91cf652a0df5a3b8b1c81cb (patch)
tree81de1d1ca51182eae150b62f3a1859bc028d272b
parent0115cfd6250d0a4220ba41105fc0f8701f10f24a (diff)
downloadenlightenment-devs/derekf/wip2.tar.gz
Fix wl_shell maximize as used by Qtdevs/derekf/wip2
#Squirtle
-rw-r--r--src/bin/e_client.c1
-rw-r--r--src/bin/e_comp_wl.h1
-rw-r--r--src/modules/wl_desktop_shell/e_mod_main.c52
3 files changed, 44 insertions, 10 deletions
diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index 0255ccb212..9cd0ba8f1f 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -3618,7 +3618,6 @@ e_client_maximize_geometry_get(const E_Client *ec, E_Maximize max, int *mx, int
int zx, zy, zw, zh;
int ecx, ecy, ecw, ech;
- if (e_client_util_ignored_get(ec)) return EINA_FALSE;
zx = zy = zw = zh = 0;
switch (max & E_MAXIMIZE_TYPE)
diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h
index 2ee3aedca3..43019e97b7 100644
--- a/src/bin/e_comp_wl.h
+++ b/src/bin/e_comp_wl.h
@@ -329,6 +329,7 @@ struct _E_Comp_Wl_Client_Data
Eina_Bool maximizing : 1;
Eina_Bool in_commit : 1;
Eina_Bool is_xdg_surface : 1;
+ Eina_Bool map_maximized : 1;
};
struct _E_Comp_Wl_Output
diff --git a/src/modules/wl_desktop_shell/e_mod_main.c b/src/modules/wl_desktop_shell/e_mod_main.c
index d80ab41b65..b2a42ff072 100644
--- a/src/modules/wl_desktop_shell/e_mod_main.c
+++ b/src/modules/wl_desktop_shell/e_mod_main.c
@@ -298,7 +298,11 @@ _e_shell_surface_cb_toplevel_set(struct wl_client *client EINA_UNUSED, struct wl
ec->netwm.type = E_WINDOW_TYPE_NORMAL;
ec->comp_data->set_win_type = EINA_TRUE;
if ((!ec->lock_user_maximize) && (ec->maximized))
- e_client_unmaximize(ec, E_MAXIMIZE_BOTH);
+ {
+ e_client_unmaximize(ec, E_MAXIMIZE_BOTH);
+ ec->comp_data->shell.set.maximize = 0;
+ ec->comp_data->shell.set.unmaximize = 1;
+ }
if ((!ec->lock_user_fullscreen) && (ec->fullscreen))
e_client_unfullscreen(ec);
EC_CHANGED(ec);
@@ -402,6 +406,8 @@ static void
_e_shell_surface_cb_maximized_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *output_resource EINA_UNUSED)
{
E_Client *ec;
+ int w, h;
+ unsigned int edges = 0;
/* DBG("WL_SHELL: Surface Maximize: %d", wl_resource_get_id(resource)); */
@@ -415,17 +421,31 @@ _e_shell_surface_cb_maximized_set(struct wl_client *client EINA_UNUSED, struct w
}
if (e_object_is_del(E_OBJECT(ec))) return;
- /* tell E to maximize this client */
- if (!ec->lock_user_maximize)
+ if (!ec->comp_data->mapped)
{
- unsigned int edges = 0;
-
- e_client_maximize(ec, ((e_config->maximize_policy & E_MAXIMIZE_TYPE) |
- E_MAXIMIZE_BOTH));
+ ec->comp_data->map_maximized = EINA_TRUE;
+ return;
+ }
- edges = (WL_SHELL_SURFACE_RESIZE_TOP | WL_SHELL_SURFACE_RESIZE_LEFT);
- wl_shell_surface_send_configure(resource, edges, ec->w, ec->h);
+ if (ec->lock_user_maximize) return;
+ if (e_config->window_maximize_animate && (!ec->maximize_anims_disabled))
+ w = ec->w, h = ec->h;
+ else
+ {
+ switch (e_config->maximize_policy & E_MAXIMIZE_TYPE)
+ {
+ case E_MAXIMIZE_FULLSCREEN:
+ w = ec->zone->w, h = ec->zone->h;
+ break;
+ default:
+ e_zone_useful_geometry_get(ec->zone, NULL, NULL, &w, &h);
+ }
}
+
+ ec->comp_data->shell.set.maximize = 1;
+ ec->comp_data->shell.set.unmaximize = 0;
+ edges = (WL_SHELL_SURFACE_RESIZE_TOP | WL_SHELL_SURFACE_RESIZE_LEFT);
+ wl_shell_surface_send_configure(resource, edges, w, h);
}
static void
@@ -574,6 +594,20 @@ _e_shell_surface_map(struct wl_resource *resource)
}
if (e_object_is_del(E_OBJECT(ec))) return;
+ if (ec->comp_data->map_maximized)
+ {
+ unsigned int edges = 0;
+
+ ec->comp_data->shell.set.maximize = 1;
+ ec->comp_data->shell.set.unmaximize = 0;
+
+ e_client_maximize(ec, ((e_config->maximize_policy & E_MAXIMIZE_TYPE) |
+ E_MAXIMIZE_BOTH));
+
+ edges = (WL_SHELL_SURFACE_RESIZE_TOP | WL_SHELL_SURFACE_RESIZE_LEFT);
+ wl_shell_surface_send_configure(resource, edges, ec->w, ec->h);
+ }
+
/* map this surface if needed */
if ((!ec->comp_data->mapped) && (e_pixmap_usable_get(ec->pixmap)))
{