rpms/metacity/F-12 fresh-tooltips.patch, 1.1, 1.2 metacity.spec, 1.206, 1.207

Matthias Clasen mclasen at fedoraproject.org
Wed Oct 28 16:39:33 UTC 2009


Author: mclasen

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

Modified Files:
	fresh-tooltips.patch metacity.spec 
Log Message:
Make tooltips sharper


fresh-tooltips.patch:
 fixedtip.c |  215 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 198 insertions(+), 17 deletions(-)

Index: fresh-tooltips.patch
===================================================================
RCS file: /cvs/pkgs/rpms/metacity/F-12/fresh-tooltips.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- fresh-tooltips.patch	21 Oct 2009 20:45:18 -0000	1.1
+++ fresh-tooltips.patch	28 Oct 2009 16:39:33 -0000	1.2
@@ -1,6 +1,7 @@
---- metacity-2.28.0/src/ui/fixedtip.c	2009-10-21 16:28:48.651819365 -0400
-+++ hacked/src/ui/fixedtip.c	2009-10-21 16:40:27.148814794 -0400
-@@ -50,13 +50,174 @@
+diff -up metacity-2.28.0/src/ui/fixedtip.c.fresh-tooltips metacity-2.28.0/src/ui/fixedtip.c
+--- metacity-2.28.0/src/ui/fixedtip.c.fresh-tooltips	2009-10-28 12:23:19.134105834 -0400
++++ metacity-2.28.0/src/ui/fixedtip.c	2009-10-28 12:30:04.565110123 -0400
+@@ -50,33 +50,195 @@ static int screen_right_edge = 0;
   */
  static int screen_bottom_edge = 0;
  
@@ -74,9 +75,9 @@
 +  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;
@@ -101,32 +102,19 @@
 +  GdkBitmap *mask;
 +  cairo_t *cr;
 +  gint width, height;
++  gint radius;
 +
 +  gtk_window_get_size (GTK_WINDOW (window), &width, &height);
 +
 +  if (gdk_screen_is_composited (gtk_widget_get_screen (window)))
 +    {
-+      GdkRectangle rect;
-+      GdkRegion *region;
-+
-+#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
-+ *        * non-shaped shadow around the shaped tooltip
-+ *               */
-+      rect.x = 0;
-+      rect.y = 0;
-+      rect.width = width;
-+      rect.height = height;
-+      region = gdk_region_rectangle (&rect);
-+      gdk_window_shape_combine_region (window->window, region, 0, 0);
-+      gdk_region_destroy (region);
-+
++      gtk_widget_shape_combine_mask (window, NULL, 0, 0);
 +      return;
 +    }
 +
++  radius = MIN (window->style->xthickness, 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)
@@ -136,7 +124,7 @@
 +
 +      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 (window, mask, 0, 0);
@@ -180,7 +168,24 @@
  
    return FALSE;
  }
-@@ -67,9 +228,10 @@
+ 
++#if 0
++static void
++on_composited_changed (GtkWidget *window)
++{
++  update_shape (window);
++}
++
++static void
++on_realized (GtkWidget *window)
++{
++  update_shape (window);
++}
++#endif
++
+ void
+ meta_fixed_tip_show (Display *xdisplay, int screen_number,
+                      int root_x, int root_y,
                       const char *markup_text)
  {
    int w, h;
@@ -191,9 +196,9 @@
 -    {      
 +    {
        tip = gtk_window_new (GTK_WINDOW_POPUP);
-       gtk_window_set_type_hint (GTK_WINDOW(tip), GDK_WINDOW_TYPE_HINT_TOOLTIP);
- 
-@@ -77,6 +239,7 @@
+-      gtk_window_set_type_hint (GTK_WINDOW(tip), GDK_WINDOW_TYPE_HINT_TOOLTIP);
+-
+       {
          GdkScreen *gdk_screen;
  	GdkRectangle monitor;
  	gint mon_num;
@@ -201,7 +206,7 @@
  
          gdk_screen = gdk_display_get_screen (gdk_display_get_default (),
                                               screen_number);
-@@ -86,22 +249,34 @@
+@@ -86,22 +248,41 @@ meta_fixed_tip_show (Display *xdisplay, 
  	gdk_screen_get_monitor_geometry (gdk_screen, mon_num, &monitor);
  	screen_right_edge = monitor.x + monitor.width;
  	screen_bottom_edge = monitor.y + monitor.height;
@@ -209,6 +214,13 @@
 +        rgba = gdk_screen_get_rgba_colormap (gdk_screen);
 +        if (rgba)
 +          gtk_widget_set_colormap (tip, rgba);
++
++#if 0
++        g_signal_connect (tip, "composited-changed",
++                          G_CALLBACK (on_composited_changed), NULL);
++        g_signal_connect (tip, "realize",
++                          G_CALLBACK (on_realized), NULL);
++#endif
        }
 -      
 +


Index: metacity.spec
===================================================================
RCS file: /cvs/pkgs/rpms/metacity/F-12/metacity.spec,v
retrieving revision 1.206
retrieving revision 1.207
diff -u -p -r1.206 -r1.207
--- metacity.spec	21 Oct 2009 20:45:18 -0000	1.206
+++ metacity.spec	28 Oct 2009 16:39:33 -0000	1.207
@@ -1,7 +1,7 @@
 Summary: Unobtrusive window manager
 Name: metacity
 Version: 2.28.0
-Release: 4%{?dist}
+Release: 5%{?dist}
 URL: http://download.gnome.org/sources/metacity/
 Source0: http://download.gnome.org/sources/metacity/2.28/metacity-%{version}.tar.bz2
 # http://bugzilla.gnome.org/show_bug.cgi?id=558723
@@ -194,6 +194,9 @@ fi
 %{_mandir}/man1/metacity-window-demo.1.gz
 
 %changelog
+* Wed Oct 28 2009 Matthias Clasen <mclasen at redhat.cm> - 2.28.0-5
+- Make tooltips look sharper
+
 * Wed Oct 21 2009 Matthias Clasen <mclasen at redhat.cm> - 2.28.0-4
 - Make tooltips look match GTK+
 




More information about the fedora-extras-commits mailing list