rpms/gtk2/F-12 fresh-tooltips.patch,1.4,1.5 gtk2.spec,1.425,1.426

Matthias Clasen mclasen at fedoraproject.org
Wed Oct 28 16:18:40 UTC 2009


Author: mclasen

Update of /cvs/pkgs/rpms/gtk2/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv22841

Modified Files:
	fresh-tooltips.patch gtk2.spec 
Log Message:
Improve tooltip sharpness


fresh-tooltips.patch:
 gtktooltip.c |  276 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 257 insertions(+), 19 deletions(-)

Index: fresh-tooltips.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gtk2/F-12/fresh-tooltips.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- fresh-tooltips.patch	23 Oct 2009 21:25:41 -0000	1.4
+++ fresh-tooltips.patch	28 Oct 2009 16:18:39 -0000	1.5
@@ -1,7 +1,17 @@
-diff -up gtk+-2.18.3/gtk/gtktooltip.c.fresh-tooltips gtk+-2.18.3/gtk/gtktooltip.c
 --- gtk+-2.18.3/gtk/gtktooltip.c.fresh-tooltips	2009-10-16 10:35:45.000000000 -0400
-+++ gtk+-2.18.3/gtk/gtktooltip.c	2009-10-23 17:18:46.556129731 -0400
-@@ -95,6 +95,7 @@ static void       gtk_tooltip_display_cl
++++ hacked/gtk/gtktooltip.c	2009-10-28 11:45:17.216105152 -0400
+@@ -29,6 +29,10 @@
+ #include "gtkhbox.h"
+ #include "gtkalignment.h"
+ 
++#ifdef GDK_WINDOWING_X11
++#include "gdk/x11/gdkx.h"
++#endif
++
+ #include "gtkalias.h"
+ 
+ #include <string.h>
+@@ -95,6 +99,7 @@
  						    GtkTooltip      *tooltip);
  static void       gtk_tooltip_set_last_window      (GtkTooltip      *tooltip,
  						    GdkWindow       *window);
@@ -9,7 +19,7 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.fr
  
  
  G_DEFINE_TYPE (GtkTooltip, gtk_tooltip, G_TYPE_OBJECT);
-@@ -110,8 +111,25 @@ gtk_tooltip_class_init (GtkTooltipClass 
+@@ -110,8 +115,25 @@
  }
  
  static void
@@ -35,7 +45,7 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.fr
    tooltip->timeout_id = 0;
    tooltip->browse_mode_timeout_id = 0;
  
-@@ -127,8 +145,15 @@ gtk_tooltip_init (GtkTooltip *tooltip)
+@@ -127,8 +149,17 @@
    tooltip->last_window = NULL;
  
    tooltip->window = g_object_ref (gtk_window_new (GTK_WINDOW_POPUP));
@@ -45,13 +55,15 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.fr
 +  if (rgba)
 +    gtk_widget_set_colormap (tooltip->window, rgba);
 +
++#if 0
    gtk_window_set_type_hint (GTK_WINDOW (tooltip->window),
  			    GDK_WINDOW_TYPE_HINT_TOOLTIP);
++#endif
 +
    gtk_widget_set_app_paintable (tooltip->window, TRUE);
    gtk_window_set_resizable (GTK_WINDOW (tooltip->window), FALSE);
    gtk_widget_set_name (tooltip->window, "gtk-tooltip");
-@@ -145,7 +170,7 @@ gtk_tooltip_init (GtkTooltip *tooltip)
+@@ -145,7 +176,7 @@
    gtk_widget_show (tooltip->alignment);
  
    g_signal_connect_swapped (tooltip->window, "style-set",
@@ -60,7 +72,7 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.fr
    g_signal_connect_swapped (tooltip->window, "expose-event",
  			    G_CALLBACK (gtk_tooltip_paint_window), tooltip);
  
-@@ -162,6 +187,11 @@ gtk_tooltip_init (GtkTooltip *tooltip)
+@@ -162,6 +193,11 @@
    gtk_box_pack_start (GTK_BOX (tooltip->box), tooltip->label,
  		      FALSE, FALSE, 0);
  
@@ -72,7 +84,7 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.fr
    tooltip->custom_widget = NULL;
  }
  
