summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@fedoraproject.org>2009-10-28 19:40:01 +0000
committerMatthias Clasen <mclasen@fedoraproject.org>2009-10-28 19:40:01 +0000
commit8a5effe57f253166b4bd2d3b4c5d80315155e010 (patch)
tree525fc29d65ee81aedda51baa7e68b6dabf3a5d2e
parent6802f5a85ae5d0c0a01c34685e493de6911fc902 (diff)
downloadmetacity-8a5effe57f253166b4bd2d3b4c5d80315155e010.tar.gz
metacity-8a5effe57f253166b4bd2d3b4c5d80315155e010.tar.xz
metacity-8a5effe57f253166b4bd2d3b4c5d80315155e010.zip
-rw-r--r--fresh-tooltips.patch84
-rw-r--r--metacity.spec4
2 files changed, 68 insertions, 20 deletions
diff --git a/fresh-tooltips.patch b/fresh-tooltips.patch
index fed0e25..03c2d34 100644
--- a/fresh-tooltips.patch
+++ b/fresh-tooltips.patch
@@ -1,7 +1,7 @@
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;
+--- metacity-2.28.0/src/ui/fixedtip.c.fresh-tooltips 2009-10-28 12:32:09.098105658 -0400
++++ metacity-2.28.0/src/ui/fixedtip.c 2009-10-28 15:33:52.419756065 -0400
+@@ -50,33 +50,237 @@ static int screen_right_edge = 0;
*/
static int screen_bottom_edge = 0;
@@ -103,6 +103,15 @@ diff -up metacity-2.28.0/src/ui/fixedtip.c.fresh-tooltips metacity-2.28.0/src/ui
+ cairo_t *cr;
+ gint width, height;
+ gint radius;
++ gboolean new_style;
++
++ gtk_widget_style_get (window, "new-tooltip-style", &new_style, NULL);
++
++ if (!new_style)
++ {
++ gtk_widget_shape_combine_mask (window, NULL, 0, 0);
++ return;
++ }
+
+ gtk_window_get_size (GTK_WINDOW (window), &width, &height);
+
@@ -146,25 +155,44 @@ diff -up metacity-2.28.0/src/ui/fixedtip.c.fresh-tooltips metacity-2.28.0/src/ui
+ cairo_t *context;
+ cairo_surface_t *surface;
+ cairo_t *cr;
++ gboolean new_style;
+
-+ context = gdk_cairo_create (window->window);
++ gtk_widget_style_get (window, "new-tooltip-style", &new_style, NULL);
+
-+ cairo_set_operator (context, CAIRO_OPERATOR_SOURCE);
-+ surface = cairo_surface_create_similar (cairo_get_target (context),
-+ CAIRO_CONTENT_COLOR_ALPHA,
-+ window->allocation.width,
-+ window->allocation.height);
-+ cr = cairo_create (surface);
++ if (new_style)
++ {
++ context = gdk_cairo_create (window->window);
+
-+ fill_background (window, cr);
++ cairo_set_operator (context, CAIRO_OPERATOR_SOURCE);
++ surface = cairo_surface_create_similar (cairo_get_target (context),
++ CAIRO_CONTENT_COLOR_ALPHA,
++ window->allocation.width,
++ window->allocation.height);
++ cr = cairo_create (surface);
+
-+ cairo_destroy (cr);
-+ cairo_set_source_surface (context, surface, 0, 0);
-+ cairo_paint (context);
-+ cairo_surface_destroy (surface);
-+ cairo_destroy (context);
++ fill_background (window, cr);
+
-+ update_shape (window);
++ cairo_destroy (cr);
++ cairo_set_source_surface (context, surface, 0, 0);
++ cairo_paint (context);
++ cairo_surface_destroy (surface);
++ cairo_destroy (context);
++
++ update_shape (window);
++ }
++ else
++ {
++ gtk_paint_flat_box (window->style,
++ window->window,
++ GTK_STATE_NORMAL,
++ GTK_SHADOW_OUT,
++ NULL,
++ window,
++ "tooltip",
++ 0, 0,
++ window->allocation.width,
++ window->allocation.height);
++ }
return FALSE;
}
@@ -183,6 +211,20 @@ diff -up metacity-2.28.0/src/ui/fixedtip.c.fresh-tooltips metacity-2.28.0/src/ui
+}
+#endif
+
++static void
++on_style_set (GtkWidget *widget, GtkStyle *prev)
++{
++ GtkWidget *alignment;
++
++ alignment = gtk_bin_get_child (GTK_BIN (widget));
++ gtk_alignment_set_padding (GTK_ALIGNMENT (alignment),
++ widget->style->ythickness,
++ widget->style->ythickness,
++ widget->style->xthickness,
++ widget->style->xthickness);
++ gtk_widget_queue_draw (widget);
++}
++
void
meta_fixed_tip_show (Display *xdisplay, int screen_number,
int root_x, int root_y,
@@ -206,7 +248,7 @@ diff -up metacity-2.28.0/src/ui/fixedtip.c.fresh-tooltips metacity-2.28.0/src/ui
gdk_screen = gdk_display_get_screen (gdk_display_get_default (),
screen_number);
-@@ -86,22 +248,41 @@ meta_fixed_tip_show (Display *xdisplay,
+@@ -86,25 +290,47 @@ 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;
@@ -256,3 +298,9 @@ diff -up metacity-2.28.0/src/ui/fixedtip.c.fresh-tooltips metacity-2.28.0/src/ui
g_signal_connect (tip, "destroy",
G_CALLBACK (gtk_widget_destroyed), &tip);
++
++ g_signal_connect_swapped (tip, "style-set",
++ G_CALLBACK (on_style_set), NULL);
+ }
+
+ gtk_label_set_markup (GTK_LABEL (label), markup_text);
diff --git a/metacity.spec b/metacity.spec
index 92cf580..8489bfd 100644
--- a/metacity.spec
+++ b/metacity.spec
@@ -1,7 +1,7 @@
Summary: Unobtrusive window manager
Name: metacity
Version: 2.28.0
-Release: 5%{?dist}
+Release: 6%{?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,7 +194,7 @@ fi
%{_mandir}/man1/metacity-window-demo.1.gz
%changelog
-* Wed Oct 28 2009 Matthias Clasen <mclasen@redhat.cm> - 2.28.0-5
+* Wed Oct 28 2009 Matthias Clasen <mclasen@redhat.cm> - 2.28.0-6
- Make tooltips look sharper
* Wed Oct 21 2009 Matthias Clasen <mclasen@redhat.cm> - 2.28.0-4