Re: DnD target outline clipping issues



On Fri, 2009-06-26 at 14:34 +0200, Alexander Larsson wrote:
> I just debugged this client-side-window failure:
> 
> http://tbzatek.fedorapeople.org/csw/Screenshot-Evolution-drag.png
> 
> Basically, with client side windows you get (got) the DnD outline when
> dragging a dnd over the treeview. The weird thing about this bug is that
> you don't really expect it to *not* happen for the native window case.
> 
> Turns out that the client-side-window bug was that non-double-buffered
> cairo rendering did not clip against child client-side windows, whereas
> cairo drawing does clip against native child windows. This has now been
> fixed in the client-side-windows branch.
> 
> However, is it really right that drag outlines are never shown on
> treeviews? We do draw it, but the child window of the treeview widget
> causes it to clipped. Maybe we need to fix gtk_drag_highlight() /
> gtk_drag_highlight_expose()?
> 
> Opinions?

Turns out this patch fixes it:

diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 8bbb4d2..b8cf9c3 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -1120,12 +1120,12 @@ gtk_drag_highlight_expose (GtkWidget
*widget,
          gdk_drawable_get_size (widget->window, &width, &height);
        }
       
-      gtk_paint_shadow (widget->style, widget->window,
+      gtk_paint_shadow (widget->style, event->window,
                        GTK_STATE_NORMAL, GTK_SHADOW_OUT,
                        &event->area, widget, "dnd",
                        x, y, width, height);
 
-      cr = gdk_cairo_create (widget->window);
+      cr = gdk_cairo_create (event->window);
       cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); /* black */
       cairo_set_line_width (cr, 1.0);
       cairo_rectangle (cr,






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]