summaryrefslogtreecommitdiff
path: root/gtk/gtkrange.c
diff options
context:
space:
mode:
authorElliot Lee <sopwith@redhat.com>2000-06-20 20:22:05 +0000
committerElliot Lee <sopwith@src.gnome.org>2000-06-20 20:22:05 +0000
commit8f4f35b392510a8b480dd0c7e6030ab834f6aa43 (patch)
tree43279f2410f52f6548858709bbb344ac4d9054e8 /gtk/gtkrange.c
parentdd7510dccbf51df37e0d02d31f4daed4e52152e6 (diff)
downloadgtk+-8f4f35b392510a8b480dd0c7e6030ab834f6aa43.tar.gz
(follow-on from previous commit)
(follow-on from previous commit) 2000-06-18 Elliot Lee <sopwith@redhat.com> * gtk/gtkwindow.c: Don't allow creation of a window bigger than the screen. * gtk/gtkrange.c: Fix the mega-jumpy-with-lagged-events scrollbar problem by calculating event position relative to the trough rather than the slider. * gtk/gtkdnd.c, gtk/gtkcolorsel.c: Include FB headers if appropriate. * gdk/gdkgc.h: Add GDK_NOR. * configure.in, Makefile.am: Add modules top level dir * configure.in: Only use pangox library if building x11 target. * gdk/gdkdnd.h: Add GDK_DRAG_PROTO_LOCAL enum for future intra-app use.
Diffstat (limited to 'gtk/gtkrange.c')
-rw-r--r--gtk/gtkrange.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 92f49210c4..42a59fe160 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -29,7 +29,6 @@
#include "gtkrange.h"
#include "gtksignal.h"
-
#define SCROLL_TIMER_LENGTH 20
#define SCROLL_INITIAL_DELAY 100
#define SCROLL_DELAY_LENGTH 300
@@ -988,8 +987,6 @@ gtk_range_motion_notify (GtkWidget *widget,
GdkEventMotion *event)
{
GtkRange *range;
- GdkModifierType mods;
- gint x, y, mask;
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
@@ -998,13 +995,14 @@ gtk_range_motion_notify (GtkWidget *widget,
if (range->click_child == RANGE_CLASS (range)->slider)
{
- x = event->x;
- y = event->y;
+ GdkModifierType mods;
+ gint x, y, mask, x2, y2;
- if (event->is_hint || (event->window != range->slider))
- gdk_window_get_pointer (range->slider, &x, &y, &mods);
- else
- mods = event->state;
+ gdk_window_get_pointer (range->trough, &x, &y, &mods);
+ gdk_window_get_position (range->slider, &x2, &y2);
+
+ x -= x2;
+ y -= y2;
switch (range->button)
{