[gtk+] GtkRange: Use G_MININT as default mouse position, not -1
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkRange: Use G_MININT as default mouse position, not -1
- Date: Wed, 2 Dec 2015 20:07:57 +0000 (UTC)
commit 414ffbb7083897b3fc8bb0917a7eec96e39f7d5c
Author: Timm Bäder <mail baedert org>
Date: Wed Dec 2 20:12:01 2015 +0100
GtkRange: Use G_MININT as default mouse position, not -1
Otherwise we're getting MOUSE_WIDGET as mouse position for unmapped
GtkRanges.
gtk/gtkrange.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index f065c10..da02ed0 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -83,7 +83,7 @@ typedef enum {
struct _GtkRangePrivate
{
MouseLocation mouse_location;
- /* last mouse coords we got, or -1 if mouse is outside the range */
+ /* last mouse coords we got, or G_MININT if mouse is outside the range */
gint mouse_x;
gint mouse_y;
MouseLocation grab_location; /* "grabbed" mouse location, OUTSIDE for no grab */
@@ -775,8 +775,8 @@ gtk_range_init (GtkRange *range)
priv->has_stepper_d = FALSE;
priv->round_digits = -1;
priv->mouse_location = MOUSE_OUTSIDE;
- priv->mouse_x = -1;
- priv->mouse_y = -1;
+ priv->mouse_x = G_MININT;
+ priv->mouse_y = G_MININT;
priv->grab_location = MOUSE_OUTSIDE;
priv->lower_sensitivity = GTK_SENSITIVITY_AUTO;
priv->upper_sensitivity = GTK_SENSITIVITY_AUTO;
@@ -2995,8 +2995,8 @@ gtk_range_event (GtkWidget *widget,
if (event->type == GDK_LEAVE_NOTIFY)
{
- priv->mouse_x = -1;
- priv->mouse_y = -1;
+ priv->mouse_x = G_MININT;
+ priv->mouse_y = G_MININT;
}
else if (gdk_event_get_coords (event, &x, &y))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]