forked from AuroraMiddleware/gtk
call gdk_event_request_motions() for new motion events after receiving
Tue Feb 6 15:53:59 2007 Tim Janik <timj@imendio.com> * gtk/gtktextview.c (gtk_text_view_motion_event): * gtk/gtkspinbutton.c (gtk_spin_button_motion_notify): * gtk/gtkaboutdialog.c (credits_motion_notify_event): * gtk/gtkhruler.c (gtk_hruler_motion_notify): * gtk/gtkvruler.c (gtk_vruler_motion_notify): * gtk/gtkentry.c (gtk_entry_motion_notify): * gtk/gtktooltip.c (_gtk_tooltip_handle_event): * gtk/gtkhsv.c (gtk_hsv_motion): call gdk_event_request_motions() for new motion events after receiving motion hints. * gdk/gdkevents.[hc]: added gdk_event_request_motions(). svn path=/trunk/; revision=17269
This commit is contained in:
parent
aef468ebbf
commit
caa4d15dab
14
ChangeLog
14
ChangeLog
@ -1,3 +1,17 @@
|
|||||||
|
Tue Feb 6 15:53:59 2007 Tim Janik <timj@imendio.com>
|
||||||
|
|
||||||
|
* gtk/gtktextview.c (gtk_text_view_motion_event):
|
||||||
|
* gtk/gtkspinbutton.c (gtk_spin_button_motion_notify):
|
||||||
|
* gtk/gtkaboutdialog.c (credits_motion_notify_event):
|
||||||
|
* gtk/gtkhruler.c (gtk_hruler_motion_notify):
|
||||||
|
* gtk/gtkvruler.c (gtk_vruler_motion_notify):
|
||||||
|
* gtk/gtkentry.c (gtk_entry_motion_notify):
|
||||||
|
* gtk/gtktooltip.c (_gtk_tooltip_handle_event):
|
||||||
|
* gtk/gtkhsv.c (gtk_hsv_motion): call gdk_event_request_motions()
|
||||||
|
for new motion events after receiving motion hints.
|
||||||
|
|
||||||
|
* gdk/gdkevents.[hc]: added gdk_event_request_motions().
|
||||||
|
|
||||||
2007-02-06 Kristian Rietveld <kris@imendio.com>
|
2007-02-06 Kristian Rietveld <kris@imendio.com>
|
||||||
|
|
||||||
* gtk/gtktooltip.c (find_topmost_widget_coords_from_event):
|
* gtk/gtktooltip.c (find_topmost_widget_coords_from_event):
|
||||||
|
@ -834,6 +834,26 @@ gdk_event_get_axis (GdkEvent *event,
|
|||||||
return gdk_device_get_axis (device, axes, axis_use, value);
|
return gdk_device_get_axis (device, axes, axis_use, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gdk_event_request_motions:
|
||||||
|
* @event: a valid #GdkEvent
|
||||||
|
*
|
||||||
|
* Request more motion notifies if #event is a motion notify hint event.
|
||||||
|
* This funciton should be used instead of gdk_window_get_pointer() to
|
||||||
|
* request further motion notifies, because it also works for extension
|
||||||
|
* events where motion notifies are provided for devices other than the
|
||||||
|
* core pointer.
|
||||||
|
*
|
||||||
|
* Since: 2.12
|
||||||
|
**/
|
||||||
|
void
|
||||||
|
gdk_event_request_motions (GdkEventMotion *event)
|
||||||
|
{
|
||||||
|
g_return_if_fail (event != NULL);
|
||||||
|
if (event->type == GDK_MOTION_NOTIFY && event->is_hint)
|
||||||
|
gdk_device_get_state (event->device, event->window, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gdk_event_set_screen:
|
* gdk_event_set_screen:
|
||||||
* @event: a #GdkEvent
|
* @event: a #GdkEvent
|
||||||
|
@ -529,6 +529,7 @@ gboolean gdk_event_get_root_coords (GdkEvent *event,
|
|||||||
gboolean gdk_event_get_axis (GdkEvent *event,
|
gboolean gdk_event_get_axis (GdkEvent *event,
|
||||||
GdkAxisUse axis_use,
|
GdkAxisUse axis_use,
|
||||||
gdouble *value);
|
gdouble *value);
|
||||||
|
void gdk_event_request_motions (GdkEventMotion *event);
|
||||||
void gdk_event_handler_set (GdkEventFunc func,
|
void gdk_event_handler_set (GdkEventFunc func,
|
||||||
gpointer data,
|
gpointer data,
|
||||||
GDestroyNotify notify);
|
GDestroyNotify notify);
|
||||||
|
@ -1781,7 +1781,7 @@ credits_motion_notify_event (GtkWidget *text_view,
|
|||||||
|
|
||||||
set_cursor_if_appropriate (about, GTK_TEXT_VIEW (text_view), x, y);
|
set_cursor_if_appropriate (about, GTK_TEXT_VIEW (text_view), x, y);
|
||||||
|
|
||||||
gdk_window_get_pointer (text_view->window, NULL, NULL, NULL);
|
gdk_event_request_motions (event);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1872,8 +1872,8 @@ gtk_entry_motion_notify (GtkWidget *widget,
|
|||||||
if (entry->select_lines)
|
if (entry->select_lines)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (event->is_hint || (entry->text_area != event->window))
|
if (entry->text_area != event->window)
|
||||||
gdk_window_get_pointer (entry->text_area, NULL, NULL, NULL);
|
gdk_event_request_motions (event);
|
||||||
|
|
||||||
if (entry->in_drag)
|
if (entry->in_drag)
|
||||||
{
|
{
|
||||||
|
@ -89,10 +89,8 @@ gtk_hruler_motion_notify (GtkWidget *widget,
|
|||||||
|
|
||||||
ruler = GTK_RULER (widget);
|
ruler = GTK_RULER (widget);
|
||||||
|
|
||||||
if (event->is_hint)
|
gdk_event_request_motions (event);
|
||||||
gdk_window_get_pointer (widget->window, &x, NULL, NULL);
|
x = event->x;
|
||||||
else
|
|
||||||
x = event->x;
|
|
||||||
|
|
||||||
ruler->position = ruler->lower + ((ruler->upper - ruler->lower) * x) / widget->allocation.width;
|
ruler->position = ruler->lower + ((ruler->upper - ruler->lower) * x) / widget->allocation.width;
|
||||||
g_object_notify (G_OBJECT (ruler), "position");
|
g_object_notify (G_OBJECT (ruler), "position");
|
||||||
|
17
gtk/gtkhsv.c
17
gtk/gtkhsv.c
@ -851,18 +851,11 @@ gtk_hsv_motion (GtkWidget *widget,
|
|||||||
if (priv->mode == DRAG_NONE)
|
if (priv->mode == DRAG_NONE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (event->is_hint)
|
gdk_event_request_motions (event);
|
||||||
{
|
x = event->x;
|
||||||
gdk_window_get_pointer (priv->window, &ix, &iy, &mods);
|
y = event->y;
|
||||||
x = ix;
|
mods = event->state;
|
||||||
y = iy;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
x = event->x;
|
|
||||||
y = event->y;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->mode == DRAG_H)
|
if (priv->mode == DRAG_H)
|
||||||
{
|
{
|
||||||
gtk_hsv_set_color (hsv, compute_v (hsv, x, y), priv->s, priv->v);
|
gtk_hsv_set_color (hsv, compute_v (hsv, x, y), priv->s, priv->v);
|
||||||
|
@ -1148,9 +1148,9 @@ gtk_spin_button_motion_notify (GtkWidget *widget,
|
|||||||
|
|
||||||
if (event->window == spin->panel)
|
if (event->window == spin->panel)
|
||||||
{
|
{
|
||||||
gint y;
|
gint y = event->y;
|
||||||
|
|
||||||
gdk_window_get_pointer (spin->panel, NULL, &y, NULL);
|
gdk_event_request_motions (event);
|
||||||
|
|
||||||
if (y <= widget->requisition.height / 2 &&
|
if (y <= widget->requisition.height / 2 &&
|
||||||
spin->in_child == GTK_ARROW_DOWN)
|
spin->in_child == GTK_ARROW_DOWN)
|
||||||
|
@ -4170,10 +4170,10 @@ gtk_text_view_motion_event (GtkWidget *widget, GdkEventMotion *event)
|
|||||||
if (event->window == text_view->text_window->bin_window &&
|
if (event->window == text_view->text_window->bin_window &&
|
||||||
text_view->drag_start_x >= 0)
|
text_view->drag_start_x >= 0)
|
||||||
{
|
{
|
||||||
gint x, y;
|
gint x = event->x;
|
||||||
|
gint y = event->y;
|
||||||
|
|
||||||
gdk_window_get_pointer (text_view->text_window->bin_window,
|
gdk_event_request_motions (event);
|
||||||
&x, &y, NULL);
|
|
||||||
|
|
||||||
if (gtk_drag_check_threshold (widget,
|
if (gtk_drag_check_threshold (widget,
|
||||||
text_view->drag_start_x,
|
text_view->drag_start_x,
|
||||||
|
@ -997,8 +997,7 @@ _gtk_tooltip_handle_event (GdkEvent *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Always poll for a next motion event */
|
/* Always poll for a next motion event */
|
||||||
if (event->type == GDK_MOTION_NOTIFY && event->motion.is_hint)
|
gdk_event_request_motions (&event->motion);
|
||||||
gdk_window_get_pointer (event->any.window, NULL, NULL, NULL);
|
|
||||||
|
|
||||||
/* Hide the tooltip when there's no new tooltip widget */
|
/* Hide the tooltip when there's no new tooltip widget */
|
||||||
if (!has_tooltip_widget)
|
if (!has_tooltip_widget)
|
||||||
|
@ -90,10 +90,8 @@ gtk_vruler_motion_notify (GtkWidget *widget,
|
|||||||
|
|
||||||
ruler = GTK_RULER (widget);
|
ruler = GTK_RULER (widget);
|
||||||
|
|
||||||
if (event->is_hint)
|
gdk_event_request_motions (event);
|
||||||
gdk_window_get_pointer (widget->window, NULL, &y, NULL);
|
y = event->y;
|
||||||
else
|
|
||||||
y = event->y;
|
|
||||||
|
|
||||||
ruler->position = ruler->lower + ((ruler->upper - ruler->lower) * y) / widget->allocation.height;
|
ruler->position = ruler->lower + ((ruler->upper - ruler->lower) * y) / widget->allocation.height;
|
||||||
g_object_notify (G_OBJECT (ruler), "position");
|
g_object_notify (G_OBJECT (ruler), "position");
|
||||||
|
Loading…
Reference in New Issue
Block a user