rpms/gtk2/devel fresh-tooltips.patch, 1.3, 1.4 tooltip-positioning.patch, 1.3, 1.4
Matthias Clasen
mclasen at fedoraproject.org
Sat May 8 02:56:40 UTC 2010
Author: mclasen
Update of /cvs/pkgs/rpms/gtk2/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv21395
Modified Files:
fresh-tooltips.patch tooltip-positioning.patch
Log Message:
update patches
fresh-tooltips.patch:
gtktooltip.c | 264 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
gtkwidget.c | 8 +
2 files changed, 260 insertions(+), 12 deletions(-)
Index: fresh-tooltips.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gtk2/devel/fresh-tooltips.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- fresh-tooltips.patch 10 Mar 2010 06:02:33 -0000 1.3
+++ fresh-tooltips.patch 8 May 2010 02:56:39 -0000 1.4
@@ -1,7 +1,7 @@
-diff -up gtk+-2.19.1/gtk/gtktooltip.c.fresh-tooltips gtk+-2.19.1/gtk/gtktooltip.c
---- gtk+-2.19.1/gtk/gtktooltip.c.fresh-tooltips 2009-11-26 23:54:55.000000000 -0500
-+++ gtk+-2.19.1/gtk/gtktooltip.c 2009-11-30 20:06:37.539580221 -0500
-@@ -29,6 +29,10 @@
+diff -up gtk+-2.21.0/gtk/gtktooltip.c.fresh-tooltips gtk+-2.21.0/gtk/gtktooltip.c
+--- gtk+-2.21.0/gtk/gtktooltip.c.fresh-tooltips 2010-05-06 22:49:21.000000000 -0400
++++ gtk+-2.21.0/gtk/gtktooltip.c 2010-05-07 18:16:12.347311268 -0400
+@@ -33,6 +33,10 @@
#include "gtkhbox.h"
#include "gtkalignment.h"
@@ -11,8 +11,8 @@ diff -up gtk+-2.19.1/gtk/gtktooltip.c.fr
+
#include "gtkalias.h"
- #include <string.h>
-@@ -95,6 +99,7 @@ static void gtk_tooltip_display_cl
+ #undef DEBUG_TOOLTIP
+@@ -97,6 +101,7 @@ static void gtk_tooltip_display_cl
GtkTooltip *tooltip);
static void gtk_tooltip_set_last_window (GtkTooltip *tooltip,
GdkWindow *window);
@@ -20,7 +20,7 @@ diff -up gtk+-2.19.1/gtk/gtktooltip.c.fr
G_DEFINE_TYPE (GtkTooltip, gtk_tooltip, G_TYPE_OBJECT);
-@@ -110,8 +115,43 @@ gtk_tooltip_class_init (GtkTooltipClass
+@@ -112,8 +117,43 @@ gtk_tooltip_class_init (GtkTooltipClass
}
static void
@@ -64,7 +64,7 @@ diff -up gtk+-2.19.1/gtk/gtktooltip.c.fr
tooltip->timeout_id = 0;
tooltip->browse_mode_timeout_id = 0;
-@@ -127,8 +167,12 @@ gtk_tooltip_init (GtkTooltip *tooltip)
+@@ -129,8 +169,12 @@ gtk_tooltip_init (GtkTooltip *tooltip)
tooltip->last_window = NULL;
tooltip->window = g_object_ref (gtk_window_new (GTK_WINDOW_POPUP));
@@ -77,7 +77,7 @@ diff -up gtk+-2.19.1/gtk/gtktooltip.c.fr
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 +189,7 @@ gtk_tooltip_init (GtkTooltip *tooltip)
+@@ -147,7 +191,7 @@ gtk_tooltip_init (GtkTooltip *tooltip)
gtk_widget_show (tooltip->alignment);
g_signal_connect_swapped (tooltip->window, "style-set",
@@ -86,7 +86,7 @@ diff -up gtk+-2.19.1/gtk/gtktooltip.c.fr
g_signal_connect_swapped (tooltip->window, "expose-event",
G_CALLBACK (gtk_tooltip_paint_window), tooltip);
-@@ -162,6 +206,13 @@ gtk_tooltip_init (GtkTooltip *tooltip)
+@@ -164,6 +208,13 @@ gtk_tooltip_init (GtkTooltip *tooltip)
gtk_box_pack_start (GTK_BOX (tooltip->box), tooltip->label,
FALSE, FALSE, 0);
@@ -100,7 +100,7 @@ diff -up gtk+-2.19.1/gtk/gtktooltip.c.fr
tooltip->custom_widget = NULL;
}
-@@ -508,19 +559,208 @@ gtk_tooltip_window_style_set (GtkTooltip
+@@ -510,19 +561,208 @@ gtk_tooltip_window_style_set (GtkTooltip
gtk_widget_queue_draw (tooltip->window);
}
@@ -319,7 +319,7 @@ diff -up gtk+-2.19.1/gtk/gtktooltip.c.fr
return FALSE;
}
-@@ -660,7 +900,7 @@ find_widget_under_pointer (GdkWindow *wi
+@@ -662,7 +902,7 @@ find_widget_under_pointer (GdkWindow *wi
#ifdef DEBUG_TOOLTIP
g_print ("event window %p (belonging to %p (%s)) (%d, %d)\n",
@@ -328,10 +328,10 @@ diff -up gtk+-2.19.1/gtk/gtktooltip.c.fr
*x, *y);
#endif
-diff -up gtk+-2.19.1/gtk/gtkwidget.c.fresh-tooltips gtk+-2.19.1/gtk/gtkwidget.c
---- gtk+-2.19.1/gtk/gtkwidget.c.fresh-tooltips 2009-11-27 20:59:42.000000000 -0500
-+++ gtk+-2.19.1/gtk/gtkwidget.c 2009-11-30 20:00:23.425825787 -0500
-@@ -2557,6 +2557,14 @@ gtk_widget_class_init (GtkWidgetClass *k
+diff -up gtk+-2.21.0/gtk/gtkwidget.c.fresh-tooltips gtk+-2.21.0/gtk/gtkwidget.c
+--- gtk+-2.21.0/gtk/gtkwidget.c.fresh-tooltips 2010-05-07 13:34:31.000000000 -0400
++++ gtk+-2.21.0/gtk/gtkwidget.c 2010-05-07 18:14:28.348068707 -0400
+@@ -2561,6 +2561,14 @@ gtk_widget_class_init (GtkWidgetClass *k
P_("The length of vertical scroll arrows"),
1, G_MAXINT, 16,
GTK_PARAM_READABLE));
tooltip-positioning.patch:
gtktooltip.c | 139 +++++++++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 108 insertions(+), 31 deletions(-)
Index: tooltip-positioning.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gtk2/devel/tooltip-positioning.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- tooltip-positioning.patch 10 Mar 2010 06:02:33 -0000 1.3
+++ tooltip-positioning.patch 8 May 2010 02:56:39 -0000 1.4
@@ -1,16 +1,16 @@
-diff -up gtk+-2.18.3/gtk/gtktooltip.c.positioning gtk+-2.18.3/gtk/gtktooltip.c
---- gtk+-2.18.3/gtk/gtktooltip.c.positioning 2009-10-23 13:12:16.205437913 -0400
-+++ gtk+-2.18.3/gtk/gtktooltip.c 2009-10-23 13:52:15.922749329 -0400
-@@ -1023,57 +1023,134 @@ gtk_tooltip_position (GtkTooltip *toolti
- GtkWidget *new_tooltip_widget)
+diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
+index 5cc2334..204a2b6 100644
+--- a/gtk/gtktooltip.c
++++ b/gtk/gtktooltip.c
+@@ -903,53 +903,128 @@ gtk_tooltip_position (GtkTooltip *tooltip,
{
gint x, y;
-+ gint wx, wy;
GdkScreen *screen;
+ gint monitor_num;
+ GdkRectangle monitor;
+ GtkRequisition requisition;
+ guint cursor_size;
++ GdkRectangle bounds;
+
+#define MAX_DISTANCE 32
@@ -25,12 +25,7 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.po
+ tooltip->last_y);
+ gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
+
-+ gdk_window_get_origin (new_tooltip_widget->window, &wx, &wy);
-+ if (!gtk_widget_get_has_window (new_tooltip_widget))
-+ {
-+ wx += new_tooltip_widget->allocation.x;
-+ wy += new_tooltip_widget->allocation.y;
-+ }
++ get_bounding_box (new_tooltip_widget, &bounds);
+
/* Position the tooltip */
- /* FIXME: should we swap this when RTL is enabled? */
@@ -39,21 +34,18 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.po
+ cursor_size = gdk_display_get_default_cursor_size (display);
+
+ /* Try below */
-+ x = wx + new_tooltip_widget->allocation.width / 2 - requisition.width / 2;
-+ y = wy + new_tooltip_widget->allocation.height + 4;
++ x = bounds.x + bounds.width / 2 - requisition.width / 2;
++ y = bounds.y + bounds.height + 4;
+
+ if (y + requisition.height <= monitor.y + monitor.height)
{
-- gdk_window_get_origin (new_tooltip_widget->window, &x, &y);
-- if (!gtk_widget_get_has_window (new_tooltip_widget))
+- GdkRectangle bounds;
+ if (tooltip->keyboard_mode_enabled)
+ goto found;
-+
+
+- get_bounding_box (new_tooltip_widget, &bounds);
+ if (y <= tooltip->last_y + cursor_size + MAX_DISTANCE)
- {
-- x += new_tooltip_widget->allocation.x;
-- y += new_tooltip_widget->allocation.y;
-- }
++ {
+ if (tooltip->last_x + cursor_size + MAX_DISTANCE < x)
+ x = tooltip->last_x + cursor_size + MAX_DISTANCE;
+ else if (x + requisition.width < tooltip->last_x - MAX_DISTANCE)
@@ -62,15 +54,15 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.po
- /* For keyboard mode we position the tooltip below the widget,
- * right of the center of the widget.
- */
-- x += new_tooltip_widget->allocation.width / 2;
-- y += new_tooltip_widget->allocation.height + 4;
+- x = bounds.x + bounds.width / 2;
+- y = bounds.y + bounds.height + 4;
+ goto found;
+ }
+ }
+
+ /* Try above */
-+ x = wx + new_tooltip_widget->allocation.width / 2 - requisition.width / 2;
-+ y = wy - requisition.height - 4;
++ x = bounds.x + bounds.width / 2 - requisition.width / 2;
++ y = bounds.y - requisition.height - 4;
+
+ if (y >= monitor.y)
+ {
@@ -90,8 +82,8 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.po
- else
+
+ /* Try right FIXME: flip on rtl ? */
-+ x = wx + new_tooltip_widget->allocation.width + 4;
-+ y = wy + new_tooltip_widget->allocation.height / 2 - requisition.height / 2;
++ x = bounds.x + bounds.width + 4;
++ y = bounds.y + bounds.height / 2 - requisition.height / 2;
+
+ if (x + requisition.width <= monitor.x + monitor.width)
{
@@ -120,8 +112,8 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.po
- screen = gtk_widget_get_screen (new_tooltip_widget);
+ /* Try left FIXME: flip on rtl ? */
-+ x = wx - requisition.width - 4;
-+ y = wy + new_tooltip_widget->allocation.height / 2 - requisition.height / 2;
++ x = bounds.x - requisition.width - 4;
++ y = bounds.y + bounds.height / 2 - requisition.height / 2;
- /* Show it */
- if (tooltip->current_window)
@@ -148,11 +140,11 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.po
+ }
+ }
-+ /* Fallback */
++ /* Fallback */
+ if (tooltip->keyboard_mode_enabled)
+ {
-+ x = wx + new_tooltip_widget->allocation.width / 2 - requisition.width / 2;
-+ y = wy + new_tooltip_widget->allocation.height + 4;
++ x = bounds.x + bounds.width / 2 - requisition.width / 2;
++ y = bounds.y + bounds.height + 4;
+ }
+ else
+ {
@@ -168,7 +160,7 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.po
if (x + requisition.width > monitor.x + monitor.width)
x -= x - (monitor.x + monitor.width) + requisition.width;
else if (x < monitor.x)
-@@ -1081,7 +1158,9 @@ gtk_tooltip_position (GtkTooltip *toolti
+@@ -957,7 +1032,9 @@ gtk_tooltip_position (GtkTooltip *tooltip,
if (y + requisition.height > monitor.y + monitor.height)
y -= y - (monitor.y + monitor.height) + requisition.height;
@@ -179,7 +171,7 @@ diff -up gtk+-2.18.3/gtk/gtktooltip.c.po
if (!tooltip->keyboard_mode_enabled)
{
/* don't pop up under the pointer */
-@@ -1089,7 +1168,7 @@ gtk_tooltip_position (GtkTooltip *toolti
+@@ -965,7 +1042,7 @@ gtk_tooltip_position (GtkTooltip *tooltip,
y <= tooltip->last_y && tooltip->last_y < y + requisition.height)
y = tooltip->last_y - requisition.height - 2;
}
More information about the scm-commits
mailing list