discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=4cbf81b1e8ccccc31f919b3d6bd6485cc17686df

commit 4cbf81b1e8ccccc31f919b3d6bd6485cc17686df
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Mon Apr 11 14:28:31 2016 -0400

    add E_Client->saved.frame to handle mismatched csd states
    
    if csd exists in only one of (before || after) a maximize/fullscreen,
    this provides info so that the right size can be used when restoring
    geometry
    
    ...again
---
 src/bin/e_client.c      | 26 +++++++++++++++++++++-----
 src/bin/e_client.h      |  1 +
 src/bin/e_comp_object.c |  2 ++
 3 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index 513cbe7..e901551 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -3801,6 +3801,7 @@ e_client_maximize(E_Client *ec, E_Maximize max)
      }
 
    ec->saved.zone = ec->zone->num;
+   ec->saved.frame = e_comp_object_frame_exists(ec->frame) || 
(!e_comp_object_frame_allowed(ec->frame));
 
    ec->maximize_override = 1;
    if ((max & E_MAXIMIZE_TYPE) == E_MAXIMIZE_FULLSCREEN)
@@ -3960,14 +3961,20 @@ e_client_unmaximize(E_Client *ec, E_Maximize max)
                ec->maximize_override = 1;
              evas_object_smart_callback_call(ec->frame, "unmaximize", NULL);
              e_client_resize_limit(ec, &w, &h);
-             e_comp_object_frame_xy_adjust(ec->frame, x, y, &x, &y);
-             e_comp_object_frame_wh_adjust(ec->frame, w, h, &w, &h);
+             if (ec->saved.frame &&
+               (e_comp_object_frame_exists(ec->frame) || 
(!e_comp_object_frame_allowed(ec->frame))))
+               {
+                  e_comp_object_frame_xy_adjust(ec->frame, x, y, &x, &y);
+                  e_comp_object_frame_wh_adjust(ec->frame, w, h, &w, &h);
+               }
              if (!_e_client_maximize_run(ec, x, y, w, h))
                ec->maximize_override = 0;
              if (vert)
                ec->saved.h = ec->saved.y = 0;
              if (horiz)
                ec->saved.w = ec->saved.x = 0;
+             if (vert && horiz)
+               ec->saved.frame = 0;
           }
         e_hints_window_maximized_set(ec, ec->maximized & E_MAXIMIZE_HORIZONTAL,
                                      ec->maximized & E_MAXIMIZE_VERTICAL);
@@ -4014,6 +4021,7 @@ e_client_fullscreen(E_Client *ec, E_Fullscreen policy)
      }
    ec->saved.maximized = ec->maximized;
    ec->saved.zone = ec->zone->num;
+   ec->saved.frame = e_comp_object_frame_exists(ec->frame) || 
(!e_comp_object_frame_allowed(ec->frame));
 
    if (ec->maximized)
      {
@@ -4022,6 +4030,7 @@ e_client_fullscreen(E_Client *ec, E_Fullscreen policy)
         ec->saved.y = y;
         ec->saved.w = w;
         ec->saved.h = h;
+        ec->saved.frame = e_comp_object_frame_exists(ec->frame) || 
(!e_comp_object_frame_allowed(ec->frame));
      }
 
    ec->saved.layer = ec->layer;
@@ -4079,9 +4088,16 @@ e_client_unfullscreen(E_Client *ec)
      _e_client_frame_update(ec);
    ec->fullscreen_policy = 0;
    evas_object_smart_callback_call(ec->frame, "unfullscreen", NULL);
-   e_client_util_move_resize_without_frame(ec, ec->zone->x + ec->saved.x,
-                                           ec->zone->y + ec->saved.y,
-                                           ec->saved.w, ec->saved.h);
+   if (ec->saved.frame &&
+     (e_comp_object_frame_exists(ec->frame) || 
(!e_comp_object_frame_allowed(ec->frame))))
+     e_client_util_move_resize_without_frame(ec, ec->zone->x + ec->saved.x,
+                                             ec->zone->y + ec->saved.y,
+                                             ec->saved.w, ec->saved.h);
+   else
+      evas_object_geometry_set(ec->frame, ec->zone->x + ec->saved.x,
+                                              ec->zone->y + ec->saved.y,
+                                              ec->saved.w, ec->saved.h);
+   ec->saved.frame = 0;
 
    if (ec->saved.maximized)
      e_client_maximize(ec, (e_config->maximize_policy & E_MAXIMIZE_TYPE) |
diff --git a/src/bin/e_client.h b/src/bin/e_client.h
index ae48192..e2d83fc 100644
--- a/src/bin/e_client.h
+++ b/src/bin/e_client.h
@@ -310,6 +310,7 @@ struct E_Client
       E_Layer      layer;
       int          zone;
       E_Maximize   maximized;
+      Eina_Bool    frame : 1;
    } saved;
 
    struct
diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c
index e0159a2..c856415 100644
--- a/src/bin/e_comp_object.c
+++ b/src/bin/e_comp_object.c
@@ -3096,6 +3096,8 @@ e_comp_object_frame_geometry_set(Evas_Object *obj, int l, 
int r, int t, int b)
      {
         cw->ec->w += (l + r) - (cw->client_inset.l + cw->client_inset.r);
         cw->ec->h += (t + b) - (cw->client_inset.t + cw->client_inset.b);
+        if (cw->ec->maximized || cw->ec->fullscreen)
+          cw->ec->saved.frame = 0;
      }
    else if (cw->ec->maximized || cw->ec->fullscreen)
      {

-- 


Reply via email to