Commit 1449a6d2 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

libgimpwidgets/gimpscrolledpreview.c don't rely on the pointer position in

2007-12-18  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpscrolledpreview.c
	* libgimpwidgets/gimpcolorselect.c: don't rely on the pointer
	position in the GdkEventMotion struct, query the pointer instead.

svn path=/trunk/; revision=24396
parent 45b5ffb7
2007-12-18 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpscrolledpreview.c
* libgimpwidgets/gimpcolorselect.c: don't rely on the pointer
position in the GdkEventMotion struct, query the pointer instead.
2007-12-18 Sven Neumann <sven@gimp.org>
* app/widgets/gimpgradienteditor.c: don't rely on the pointer
......
......@@ -667,8 +667,15 @@ gimp_color_select_xy_events (GtkWidget *widget,
case GDK_MOTION_NOTIFY:
mevent = (GdkEventMotion *) event;
x = mevent->x;
y = mevent->y;
if (mevent->is_hint)
{
gdk_window_get_pointer (widget->window, &x, &y, NULL);
}
else
{
x = mevent->x;
y = mevent->y;
}
break;
default:
......
......@@ -432,8 +432,7 @@ gimp_scrolled_preview_area_event (GtkWidget *area,
hadj = gtk_range_get_adjustment (GTK_RANGE (preview->hscr));
vadj = gtk_range_get_adjustment (GTK_RANGE (preview->vscr));
x = mevent->x;
y = mevent->y;
gtk_widget_get_pointer (area, &x, &y);
x = priv->drag_xoff - (x - priv->drag_x);
y = priv->drag_yoff - (y - priv->drag_y);
......@@ -703,13 +702,16 @@ gimp_scrolled_preview_nav_popup_event (GtkWidget *widget,
GdkEventMotion *mevent = (GdkEventMotion *) event;
GtkAdjustment *hadj;
GtkAdjustment *vadj;
gint cx, cy;
gdouble x, y;
hadj = gtk_range_get_adjustment (GTK_RANGE (preview->hscr));
vadj = gtk_range_get_adjustment (GTK_RANGE (preview->vscr));
x = mevent->x * (hadj->upper - hadj->lower) / widget->allocation.width;
y = mevent->y * (vadj->upper - vadj->lower) / widget->allocation.height;
gtk_widget_get_pointer (widget, &cx, &cy);
x = cx * (hadj->upper - hadj->lower) / widget->allocation.width;
y = cy * (vadj->upper - vadj->lower) / widget->allocation.height;
x += hadj->lower - hadj->page_size / 2;
y += vadj->lower - vadj->page_size / 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment