Re: Wimp tab rendering patch



On Sun, 2007-04-01 at 11:03 +0200, Arnaud Charlet wrote:
> > When the tabs are on the left, right, or bottom then the results are
> > worse.
> 
> Right, that's the main issue with this patch. Strange that I get not so
> good results even with top tabs.
> 
> > The bug #399253 is, I think, a separate issue.. that happens
> > when the notebook receives expose events or something.  As it is right
> > now (without your patch), the tabs look pretty decent when they're first
> > drawn or when the entire widget exposes.. but when it receives partial
> > expose events it gets really screwed up.  I tried looking into that, but
> > didn't put much time into it.
> 
> In the mean time, I've reverted the draw_extension function in msw_style.c
> to what it was in Gtk+ 2.8.20 to avoid this very annoying (to us) glitch,
> seems to be good enough for now, and certainly better than having bad redraws.

Arno,

Instead of doing that, can you test this patch and see if it solves
these problems for you?  Let me know if you have any problems.  If not
I'll try to commit this to svn soon.

/ Cody
Index: msw_style.c
===================================================================
--- msw_style.c	(revision 17574)
+++ msw_style.c	(working copy)
@@ -2466,18 +2466,12 @@
 	      }
 	    else if (real_gap_side == GTK_POS_BOTTOM)
 	      {
-		x2 = x;
-		y2 = y + (state_type == GTK_STATE_NORMAL ? 0 : notebook->tab_vborder);
+		x2 = 0;
+		y2 = 0;
 		w2 = width;
 		h2 = height - (state_type == GTK_STATE_NORMAL ? 0 : notebook->tab_vborder * 2);
-		target = window;
-
-		/* If we are currently drawing the right-most tab (any state)... */
-		if (widget->allocation.x + widget->allocation.width - border_width == x + width)
-		  {
-		    x2--;
-		    w2--;
-		  }
+		pixmap = gdk_pixmap_new (window, w2, h2, -1);
+		target = pixmap;
 	      }
 
 	    if (xp_theme_draw (target, tab_part, style, x2, y2, w2, h2, state_type, NULL /*area*/))
@@ -2526,6 +2520,19 @@
 				   h2--;
 				 }
 			     }
+                           else if (real_gap_side == GTK_POS_BOTTOM)
+                             {
+				x2 = x;
+				y2 = y + (state_type == GTK_STATE_NORMAL ? 0 : notebook->tab_vborder);
+				w2 = width;
+				h2 = height - (state_type == GTK_STATE_NORMAL ? 0 : notebook->tab_vborder * 2);
+				/* If we are currently drawing the right-most tab (any state)... */
+				if (widget->allocation.x + widget->allocation.width - border_width == x + width)
+				  {
+				    x2--;
+				    w2--;
+				  }
+                             }
 
 			   gdk_draw_pixbuf (window, NULL, pixbuf, 0, 0, x2, y2, w2, h2, GDK_RGB_DITHER_NONE, 0, 0);
 
Index: xp_theme.c
===================================================================
--- xp_theme.c	(revision 17574)
+++ xp_theme.c	(working copy)
@@ -746,6 +746,7 @@
 	case XP_THEME_ELEMENT_LINE_H:
 	    switch (state)
 		{
+		default:
 		    /* LHS_FLAT, LHS_RAISED, LHS_SUNKEN */
 		    ret = LHS_RAISED;
 		    break;
@@ -755,6 +756,7 @@
 	case XP_THEME_ELEMENT_LINE_V:
 	    switch (state)
 		{
+		default:
 		    /* LVS_FLAT, LVS_RAISED, LVS_SUNKEN */
 		    ret = LVS_RAISED;
 		    break;


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