[gtk+] [broadway] Track and report last and future state
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] [broadway] Track and report last and future state
- Date: Thu, 7 Apr 2011 19:21:06 +0000 (UTC)
commit 8c20b476df6b3f624c33ea2ac0751fb4f6da7e12
Author: Alexander Larsson <alexl redhat com>
Date: Thu Apr 7 14:36:30 2011 +0200
[broadway] Track and report last and future state
This fixes the drawing area demo in gtk-demo
gdk/broadway/gdkdevice-broadway.c | 7 ++++---
gdk/broadway/gdkdisplay-broadway.c | 1 +
gdk/broadway/gdkdisplay-broadway.h | 2 ++
gdk/broadway/gdkeventsource.c | 5 +++++
4 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/gdk/broadway/gdkdevice-broadway.c b/gdk/broadway/gdkdevice-broadway.c
index 41fa169..11bfe53 100644
--- a/gdk/broadway/gdkdevice-broadway.c
+++ b/gdk/broadway/gdkdevice-broadway.c
@@ -175,9 +175,6 @@ gdk_broadway_device_query_state (GdkDevice *device,
*root_window = gdk_screen_get_root_window (screen);
}
- if (mask)
- *mask = 0; /* TODO */
-
if (broadway_display->output)
{
_gdk_broadway_display_consume_all_input (display);
@@ -190,6 +187,8 @@ gdk_broadway_device_query_state (GdkDevice *device,
*win_x = broadway_display->future_root_x - toplevel->x;
if (win_y)
*win_y = broadway_display->future_root_y - toplevel->y;
+ if (mask)
+ *mask = broadway_display->future_state;
if (child_window)
{
if (gdk_window_get_window_type (toplevel) == GDK_WINDOW_ROOT)
@@ -215,6 +214,8 @@ gdk_broadway_device_query_state (GdkDevice *device,
*win_x = device_root_y - toplevel->x;
if (win_y)
*win_y = device_root_y - toplevel->y;
+ if (mask)
+ *mask = broadway_display->last_state;
if (child_window)
{
if (gdk_window_get_window_type (toplevel) == GDK_WINDOW_ROOT)
diff --git a/gdk/broadway/gdkdisplay-broadway.c b/gdk/broadway/gdkdisplay-broadway.c
index 1c1ee78..44cc326 100644
--- a/gdk/broadway/gdkdisplay-broadway.c
+++ b/gdk/broadway/gdkdisplay-broadway.c
@@ -190,6 +190,7 @@ update_future_pointer_info (GdkBroadwayDisplay *broadway_display, BroadwayInputP
{
broadway_display->future_root_x = data->root_x;
broadway_display->future_root_y = data->root_y;
+ broadway_display->future_state = data->state;
broadway_display->future_mouse_in_toplevel = data->mouse_window_id;
}
diff --git a/gdk/broadway/gdkdisplay-broadway.h b/gdk/broadway/gdkdisplay-broadway.h
index 76d6810..d4a87d2 100644
--- a/gdk/broadway/gdkdisplay-broadway.h
+++ b/gdk/broadway/gdkdisplay-broadway.h
@@ -125,6 +125,7 @@ struct _GdkBroadwayDisplay
GSource *event_source;
GdkWindow *mouse_in_toplevel;
int last_x, last_y; /* in root coords */
+ guint32 last_state;
GdkWindow *real_mouse_in_toplevel; /* Not affected by grabs */
/* Keyboard related information */
@@ -165,6 +166,7 @@ struct _GdkBroadwayDisplay
/* Future data, from the currently queued events */
int future_root_x;
int future_root_y;
+ GdkModifierType future_state;
int future_mouse_in_toplevel;
};
diff --git a/gdk/broadway/gdkeventsource.c b/gdk/broadway/gdkeventsource.c
index 0ff7b4d..2e27416 100644
--- a/gdk/broadway/gdkeventsource.c
+++ b/gdk/broadway/gdkeventsource.c
@@ -103,6 +103,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
case 'e': /* Enter */
display_broadway->last_x = message->pointer.root_x;
display_broadway->last_y = message->pointer.root_y;
+ display_broadway->last_state = message->pointer.state;
display_broadway->real_mouse_in_toplevel =
g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.mouse_window_id));
@@ -139,6 +140,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
case 'l': /* Leave */
display_broadway->last_x = message->pointer.root_x;
display_broadway->last_y = message->pointer.root_y;
+ display_broadway->last_state = message->pointer.state;
display_broadway->real_mouse_in_toplevel =
g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.mouse_window_id));
@@ -174,6 +176,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
case 'm': /* Mouse move */
display_broadway->last_x = message->pointer.root_x;
display_broadway->last_y = message->pointer.root_y;
+ display_broadway->last_state = message->pointer.state;
display_broadway->real_mouse_in_toplevel =
g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.mouse_window_id));
@@ -199,6 +202,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
case 'B':
display_broadway->last_x = message->pointer.root_x;
display_broadway->last_y = message->pointer.root_y;
+ display_broadway->last_state = message->pointer.state;
display_broadway->real_mouse_in_toplevel =
g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.mouse_window_id));
@@ -224,6 +228,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
case 's':
display_broadway->last_x = message->pointer.root_x;
display_broadway->last_y = message->pointer.root_y;
+ display_broadway->last_state = message->pointer.state;
display_broadway->real_mouse_in_toplevel =
g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.mouse_window_id));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]