devilhorns pushed a commit to branch master.

commit 0950237f04afc261ec4d8f0d63fb82e7bc4fc14f
Author: Chris Michael <[email protected]>
Date:   Tue May 28 11:43:03 2013 +0100

    Don't create a shell surface for DND window types.
    Set surface_user_data in attach function to be the buffer we are
    attaching (NB: Expected by some compositors like weston).
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/ecore_wayland/ecore_wl_window.c | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/src/lib/ecore_wayland/ecore_wl_window.c 
b/src/lib/ecore_wayland/ecore_wl_window.c
index cc1a8df..1abddfc 100644
--- a/src/lib/ecore_wayland/ecore_wl_window.c
+++ b/src/lib/ecore_wayland/ecore_wl_window.c
@@ -150,15 +150,17 @@ ecore_wl_window_resize(Ecore_Wl_Window *win, int w, int 
h, int location)
 
    if (!win) return;
 
-   if (win->type != ECORE_WL_WINDOW_TYPE_FULLSCREEN)
+   if ((win->type != ECORE_WL_WINDOW_TYPE_FULLSCREEN) || 
+       (win->type != ECORE_WL_WINDOW_TYPE_DND))
      {
-        win->allocation.w = w;
-        win->allocation.h = h;
+        /* win->allocation.w = w; */
+        /* win->allocation.h = h; */
 
         win->region.input = 
           wl_compositor_create_region(_ecore_wl_disp->wl.compositor);
-        wl_region_add(win->region.input, win->allocation.x, win->allocation.y, 
-                      win->allocation.w, win->allocation.h);
+        wl_region_add(win->region.input, 
+                      win->allocation.x, win->allocation.y, w, h);
+        /* win->allocation.w, win->allocation.h); */
      }
 
    ecore_wl_window_update_size(win, w, h);
@@ -234,6 +236,7 @@ ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct 
wl_buffer *buffer, in
 
              /* if (buffer) */
              wl_surface_attach(win->surface, buffer, x, y);
+             wl_surface_set_user_data(win->surface, buffer);
              wl_surface_damage(win->surface, 0, 0, 
                                win->allocation.w, win->allocation.h);
              wl_surface_commit(win->surface);
@@ -266,10 +269,13 @@ ecore_wl_window_show(Ecore_Wl_Window *win)
 
    ecore_wl_window_surface_create(win);
 
-   win->shell_surface = 
-     wl_shell_get_shell_surface(_ecore_wl_disp->wl.shell, win->surface);
-   wl_shell_surface_add_listener(win->shell_surface, 
-                                 &_ecore_wl_shell_surface_listener, win);
+   if (win->type != ECORE_WL_WINDOW_TYPE_DND)
+     {
+        win->shell_surface = 
+          wl_shell_get_shell_surface(_ecore_wl_disp->wl.shell, win->surface);
+        wl_shell_surface_add_listener(win->shell_surface, 
+                                      &_ecore_wl_shell_surface_listener, win);
+     }
 
    switch (win->type)
      {
@@ -482,8 +488,7 @@ ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, 
int h)
    if (win->surface)
      wl_surface_set_opaque_region(win->surface, opaque);
 
-   if (opaque)
-        wl_region_destroy(opaque);
+   if (opaque) wl_region_destroy(opaque);
 }
 
 EAPI void 

-- 

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may

Reply via email to