[gtk+/wip/garnacho/gdkseat: 72/74] broadway: Use GdkSeatDefault to Implement GdkSeat



commit 09d7429a37bdb95528b8007d40e531df3bf76514
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Dec 14 15:43:54 2015 +0100

    broadway: Use GdkSeatDefault to Implement GdkSeat

 gdk/broadway/gdkdevicemanager-broadway.c |    8 ++++++++
 gdk/broadway/gdkeventsource.c            |    9 +++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/gdk/broadway/gdkdevicemanager-broadway.c b/gdk/broadway/gdkdevicemanager-broadway.c
index 8618eaf..e9f8c55 100644
--- a/gdk/broadway/gdkdevicemanager-broadway.c
+++ b/gdk/broadway/gdkdevicemanager-broadway.c
@@ -24,6 +24,7 @@
 #include "gdkdevice-broadway.h"
 #include "gdkkeysyms.h"
 #include "gdkprivate-broadway.h"
+#include "gdkseatdefaultprivate.h"
 
 #define HAS_FOCUS(toplevel)                           \
   ((toplevel)->has_focus || (toplevel)->has_pointer_focus)
@@ -118,6 +119,7 @@ gdk_broadway_device_manager_constructed (GObject *object)
 {
   GdkBroadwayDeviceManager *device_manager;
   GdkDisplay *display;
+  GdkSeat *seat;
 
   device_manager = GDK_BROADWAY_DEVICE_MANAGER (object);
   display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (object));
@@ -129,6 +131,12 @@ gdk_broadway_device_manager_constructed (GObject *object)
   _gdk_device_set_associated_device (device_manager->core_keyboard, device_manager->core_pointer);
   _gdk_device_set_associated_device (device_manager->touchscreen, device_manager->core_pointer);
   _gdk_device_add_slave (device_manager->core_pointer, device_manager->touchscreen);
+
+  seat = gdk_seat_default_new_for_master_pair (device_manager->core_pointer,
+                                               device_manager->core_keyboard);
+  gdk_display_add_seat (display, seat);
+  gdk_seat_default_add_slave (GDK_SEAT_DEFAULT (seat), device_manager->touchscreen);
+  g_object_unref (seat);
 }
 
 
diff --git a/gdk/broadway/gdkeventsource.c b/gdk/broadway/gdkeventsource.c
index d878521..358abd0 100644
--- a/gdk/broadway/gdkeventsource.c
+++ b/gdk/broadway/gdkeventsource.c
@@ -135,6 +135,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
        event->crossing.mode = message->crossing.mode;
        event->crossing.detail = GDK_NOTIFY_ANCESTOR;
        gdk_event_set_device (event, display->core_pointer);
+       gdk_event_set_seat (event, gdk_device_get_seat (display->core_pointer));
 
        node = _gdk_event_queue_append (display, event);
        _gdk_windowing_got_event (display, node, event, message->base.serial);
@@ -155,6 +156,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
        event->crossing.mode = message->crossing.mode;
        event->crossing.detail = GDK_NOTIFY_ANCESTOR;
        gdk_event_set_device (event, display->core_pointer);
+       gdk_event_set_seat (event, gdk_device_get_seat (display->core_pointer));
 
        node = _gdk_event_queue_append (display, event);
        _gdk_windowing_got_event (display, node, event, message->base.serial);
@@ -176,6 +178,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
        event->motion.y_root = message->pointer.root_y;
        event->motion.state = message->pointer.state;
        gdk_event_set_device (event, display->core_pointer);
+       gdk_event_set_seat (event, gdk_device_get_seat (display->core_pointer));
 
        node = _gdk_event_queue_append (display, event);
        _gdk_windowing_got_event (display, node, event, message->base.serial);
@@ -201,6 +204,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
        event->button.button = message->button.button;
        event->button.state = message->pointer.state;
        gdk_event_set_device (event, display->core_pointer);
+       gdk_event_set_seat (event, gdk_device_get_seat (display->core_pointer));
 
        node = _gdk_event_queue_append (display, event);
        _gdk_windowing_got_event (display, node, event, message->base.serial);
@@ -220,6 +224,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
        event->scroll.y_root = message->pointer.root_y;
        event->scroll.direction = message->scroll.dir == 0 ? GDK_SCROLL_UP : GDK_SCROLL_DOWN;
        gdk_event_set_device (event, display->core_pointer);
+       gdk_event_set_seat (event, gdk_device_get_seat (display->core_pointer));
 
        node = _gdk_event_queue_append (display, event);
        _gdk_windowing_got_event (display, node, event, message->base.serial);
@@ -263,6 +268,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
 
        gdk_event_set_device (event, device_manager->core_pointer);
        gdk_event_set_source_device (event, device_manager->touchscreen);
+       gdk_event_set_seat (event, gdk_device_get_seat (display->core_pointer));
 
         if (message->touch.is_emulated)
           _gdk_event_set_pointer_emulated (event, TRUE);
@@ -289,6 +295,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
        event->key.hardware_keycode = message->key.key;
        event->key.length = 0;
        gdk_event_set_device (event, device_manager->core_keyboard);
+       gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_keyboard));
 
        node = _gdk_event_queue_append (display, event);
        _gdk_windowing_got_event (display, node, event, message->base.serial);
@@ -357,6 +364,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
        event->focus_change.window = g_object_ref (window);
        event->focus_change.in = FALSE;
        gdk_event_set_device (event, display->core_pointer);
+       gdk_event_set_seat (event, gdk_device_get_seat (display->core_pointer));
        node = _gdk_event_queue_append (display, event);
        _gdk_windowing_got_event (display, node, event, message->base.serial);
       }
@@ -367,6 +375,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
        event->focus_change.window = g_object_ref (window);
        event->focus_change.in = TRUE;
        gdk_event_set_device (event, display->core_pointer);
+       gdk_event_set_seat (event, gdk_device_get_seat (display->core_pointer));
        node = _gdk_event_queue_append (display, event);
        _gdk_windowing_got_event (display, node, event, message->base.serial);
       }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]