add new version of efl sync proto between comp and client.
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 31 Mar 2011 08:13:14 +0000 (08:13 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 31 Mar 2011 08:13:14 +0000 (08:13 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@58220 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_evas/ecore_evas_x.c
src/lib/ecore_x/Ecore_X.h
src/lib/ecore_x/xlib/ecore_x_e.c

index 9dfbf6c..f1d0b54 100644 (file)
@@ -3016,6 +3016,21 @@ _ecore_evas_x_flush_post(void *data, Evas *e __UNUSED__, void *event_info __UNUS
 {
    Ecore_Evas *ee = data;
 
+   if ((!ee->no_comp_sync) &&
+       (_ecore_evas_app_comp_sync))
+     {
+        if (ee->engine.x.sync_counter)
+          {
+             if (ee->engine.x.sync_began)
+               {
+                  if (!ee->engine.x.sync_cancel)
+                    {
+                       ecore_x_e_comp_sync_draw_size_done_send
+                          (ee->engine.x.win_root, ee->prop.window, ee->w, ee->h);
+                    }
+               }
+          }
+     }
    if (ee->engine.x.netwm_sync_set)
      {
         ecore_x_sync_counter_2_set(ee->engine.x.netwm_sync_counter, 
@@ -3023,19 +3038,6 @@ _ecore_evas_x_flush_post(void *data, Evas *e __UNUSED__, void *event_info __UNUS
                                    ee->engine.x.netwm_sync_val_lo);
         ee->engine.x.netwm_sync_set = 0;
      }
-   if (ee->no_comp_sync) return;
-   if (!_ecore_evas_app_comp_sync) return;
-   if (ee->engine.x.sync_counter)
-     {
-        if (ee->engine.x.sync_began)
-          {
-             if (!ee->engine.x.sync_cancel)
-               {
-                  ecore_x_e_comp_sync_draw_done_send(ee->engine.x.win_root, 
-                                                     ee->prop.window);
-               }
-          }
-     }
 }
 #endif
 
index 6c7da95..0e21770 100644 (file)
@@ -2219,6 +2219,11 @@ EAPI Ecore_X_Sync_Counter                 ecore_x_e_comp_sync_counter_get(
 EAPI void                                 ecore_x_e_comp_sync_draw_done_send(
    Ecore_X_Window root,
    Ecore_X_Window win);
+EAPI void                                 ecore_x_e_comp_sync_draw_size_done_send(
+   Ecore_X_Window root,
+   Ecore_X_Window win,
+   int w,
+   int h);
 EAPI void                                 ecore_x_e_comp_sync_supported_set(
    Ecore_X_Window root,
    Eina_Bool      enabled);
index 81097de..2f8dd84 100644 (file)
@@ -800,7 +800,7 @@ ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root, Ecore_X_Window win)
    xev.xclient.message_type = ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE;
    xev.xclient.format = 32;
    xev.xclient.data.l[0] = win;
-   xev.xclient.data.l[1] = 0; // later
+   xev.xclient.data.l[1] = 0; // version
    xev.xclient.data.l[2] = 0; // later
    xev.xclient.data.l[3] = 0; // later
    xev.xclient.data.l[4] = 0; // later
@@ -811,6 +811,31 @@ ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root, Ecore_X_Window win)
 } /* ecore_x_e_comp_sync_draw_done_send */
 
 EAPI void
+ecore_x_e_comp_sync_draw_size_done_send(Ecore_X_Window root, Ecore_X_Window win, int w, int h)
+{
+   XEvent xev;
+
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   if (!root)
+      root = DefaultRootWindow(_ecore_x_disp);
+
+   xev.xclient.type = ClientMessage;
+   xev.xclient.display = _ecore_x_disp;
+   xev.xclient.window = win;
+   xev.xclient.message_type = ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE;
+   xev.xclient.format = 32;
+   xev.xclient.data.l[0] = win;
+   xev.xclient.data.l[1] = 1; // version
+   xev.xclient.data.l[2] = w; // win width at draw time
+   xev.xclient.data.l[3] = h; // win height at draw time
+   xev.xclient.data.l[4] = 0; // later
+
+   XSendEvent(_ecore_x_disp, root, False,
+              SubstructureRedirectMask | SubstructureNotifyMask,
+              &xev);
+} /* ecore_x_e_comp_sync_draw_done_send */
+
+EAPI void
 ecore_x_e_comp_sync_supported_set(Ecore_X_Window root, Eina_Bool enabled)
 {
    Ecore_X_Window win;