-@@ -318,9 +348,9 @@ gtk_tooltip_set_icon_from_stock (GtkTool
+@@ -318,9 +354,9 @@
   * Since: 2.14
   */
  void
@@ -85,7 +97,7 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.fr
  {
    g_return_if_fail (GTK_IS_TOOLTIP (tooltip));
  
-@@ -471,27 +501,213 @@ static void
+@@ -471,27 +507,229 @@
  gtk_tooltip_window_style_set (GtkTooltip *tooltip)
  {
    gtk_alignment_set_padding (GTK_ALIGNMENT (tooltip->alignment),
@@ -172,9 +184,9 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.fr
 +  cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
 +
 +  draw_round_rect (cr,
-+                   1.0, 1, 1, radius,
-+                   widget->allocation.width - 2,
-+                   widget->allocation.height - 2);
++                   1.0, 0.5, 0.5, radius,
++                   widget->allocation.width - 1,
++                   widget->allocation.height - 1);
 +
 +  color = widget->style->bg [GTK_STATE_NORMAL];
 +  r = (float)color.red / 65535.0;
@@ -196,10 +208,12 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.fr
 +static void
 +update_shape (GtkTooltip *tooltip)
 +{
++  GdkScreen *screen;
 +  GdkBitmap *mask;
 +  cairo_t *cr;
 +  gint width, height;
 +  gboolean new_style;
++  gint radius;
 +
 +  gtk_widget_style_get (tooltip->window, "new-tooltip-style", &new_style, NULL);
 +
@@ -209,20 +223,30 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.fr
 +     return;
 +    }
 +
++  screen = gtk_widget_get_screen (tooltip->window);
++
 +  gtk_window_get_size (GTK_WINDOW (tooltip->window), &width, &height);
 +
-+  if (gdk_screen_is_composited (gtk_widget_get_screen (tooltip->window)))
++  if (gdk_screen_is_composited (screen))
 +    {
 +      GdkRectangle rect;
 +      GdkRegion *region;
++      const char *wm;
 +
-+#if 0
 +      gtk_widget_shape_combine_mask (tooltip->window, NULL, 0, 0);
-+     return;
-+#endif
-+      /* This is a hack to keep the metacity compositor from slapping a
++#ifdef GDK_WINDOWING_X11
++      /* This is a hack to keep the Metacity compositor from slapping a
 +       * non-shaped shadow around the shaped tooltip
 +       */
++      if (!GTK_WIDGET_MAPPED (tooltip->window))
++        {
++          wm = gdk_x11_screen_get_window_manager_name (screen);
++          if (g_strcmp0 (wm, "Metacity") == 0)
++            gtk_window_set_type_hint (GTK_WINDOW (tooltip->window),
++			              GDK_WINDOW_TYPE_HINT_DND);
++        }
++#endif
++#if 0
 +      if (tooltip->window->window)
 +        {
 +          rect.x = 0;
@@ -233,9 +257,13 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.fr
 +          gdk_window_shape_combine_region (tooltip->window->window, region, 0, 0);
 +          gdk_region_destroy (region);
 +        }
++#endif
 +      return;
 +    }
 +
++  radius = MIN (tooltip->window->style->xthickness,
++                tooltip->window->style->ythickness);
++  radius = MAX (radius, 1);
 +  mask = (GdkBitmap *) gdk_pixmap_new (NULL, width, height, 1);
 +  cr = gdk_cairo_create (mask);
 +  if (cairo_status (cr) == CAIRO_STATUS_SUCCESS)
@@ -245,7 +273,7 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.fr
 +
 +      cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
 +      cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
-+      draw_round_rect (cr, 1.0, 0, 0, 4, width, height);
++      draw_round_rect (cr, 1.0, 0, 0, radius + 1, width, height);
 +      cairo_fill (cr);
 +
 +      gtk_widget_shape_combine_mask (tooltip->window, mask, 0, 0);
@@ -313,7 +341,7 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.fr
  
    return FALSE;
  }
-@@ -631,7 +847,7 @@ find_widget_under_pointer (GdkWindow *wi
+@@ -631,7 +869,7 @@
  
  #ifdef DEBUG_TOOLTIP
    g_print ("event window %p (belonging to %p (%s))  (%d, %d)\n",
@@ -322,21 +350,3 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.fr
  	   *x, *y);
  #endif
  
-diff -up gtk+-2.18.3/gtk/gtkwidget.c.fresh-tooltips gtk+-2.18.3/gtk/gtkwidget.c
---- gtk+-2.18.3/gtk/gtkwidget.c.fresh-tooltips	2009-10-23 17:15:46.311135255 -0400
-+++ gtk+-2.18.3/gtk/gtkwidget.c	2009-10-23 17:16:11.050128828 -0400
-@@ -2386,6 +2386,14 @@ gtk_widget_class_init (GtkWidgetClass *k
-                                                              P_("The length of vertical scroll arrows"),
-                                                              1, G_MAXINT, 16,
-                                                              GTK_PARAM_READABLE));
-+
-+  gtk_widget_class_install_style_property (klass,
-+                                           g_param_spec_boolean ("new-tooltip-style",
-+                                                                 NULL,
-+                                                                 NULL,
-+                                                                 FALSE,
-+                                                                 GTK_PARAM_READABLE));
-+
- }
- 
- static void


Index: gtk2.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gtk2/F-12/gtk2.spec,v
retrieving revision 1.425
retrieving revision 1.426
diff -u -p -r1.425 -r1.426
--- gtk2.spec	26 Oct 2009 05:03:58 -0000	1.425
+++ gtk2.spec	28 Oct 2009 16:18:39 -0000	1.426
@@ -17,7 +17,7 @@
 Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
 Name: gtk2
 Version: %{base_version}
-Release: 12%{?dist}
+Release: 13%{?dist}
 License: LGPLv2+
 Group: System Environment/Libraries
 Source: http://download.gnome.org/sources/gtk+/2.18/gtk+-%{version}.tar.bz2
@@ -34,7 +34,6 @@ Patch2: icon-padding.patch
 Patch3: image-size-alloc.patch
 # https://bugzilla.gnome.org/show_bug.cgi?id=599617
 Patch4: fresh-tooltips.patch
-Patch5: zerosize.patch
 # from upstream
 Patch6: compose-sequences.patch
 # from upstream
@@ -160,7 +159,6 @@ This package contains developer document
 %patch2 -p1 -b .icon-padding
 %patch3 -p1 -b .image-size-alloc
 %patch4 -p1 -b .fresh-tooltips
-%patch5 -p1 -b .zerosize
 %patch6 -p1 -b .compose-sequences
 %patch7 -p1 -b .symbolic-color-parsing
 %patch8 -p1 -b .tooltip-positioning
@@ -402,6 +400,10 @@ fi
 
 
 %changelog
+* Wed Oct 28 2009 Matthias Clasen <mclasen at redhta.com> - 2.18.3-13
+- Make the new tooltips sharp
+- Improve the Metacity compositor workaround for new tooltips
+
 * Mon Oct 26 2009 Matthias Clasen <mclasen at redhta.com> - 2.18.3-12
 - Fix a possible assertion failure in GtkToolButton
 




More information about the scm-commits mailing list