discomfitor pushed a commit to branch enlightenment-0.19.

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

commit 3e5d970c2fdc34919c5d8088980e31a60492000f
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Sat Nov 7 13:10:02 2015 -0500

    toggle x11 client iconic/mapped state based on mirror visibility
    
    in order to continue rendering an iconic client without breaking icccm,
    it's necessary to map the client's window again and unset iconic state
    whenever rendering is needed, then re-set states when rendering
    stops
    
    ref T2788
---
 src/bin/e_comp_x.c | 30 +++++++++++++++++++++++++++---
 src/bin/e_comp_x.h |  1 +
 2 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c
index 4f89ca6..1ac8521 100644
--- a/src/bin/e_comp_x.c
+++ b/src/bin/e_comp_x.c
@@ -945,9 +945,10 @@ _e_comp_x_client_hide(E_Client *ec)
    if ((!ec->iconic) && (!ec->override))
      ecore_x_window_prop_card32_set(e_client_util_win_get(ec), E_ATOM_MAPPED, 
&visible, 1);
 
-   if (ec->unredirected_single || ec->iconic)
+   ec->comp_data->iconic = ec->iconic && 
(!e_comp_object_mirror_visibility_check(ec->frame));
+   if (ec->unredirected_single || ec->comp_data->iconic)
      ecore_x_window_hide(_e_comp_x_client_window_get(ec));
-   if (ec->iconic)
+   if (ec->comp_data->iconic)
      e_hints_window_iconic_set(ec);
 }
 
@@ -979,10 +980,11 @@ _e_comp_x_client_show(E_Client *ec)
    ecore_x_window_shadow_tree_flush();
    if (!ec->comp_data->need_reparent)
      ecore_x_window_show(win);
-   if (ec->unredirected_single || ec->iconic)
+   if (ec->unredirected_single || ec->comp_data->iconic)
      {
         e_pixmap_clear(ec->pixmap);
         ecore_x_window_show(_e_comp_x_client_window_get(ec));
+        ec->comp_data->iconic = 0;
      }
    if (!ec->override)
      e_hints_window_visible_set(ec);
@@ -1152,6 +1154,26 @@ _e_comp_x_resize_request(void *data EINA_UNUSED, int 
type EINA_UNUSED, Ecore_X_E
 }
 
 static void
+_e_comp_x_evas_mirror_hidden(void *data, Evas_Object *obj EINA_UNUSED, void 
*event_info EINA_UNUSED)
+{
+   E_Client *ec = data;
+
+   if ((!ec->iconic) || (!ec->comp_data->iconic)) return;
+   if (ec->comp_data)
+     _e_comp_x_client_hide(ec);
+}
+
+static void
+_e_comp_x_evas_mirror_visible(void *data, Evas_Object *obj EINA_UNUSED, void 
*event_info EINA_UNUSED)
+{
+   E_Client *ec = data;
+
+   if ((!ec->iconic) || ec->comp_data->iconic) return;
+   if (ec->comp_data)
+     _e_comp_x_client_show(ec);
+}
+
+static void
 _e_comp_x_client_evas_init(E_Client *ec)
 {
    if (ec->comp_data->evas_init) return;
@@ -1173,6 +1195,8 @@ _e_comp_x_client_evas_init(E_Client *ec)
    evas_object_smart_callback_add(ec->frame, "color_set", 
_e_comp_x_evas_color_set_cb, ec);
    evas_object_smart_callback_add(ec->frame, "fullscreen_zoom", 
_e_comp_x_evas_fullscreen_zoom_cb, ec);
    evas_object_smart_callback_add(ec->frame, "unfullscreen_zoom", 
_e_comp_x_evas_unfullscreen_zoom_cb, ec);
+   evas_object_smart_callback_add(ec->frame, "visibility_force", 
_e_comp_x_evas_mirror_visible, ec);
+   evas_object_smart_callback_add(ec->frame, "visibility_normal", 
_e_comp_x_evas_mirror_hidden, ec);
    /* force apply this since we haven't set up our smart cb previously */
    _e_comp_x_evas_comp_hidden_cb(ec, NULL, NULL);
 }
diff --git a/src/bin/e_comp_x.h b/src/bin/e_comp_x.h
index 033f31a..3960218 100644
--- a/src/bin/e_comp_x.h
+++ b/src/bin/e_comp_x.h
@@ -107,6 +107,7 @@ struct _E_Comp_X_Client_Data
    Eina_Bool unredirected_single : 1;
    unsigned int parent_activate_count; //number of times a win has activated 
itself when parent was focused
    Eina_Bool fetch_gtk_frame_extents : 1;
+   Eina_Bool iconic : 1;
 };
 
 EINTERN Eina_Bool e_comp_x_init(void);

-- 


Reply via email to