Commit af54b82c authored by Carlos Garnacho's avatar Carlos Garnacho

quartz: Use GdkSeatDefault to implement GdkSeat

parent 321154eb
......@@ -590,6 +590,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
event->dnd.time = GDK_CURRENT_TIME;
gdk_event_set_device (event, gdk_drag_context_get_device (current_context));
gdk_event_set_seat (event, gdk_device_get_seat (gdk_drag_context_get_device (current_context)));
_gdk_event_emit (event);
......@@ -620,6 +621,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
event->dnd.time = GDK_CURRENT_TIME;
gdk_event_set_device (event, gdk_drag_context_get_device (current_context));
gdk_event_set_seat (event, gdk_device_get_seat (gdk_drag_context_get_device (current_context)));
_gdk_event_emit (event);
......@@ -648,6 +650,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
event->dnd.y_root = gy;
gdk_event_set_device (event, gdk_drag_context_get_device (current_context));
gdk_event_set_seat (event, gdk_device_get_seat (gdk_drag_context_get_device (current_context)));
_gdk_event_emit (event);
......@@ -675,6 +678,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
event->dnd.y_root = gy;
gdk_event_set_device (event, gdk_drag_context_get_device (current_context));
gdk_event_set_seat (event, gdk_device_get_seat (gdk_drag_context_get_device (current_context)));
_gdk_event_emit (event);
......@@ -695,6 +699,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
{
GdkEvent *event;
GdkScreen *screen;
GdkDevice *device;
g_assert (_gdk_quartz_drag_source_context != NULL);
......@@ -730,8 +735,9 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
}
}
gdk_event_set_device (event,
gdk_drag_context_get_device (_gdk_quartz_drag_source_context));
device = gdk_drag_context_get_device (_gdk_quartz_drag_source_context);
gdk_event_set_device (event, device);
gdk_event_set_seat (event, gdk_device_get_seat (device));
_gdk_event_emit (event);
......
......@@ -20,10 +20,12 @@
#include <gdk/gdktypes.h>
#include <gdk/gdkdevicemanager.h>
#include <gdk/gdkdeviceprivate.h>
#include <gdk/gdkseatdefaultprivate.h>
#include <gdk/gdkdevicemanagerprivate.h>
#include "gdkdevicemanager-core-quartz.h"
#include "gdkquartzdevice-core.h"
#include "gdkkeysyms.h"
#include "gdkprivate-quartz.h"
#define HAS_FOCUS(toplevel) \
......@@ -104,6 +106,7 @@ gdk_quartz_device_manager_core_constructed (GObject *object)
{
GdkQuartzDeviceManagerCore *device_manager;
GdkDisplay *display;
GdkSeat *seat;
device_manager = GDK_QUARTZ_DEVICE_MANAGER_CORE (object);
display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (object));
......@@ -112,6 +115,11 @@ gdk_quartz_device_manager_core_constructed (GObject *object)
_gdk_device_set_associated_device (device_manager->core_pointer, device_manager->core_keyboard);
_gdk_device_set_associated_device (device_manager->core_keyboard, device_manager->core_pointer);
seat = gdk_seat_default_new_for_master_pair (device_manager->core_pointer,
device_manager->core_keyboard);
gdk_display_add_seat (display, seat);
g_object_unref (seat);
}
static GList *
......
......@@ -507,6 +507,7 @@ create_focus_event (GdkWindow *window,
device_manager = GDK_QUARTZ_DEVICE_MANAGER_CORE (_gdk_display->device_manager);
gdk_event_set_device (event, device_manager->core_keyboard);
gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_keyboard));
return event;
}
......@@ -540,6 +541,7 @@ generate_motion_event (GdkWindow *window)
_gdk_quartz_events_get_current_mouse_modifiers ();
event->motion.is_hint = FALSE;
event->motion.device = _gdk_display->core_pointer;
gdk_event_set_seat (event, gdk_device_get_seat (_gdk_display->core_pointer));
append_event (event, TRUE);
}
......@@ -876,6 +878,7 @@ fill_crossing_event (GdkWindow *toplevel,
_gdk_quartz_events_get_current_mouse_modifiers ();
gdk_event_set_device (event, _gdk_display->core_pointer);
gdk_event_set_seat (event, gdk_device_get_seat (_gdk_display->core_pointer));
/* FIXME: Focus and button state? */
}
......@@ -926,6 +929,7 @@ fill_button_event (GdkWindow *window,
event->button.state = state;
event->button.button = get_mouse_button_from_ns_event (nsevent);
event->button.device = _gdk_display->core_pointer;
gdk_event_set_seat (event, gdk_device_get_seat (_gdk_display->core_pointer));
}
static void
......@@ -949,6 +953,7 @@ fill_motion_event (GdkWindow *window,
_gdk_quartz_events_get_current_mouse_modifiers ();
event->motion.is_hint = FALSE;
event->motion.device = _gdk_display->core_pointer;
gdk_event_set_seat (event, gdk_device_get_seat (_gdk_display->core_pointer));
}
static void
......@@ -979,6 +984,7 @@ fill_scroll_event (GdkWindow *window,
event->scroll.device = _gdk_display->core_pointer;
event->scroll.delta_x = delta_x;
event->scroll.delta_y = delta_y;
gdk_event_set_seat (event, gdk_device_get_seat (_gdk_display->core_pointer));
}
static void
......@@ -1005,6 +1011,7 @@ fill_key_event (GdkWindow *window,
device_manager = GDK_QUARTZ_DEVICE_MANAGER_CORE (_gdk_display->device_manager);
gdk_event_set_device (event, device_manager->core_keyboard);
gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_keyboard));
gdk_keymap_translate_keyboard_state (gdk_keymap_get_for_display (_gdk_display),
event->key.hardware_keycode,
......@@ -1171,6 +1178,7 @@ _gdk_quartz_synthesize_null_key_event (GdkWindow *window)
event->key.keyval = GDK_KEY_VoidSymbol;
device_manager = GDK_QUARTZ_DEVICE_MANAGER_CORE (_gdk_display->device_manager);
gdk_event_set_device (event, device_manager->core_keyboard);
gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_keyboard));
append_event(event, FALSE);
}
......
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