discomfitor pushed a commit to branch master.

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

commit ae7af6b8ef7a29968fafe01017179b12638970fb
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Tue Apr 5 16:52:50 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
---
 src/bin/e_client.c | 27 +++++++++++++++++++++------
 src/bin/e_client.h |  1 +
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index 2ef6a2f..8ad3d04 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -3796,6 +3796,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));
 
    _e_client_maximize(ec, max);
 
@@ -3911,13 +3912,19 @@ 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);
+               }
              _e_client_maximize_run(ec, x, y, w, h);
              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);
@@ -3961,6 +3968,7 @@ e_client_fullscreen(E_Client *ec, E_Fullscreen policy)
         ec->saved.y = ec->client.y - ec->zone->y;
         ec->saved.w = ec->client.w;
         ec->saved.h = ec->client.h;
+        ec->saved.frame = e_comp_object_frame_exists(ec->frame) || 
(!e_comp_object_frame_allowed(ec->frame));
      }
    ec->saved.maximized = ec->maximized;
    ec->saved.zone = ec->zone->num;
@@ -3972,6 +3980,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;
@@ -4029,10 +4038,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) |
                        ec->saved.maximized);
diff --git a/src/bin/e_client.h b/src/bin/e_client.h
index 13d24fd..c73c3db 100644
--- a/src/bin/e_client.h
+++ b/src/bin/e_client.h
@@ -309,6 +309,7 @@ struct E_Client
       E_Layer      layer;
       int          zone;
       E_Maximize   maximized;
+      Eina_Bool frame : 1;
    } saved;
 
    struct

-- 


Reply via email to