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)
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 0255ccb21..9cd0ba8f1 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
3618 int zx, zy, zw, zh; 3618 int zx, zy, zw, zh;
3619 int ecx, ecy, ecw, ech; 3619 int ecx, ecy, ecw, ech;
3620 3620
3621 if (e_client_util_ignored_get(ec)) return EINA_FALSE;
3622 zx = zy = zw = zh = 0; 3621 zx = zy = zw = zh = 0;
3623 3622
3624 switch (max & E_MAXIMIZE_TYPE) 3623 switch (max & E_MAXIMIZE_TYPE)
diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h
index 2ee3aedca..43019e97b 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
329 Eina_Bool maximizing : 1; 329 Eina_Bool maximizing : 1;
330 Eina_Bool in_commit : 1; 330 Eina_Bool in_commit : 1;
331 Eina_Bool is_xdg_surface : 1; 331 Eina_Bool is_xdg_surface : 1;
332 Eina_Bool map_maximized : 1;
332}; 333};
333 334
334struct _E_Comp_Wl_Output 335struct _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 d80ab41b6..b2a42ff07 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
298 ec->netwm.type = E_WINDOW_TYPE_NORMAL; 298 ec->netwm.type = E_WINDOW_TYPE_NORMAL;
299 ec->comp_data->set_win_type = EINA_TRUE; 299 ec->comp_data->set_win_type = EINA_TRUE;
300 if ((!ec->lock_user_maximize) && (ec->maximized)) 300 if ((!ec->lock_user_maximize) && (ec->maximized))
301 e_client_unmaximize(ec, E_MAXIMIZE_BOTH); 301 {
302 e_client_unmaximize(ec, E_MAXIMIZE_BOTH);
303 ec->comp_data->shell.set.maximize = 0;
304 ec->comp_data->shell.set.unmaximize = 1;
305 }
302 if ((!ec->lock_user_fullscreen) && (ec->fullscreen)) 306 if ((!ec->lock_user_fullscreen) && (ec->fullscreen))
303 e_client_unfullscreen(ec); 307 e_client_unfullscreen(ec);
304 EC_CHANGED(ec); 308 EC_CHANGED(ec);
@@ -402,6 +406,8 @@ static void
402_e_shell_surface_cb_maximized_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *output_resource EINA_UNUSED) 406_e_shell_surface_cb_maximized_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *output_resource EINA_UNUSED)
403{ 407{
404 E_Client *ec; 408 E_Client *ec;
409 int w, h;
410 unsigned int edges = 0;
405 411
406 /* DBG("WL_SHELL: Surface Maximize: %d", wl_resource_get_id(resource)); */ 412 /* DBG("WL_SHELL: Surface Maximize: %d", wl_resource_get_id(resource)); */
407 413
@@ -415,17 +421,31 @@ _e_shell_surface_cb_maximized_set(struct wl_client *client EINA_UNUSED, struct w
415 } 421 }
416 if (e_object_is_del(E_OBJECT(ec))) return; 422 if (e_object_is_del(E_OBJECT(ec))) return;
417 423
418 /* tell E to maximize this client */ 424 if (!ec->comp_data->mapped)
419 if (!ec->lock_user_maximize)
420 { 425 {
421 unsigned int edges = 0; 426 ec->comp_data->map_maximized = EINA_TRUE;
422 427 return;
423 e_client_maximize(ec, ((e_config->maximize_policy & E_MAXIMIZE_TYPE) | 428 }
424 E_MAXIMIZE_BOTH));
425 429
426 edges = (WL_SHELL_SURFACE_RESIZE_TOP | WL_SHELL_SURFACE_RESIZE_LEFT); 430 if (ec->lock_user_maximize) return;
427 wl_shell_surface_send_configure(resource, edges, ec->w, ec->h); 431 if (e_config->window_maximize_animate && (!ec->maximize_anims_disabled))
432 w = ec->w, h = ec->h;
433 else
434 {
435 switch (e_config->maximize_policy & E_MAXIMIZE_TYPE)
436 {
437 case E_MAXIMIZE_FULLSCREEN:
438 w = ec->zone->w, h = ec->zone->h;
439 break;
440 default:
441 e_zone_useful_geometry_get(ec->zone, NULL, NULL, &w, &h);
442 }
428 } 443 }
444
445 ec->comp_data->shell.set.maximize = 1;
446 ec->comp_data->shell.set.unmaximize = 0;
447 edges = (WL_SHELL_SURFACE_RESIZE_TOP | WL_SHELL_SURFACE_RESIZE_LEFT);
448 wl_shell_surface_send_configure(resource, edges, w, h);
429} 449}
430 450
431static void 451static void
@@ -574,6 +594,20 @@ _e_shell_surface_map(struct wl_resource *resource)
574 } 594 }
575 if (e_object_is_del(E_OBJECT(ec))) return; 595 if (e_object_is_del(E_OBJECT(ec))) return;
576 596
597 if (ec->comp_data->map_maximized)
598 {
599 unsigned int edges = 0;
600
601 ec->comp_data->shell.set.maximize = 1;
602 ec->comp_data->shell.set.unmaximize = 0;
603
604 e_client_maximize(ec, ((e_config->maximize_policy & E_MAXIMIZE_TYPE) |
605 E_MAXIMIZE_BOTH));
606
607 edges = (WL_SHELL_SURFACE_RESIZE_TOP | WL_SHELL_SURFACE_RESIZE_LEFT);
608 wl_shell_surface_send_configure(resource, edges, ec->w, ec->h);
609 }
610
577 /* map this surface if needed */ 611 /* map this surface if needed */
578 if ((!ec->comp_data->mapped) && (e_pixmap_usable_get(ec->pixmap))) 612 if ((!ec->comp_data->mapped) && (e_pixmap_usable_get(ec->pixmap)))
579 { 613 {