Commit 321154eb authored by Carlos Garnacho's avatar Carlos Garnacho

broadway: Use GdkSeatDefault to Implement GdkSeat

parent a33aefc2
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "gdkdevice-broadway.h" #include "gdkdevice-broadway.h"
#include "gdkkeysyms.h" #include "gdkkeysyms.h"
#include "gdkprivate-broadway.h" #include "gdkprivate-broadway.h"
#include "gdkseatdefaultprivate.h"
#define HAS_FOCUS(toplevel) \ #define HAS_FOCUS(toplevel) \
((toplevel)->has_focus || (toplevel)->has_pointer_focus) ((toplevel)->has_focus || (toplevel)->has_pointer_focus)
...@@ -118,6 +119,7 @@ gdk_broadway_device_manager_constructed (GObject *object) ...@@ -118,6 +119,7 @@ gdk_broadway_device_manager_constructed (GObject *object)
{ {
GdkBroadwayDeviceManager *device_manager; GdkBroadwayDeviceManager *device_manager;
GdkDisplay *display; GdkDisplay *display;
GdkSeat *seat;
device_manager = GDK_BROADWAY_DEVICE_MANAGER (object); device_manager = GDK_BROADWAY_DEVICE_MANAGER (object);
display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (object)); display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (object));
...@@ -129,6 +131,12 @@ gdk_broadway_device_manager_constructed (GObject *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->core_keyboard, device_manager->core_pointer);
_gdk_device_set_associated_device (device_manager->touchscreen, 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); _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);
} }
......
...@@ -135,6 +135,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message) ...@@ -135,6 +135,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
event->crossing.mode = message->crossing.mode; event->crossing.mode = message->crossing.mode;
event->crossing.detail = GDK_NOTIFY_ANCESTOR; event->crossing.detail = GDK_NOTIFY_ANCESTOR;
gdk_event_set_device (event, display->core_pointer); 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); node = _gdk_event_queue_append (display, event);
_gdk_windowing_got_event (display, node, event, message->base.serial); _gdk_windowing_got_event (display, node, event, message->base.serial);
...@@ -155,6 +156,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message) ...@@ -155,6 +156,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
event->crossing.mode = message->crossing.mode; event->crossing.mode = message->crossing.mode;
event->crossing.detail = GDK_NOTIFY_ANCESTOR; event->crossing.detail = GDK_NOTIFY_ANCESTOR;
gdk_event_set_device (event, display->core_pointer); 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); node = _gdk_event_queue_append (display, event);
_gdk_windowing_got_event (display, node, event, message->base.serial); _gdk_windowing_got_event (display, node, event, message->base.serial);
...@@ -176,6 +178,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message) ...@@ -176,6 +178,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
event->motion.y_root = message->pointer.root_y; event->motion.y_root = message->pointer.root_y;
event->motion.state = message->pointer.state; event->motion.state = message->pointer.state;
gdk_event_set_device (event, display->core_pointer); 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); node = _gdk_event_queue_append (display, event);
_gdk_windowing_got_event (display, node, event, message->base.serial); _gdk_windowing_got_event (display, node, event, message->base.serial);
...@@ -201,6 +204,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message) ...@@ -201,6 +204,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
event->button.button = message->button.button; event->button.button = message->button.button;
event->button.state = message->pointer.state; event->button.state = message->pointer.state;
gdk_event_set_device (event, display->core_pointer); 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); node = _gdk_event_queue_append (display, event);
_gdk_windowing_got_event (display, node, event, message->base.serial); _gdk_windowing_got_event (display, node, event, message->base.serial);
...@@ -220,6 +224,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message) ...@@ -220,6 +224,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
event->scroll.y_root = message->pointer.root_y; event->scroll.y_root = message->pointer.root_y;
event->scroll.direction = message->scroll.dir == 0 ? GDK_SCROLL_UP : GDK_SCROLL_DOWN; event->scroll.direction = message->scroll.dir == 0 ? GDK_SCROLL_UP : GDK_SCROLL_DOWN;
gdk_event_set_device (event, display->core_pointer); 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); node = _gdk_event_queue_append (display, event);
_gdk_windowing_got_event (display, node, event, message->base.serial); _gdk_windowing_got_event (display, node, event, message->base.serial);
...@@ -263,6 +268,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message) ...@@ -263,6 +268,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
gdk_event_set_device (event, device_manager->core_pointer); gdk_event_set_device (event, device_manager->core_pointer);
gdk_event_set_source_device (event, device_manager->touchscreen); 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) if (message->touch.is_emulated)
_gdk_event_set_pointer_emulated (event, TRUE); _gdk_event_set_pointer_emulated (event, TRUE);
...@@ -289,6 +295,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message) ...@@ -289,6 +295,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
event->key.hardware_keycode = message->key.key; event->key.hardware_keycode = message->key.key;
event->key.length = 0; event->key.length = 0;
gdk_event_set_device (event, device_manager->core_keyboard); 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); node = _gdk_event_queue_append (display, event);
_gdk_windowing_got_event (display, node, event, message->base.serial); _gdk_windowing_got_event (display, node, event, message->base.serial);
...@@ -357,6 +364,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message) ...@@ -357,6 +364,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
event->focus_change.window = g_object_ref (window); event->focus_change.window = g_object_ref (window);
event->focus_change.in = FALSE; event->focus_change.in = FALSE;
gdk_event_set_device (event, display->core_pointer); 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); node = _gdk_event_queue_append (display, event);
_gdk_windowing_got_event (display, node, event, message->base.serial); _gdk_windowing_got_event (display, node, event, message->base.serial);
} }
...@@ -367,6 +375,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message) ...@@ -367,6 +375,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
event->focus_change.window = g_object_ref (window); event->focus_change.window = g_object_ref (window);
event->focus_change.in = TRUE; event->focus_change.in = TRUE;
gdk_event_set_device (event, display->core_pointer); 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); node = _gdk_event_queue_append (display, event);
_gdk_windowing_got_event (display, node, event, message->base.serial); _gdk_windowing_got_event (display, node, event, message->base.serial);
} }
......
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