diff options
author | Matthias Clasen <mclasen@fedoraproject.org> | 2009-10-28 16:39:33 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@fedoraproject.org> | 2009-10-28 16:39:33 +0000 |
commit | 6802f5a85ae5d0c0a01c34685e493de6911fc902 (patch) | |
tree | 64061121f7142d5222b18534007541c1830bb2a2 /fresh-tooltips.patch | |
parent | 0adbc7bdaa3efae428ac82353a8976b336cf3cbd (diff) | |
download | metacity-6802f5a85ae5d0c0a01c34685e493de6911fc902.tar.gz metacity-6802f5a85ae5d0c0a01c34685e493de6911fc902.tar.xz metacity-6802f5a85ae5d0c0a01c34685e493de6911fc902.zip |
Make tooltips sharpermetacity-2_28_0-5_fc12
Diffstat (limited to 'fresh-tooltips.patch')
-rw-r--r-- | fresh-tooltips.patch | 72 |
1 files changed, 42 insertions, 30 deletions
diff --git a/fresh-tooltips.patch b/fresh-tooltips.patch index 8353506..fed0e25 100644 --- a/fresh-tooltips.patch +++ b/fresh-tooltips.patch @@ -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 } - + |