discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=992e04feb29b0b30633b2c963e500e1d6c22cd1d

commit 992e04feb29b0b30633b2c963e500e1d6c22cd1d
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Tue Apr 5 16:54:04 2016 -0400

    wayland client maximize/fullscreen cleanups
    
    ref da74e690f0139aa85272314f1d688a717c52668c
---
 src/bin/e_comp_wl.c                       | 20 +++++++++++++++++---
 src/modules/wl_desktop_shell/e_mod_main.c | 11 ++++++++---
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 0617a3a..64dd509 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 57ca1bc..ba385a7 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

-- 


Reply via email to