mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 14:31:10 +00:00
broadway: Use GdkSeatDefault to Implement GdkSeat
This commit is contained in:
parent
a33aefc281
commit
321154eb4b
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user