/* May need to break grabs on children */
display = surface->display;
seat = gdk_display_get_default_seat (display);
-
- devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL);
- devices = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
- devices = g_list_prepend (devices, gdk_seat_get_pointer (seat));
+ if (seat)
+ {
+ devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL);
+ devices = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
+ devices = g_list_prepend (devices, gdk_seat_get_pointer (seat));
+ }
+ else
+ devices = NULL;
for (d = devices; d; d = d->next)
{
static GdkKeymap *
_gdk_wayland_display_get_keymap (GdkDisplay *display)
{
+ GdkSeat *seat;
GdkDevice *core_keyboard = NULL;
static GdkKeymap *tmp_keymap = NULL;
- core_keyboard = gdk_seat_get_keyboard (gdk_display_get_default_seat (display));
+ seat = gdk_display_get_default_seat (display);
+ if (seat)
+ core_keyboard = gdk_seat_get_keyboard (seat);
if (core_keyboard && tmp_keymap)
{
GdkSeat *seat;
seat = gdk_display_get_default_seat (surface->display);
+ if (seat)
+ {
+ if (surface->autohide)
+ gdk_seat_ungrab (seat);
- if (surface->autohide)
- gdk_seat_ungrab (seat);
-
- gdk_wayland_seat_clear_touchpoints (GDK_WAYLAND_SEAT (seat), surface);
+ gdk_wayland_seat_clear_touchpoints (GDK_WAYLAND_SEAT (seat), surface);
+ }
gdk_wayland_surface_hide_surface (surface);
_gdk_surface_clear_update_area (surface);
}
{
if (surface->autohide)
{
- GrabPrepareData data;
- GdkGrabStatus result;
-
- data = (GrabPrepareData) {
- .width = width,
- .height = height,
- .layout = layout,
- };
-
- result = gdk_seat_grab (gdk_display_get_default_seat (surface->display),
- surface,
- GDK_SEAT_CAPABILITY_ALL,
- TRUE,
- NULL, NULL,
- show_grabbing_popup, &data);
- if (result != GDK_GRAB_SUCCESS)
+ GdkSeat *seat;
+
+ seat = gdk_display_get_default_seat (surface->display);
+ if (seat)
{
- const char *grab_status[] = {
- "success", "already grabbed", "invalid time",
- "not viewable", "frozen", "failed"
+ GrabPrepareData data;
+ GdkGrabStatus result;
+
+ data = (GrabPrepareData) {
+ .width = width,
+ .height = height,
+ .layout = layout,
};
- g_warning ("Grab failed: %s", grab_status[result]);
+
+ result = gdk_seat_grab (seat,
+ surface,
+ GDK_SEAT_CAPABILITY_ALL,
+ TRUE,
+ NULL, NULL,
+ show_grabbing_popup, &data);
+ if (result != GDK_GRAB_SUCCESS)
+ {
+ const char *grab_status[] = {
+ "success", "already grabbed", "invalid time",
+ "not viewable", "frozen", "failed"
+ };
+ g_warning ("Grab failed: %s", grab_status[result]);
+ }
}
}
else
*/
static void
get_better_cursor (GtkLabel *self,
- gint index,
- gint *x,
- gint *y)
-{
- GdkSeat *seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (self)));
- GdkDevice *device = gdk_seat_get_keyboard (seat);
- PangoDirection keymap_direction = gdk_device_get_direction (device);
- PangoDirection cursor_direction = get_cursor_direction (self);
+ int index,
+ int *x,
+ int *y)
+{
+ GdkSeat *seat;
+ GdkDevice *keyboard;
+ PangoDirection keymap_direction;
+ PangoDirection cursor_direction;
gboolean split_cursor;
PangoRectangle strong_pos, weak_pos;
-
+
+ seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (self)));
+ if (seat)
+ keyboard = gdk_seat_get_keyboard (seat);
+ else
+ keyboard = NULL;
+ if (keyboard)
+ keymap_direction = gdk_device_get_direction (keyboard);
+ else
+ keymap_direction = PANGO_DIRECTION_LTR;
+
+ cursor_direction = get_cursor_direction (self);
+
g_object_get (gtk_widget_get_settings (GTK_WIDGET (self)),
- "gtk-split-cursor", &split_cursor,
- NULL);
+ "gtk-split-cursor", &split_cursor,
+ NULL);
gtk_label_ensure_layout (self);
-
+
pango_layout_get_cursor_pos (self->layout, index,
- &strong_pos, &weak_pos);
+ &strong_pos, &weak_pos);
if (split_cursor)
{
else
{
if (keymap_direction == cursor_direction)
- {
- *x = strong_pos.x / PANGO_SCALE;
- *y = strong_pos.y / PANGO_SCALE;
- }
+ {
+ *x = strong_pos.x / PANGO_SCALE;
+ *y = strong_pos.y / PANGO_SCALE;
+ }
else
- {
- *x = weak_pos.x / PANGO_SCALE;
- *y = weak_pos.y / PANGO_SCALE;
- }
+ {
+ *x = weak_pos.x / PANGO_SCALE;
+ *y = weak_pos.y / PANGO_SCALE;
+ }
}
}
NULL);
if (split_cursor)
- strong = TRUE;
+ strong = TRUE;
else
- {
- GdkSeat *seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (self)));
- GdkDevice *device = gdk_seat_get_keyboard (seat);
- PangoDirection keymap_direction = gdk_device_get_direction (device);
+ {
+ GdkSeat *seat;
+ GdkDevice *keyboard;
+ PangoDirection keymap_direction;
+
+ seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (self)));
+ if (seat)
+ keyboard = gdk_seat_get_keyboard (seat);
+ else
+ keyboard = NULL;
+ if (keyboard)
+ keymap_direction = gdk_device_get_direction (keyboard);
+ else
+ keymap_direction = PANGO_DIRECTION_LTR;
+
+ strong = keymap_direction == get_cursor_direction (self);
+ }
- strong = keymap_direction == get_cursor_direction (self);
- }
-
if (count > 0)
{
pango_layout_move_cursor_visually (self->layout, strong, index, 0, 1, &new_index, &new_trailing);
{
GtkPasswordEntry *entry = GTK_PASSWORD_ENTRY (widget);
GtkPasswordEntryPrivate *priv = gtk_password_entry_get_instance_private (entry);
+ GdkSeat *seat;
GTK_WIDGET_CLASS (gtk_password_entry_parent_class)->realize (widget);
- priv->keyboard = gdk_seat_get_keyboard (gdk_display_get_default_seat (gtk_widget_get_display (widget)));
- g_signal_connect (priv->keyboard, "notify::caps-lock-state", G_CALLBACK (caps_lock_state_changed), entry);
- caps_lock_state_changed (priv->keyboard, NULL, widget);
+ seat = gdk_display_get_default_seat (gtk_widget_get_display (widget));
+ if (seat)
+ priv->keyboard = gdk_seat_get_keyboard (seat);
+
+ if (priv->keyboard)
+ {
+ g_signal_connect (priv->keyboard, "notify::caps-lock-state",
+ G_CALLBACK (caps_lock_state_changed), entry);
+ caps_lock_state_changed (priv->keyboard, NULL, widget);
+ }
}
static void
entry);
}
- caps_lock_state_changed (priv->keyboard, NULL, GTK_WIDGET (entry));
+ if (priv->keyboard)
+ caps_lock_state_changed (priv->keyboard, NULL, GTK_WIDGET (entry));
g_object_notify_by_pspec (G_OBJECT (entry), props[PROP_SHOW_PEEK_ICON]);
}
float aspect_ratio;
PangoRectangle strong_pos, weak_pos;
PangoRectangle *cursor1, *cursor2;
+ GdkSeat *seat;
GdkDevice *keyboard;
PangoDirection keyboard_direction;
PangoDirection direction2;
"gtk-cursor-aspect-ratio", &aspect_ratio,
NULL);
- keyboard = gdk_seat_get_keyboard (gdk_display_get_default_seat (priv->display));
- keyboard_direction = gdk_device_get_direction (keyboard);
+ seat = gdk_display_get_default_seat (priv->display);
+ if (seat)
+ keyboard = gdk_seat_get_keyboard (seat);
+ else
+ keyboard = NULL;
+ if (keyboard)
+ keyboard_direction = gdk_device_get_direction (keyboard);
+ else
+ keyboard_direction = PANGO_DIRECTION_LTR;
pango_layout_get_cursor_pos (layout, index, &strong_pos, &weak_pos);
float aspect_ratio;
PangoRectangle strong_pos, weak_pos;
PangoRectangle *cursor1, *cursor2;
+ GdkSeat *seat;
GdkDevice *keyboard;
PangoDirection keyboard_direction;
PangoDirection direction2;
"gtk-cursor-aspect-ratio", &aspect_ratio,
NULL);
- keyboard = gdk_seat_get_keyboard (gdk_display_get_default_seat (priv->display));
- keyboard_direction = gdk_device_get_direction (keyboard);
+ seat = gdk_display_get_default_seat (priv->display);
+ if (seat)
+ keyboard = gdk_seat_get_keyboard (seat);
+ else
+ keyboard = NULL;
+ if (keyboard)
+ keyboard_direction = gdk_device_get_direction (keyboard);
+ else
+ keyboard_direction = PANGO_DIRECTION_LTR;
pango_layout_get_cursor_pos (layout, index, &strong_pos, &weak_pos);
GtkText *self = GTK_TEXT (object);
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
GdkSeat *seat;
- GdkDevice *keyboard;
+ GdkDevice *keyboard = NULL;
GtkWidget *chooser;
priv->current_pos = priv->selection_bound = 0;
gtk_widget_unparent (chooser);
seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (object)));
- keyboard = gdk_seat_get_keyboard (seat);
- g_signal_handlers_disconnect_by_func (keyboard, direction_changed, self);
+ if (seat)
+ keyboard = gdk_seat_get_keyboard (seat);
+ if (keyboard)
+ g_signal_handlers_disconnect_by_func (keyboard, direction_changed, self);
g_clear_pointer (&priv->selection_bubble, gtk_widget_unparent);
g_clear_pointer (&priv->popup_menu, gtk_widget_unparent);
{
GtkText *self = GTK_TEXT (widget);
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
- GdkSeat *seat;
- GdkDevice *keyboard;
+ GdkSeat *seat = NULL;
+ GdkDevice *keyboard = NULL;
gtk_widget_queue_draw (widget);
seat = gdk_display_get_default_seat (gtk_widget_get_display (widget));
- keyboard = gdk_seat_get_keyboard (seat);
+ if (seat)
+ keyboard = gdk_seat_get_keyboard (seat);
+ if (keyboard)
+ g_signal_connect (keyboard, "notify::direction",
+ G_CALLBACK (direction_changed), self);
+
if (priv->editable)
{
gtk_im_context_focus_in (priv->im_context);
}
- g_signal_connect (keyboard, "notify::direction",
- G_CALLBACK (direction_changed), self);
-
gtk_text_reset_blink_time (self);
gtk_text_check_cursor_blink (self);
}
{
GtkText *self = GTK_TEXT (widget);
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
- GdkSeat *seat;
- GdkDevice *keyboard;
+ GdkSeat *seat = NULL;
+ GdkDevice *keyboard = NULL;
gtk_text_selection_bubble_popup_unset (self);
gtk_widget_queue_draw (widget);
seat = gdk_display_get_default_seat (gtk_widget_get_display (widget));
- keyboard = gdk_seat_get_keyboard (seat);
+ if (seat)
+ keyboard = gdk_seat_get_keyboard (seat);
+ if (keyboard)
+ g_signal_handlers_disconnect_by_func (keyboard, direction_changed, self);
if (priv->editable)
{
}
gtk_text_check_cursor_blink (self);
-
- g_signal_handlers_disconnect_by_func (keyboard, direction_changed, self);
}
static gboolean
int offset)
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
- GdkSeat *seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (self)));
- GdkDevice *keyboard = gdk_seat_get_keyboard (seat);
- PangoDirection direction = gdk_device_get_direction (keyboard);
+ GdkSeat *seat;
+ GdkDevice *keyboard = NULL;
+ PangoDirection direction = PANGO_DIRECTION_LTR;
gboolean split_cursor;
PangoLayout *layout = gtk_text_ensure_layout (self, TRUE);
const char *text = pango_layout_get_text (layout);
int index = g_utf8_offset_to_pointer (text, offset) - text;
PangoRectangle strong_pos, weak_pos;
-
+
+ seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (self)));
+ if (seat)
+ keyboard = gdk_seat_get_keyboard (seat);
+ if (keyboard)
+ direction = gdk_device_get_direction (keyboard);
+
g_object_get (gtk_widget_get_settings (GTK_WIDGET (self)),
"gtk-split-cursor", &split_cursor,
NULL);
{
if (gtk_widget_has_focus (widget))
{
- GdkDisplay *display = gtk_widget_get_display (widget);
- GdkSeat *seat = gdk_display_get_default_seat (display);
- GdkDevice *keyboard = gdk_seat_get_keyboard (seat);
-
- if (gdk_device_get_direction (keyboard) == PANGO_DIRECTION_RTL)
+ GdkDisplay *display;
+ GdkSeat *seat;
+ GdkDevice *keyboard = NULL;
+ PangoDirection direction = PANGO_DIRECTION_LTR;
+
+ display = gtk_widget_get_display (widget);
+ seat = gdk_display_get_default_seat (display);
+ if (seat)
+ keyboard = gdk_seat_get_keyboard (seat);
+ if (keyboard)
+ direction = gdk_device_get_direction (keyboard);
+
+ if (direction == PANGO_DIRECTION_RTL)
pango_dir = PANGO_DIRECTION_RTL;
else
pango_dir = PANGO_DIRECTION_LTR;
strong = TRUE;
else
{
- GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (self));
- GdkSeat *seat = gdk_display_get_default_seat (display);
- GdkDevice *keyboard = gdk_seat_get_keyboard (seat);
- PangoDirection direction = gdk_device_get_direction (keyboard);
+ GdkDisplay *display;
+ GdkSeat *seat;
+ GdkDevice *keyboard = NULL;
+ PangoDirection direction = PANGO_DIRECTION_LTR;
+
+ display = gtk_widget_get_display (GTK_WIDGET (self));
+ seat = gdk_display_get_default_seat (display);
+ if (seat)
+ keyboard = gdk_seat_get_keyboard (seat);
+ if (keyboard)
+ direction = gdk_device_get_direction (keyboard);
strong = direction == priv->resolved_dir;
}
-
+
if (count > 0)
{
pango_layout_move_cursor_visually (layout, strong, index, 0, 1, &new_index, &new_trailing);
}
seat = gdk_display_get_default_seat (gtk_widget_get_display (widget));
- keyboard = gdk_seat_get_keyboard (seat);
- g_signal_connect (keyboard, "notify::direction",
- G_CALLBACK (direction_changed), text_view);
+ if (seat)
+ keyboard = gdk_seat_get_keyboard (seat);
+ else
+ keyboard = NULL;
+
+ if (keyboard)
+ g_signal_connect (keyboard, "notify::direction",
+ G_CALLBACK (direction_changed), text_view);
gtk_text_view_check_keymap_direction (text_view);
if (priv->editable)
}
seat = gdk_display_get_default_seat (gtk_widget_get_display (widget));
- keyboard = gdk_seat_get_keyboard (seat);
- g_signal_handlers_disconnect_by_func (keyboard, direction_changed, text_view);
+ if (seat)
+ keyboard = gdk_seat_get_keyboard (seat);
+ else
+ keyboard = NULL;
+ if (keyboard)
+ g_signal_handlers_disconnect_by_func (keyboard, direction_changed, text_view);
gtk_text_view_selection_bubble_popup_unset (text_view);
text_view->priv->text_handles_enabled = FALSE;
gtk_text_view_check_keymap_direction (GtkTextView *text_view)
{
GtkTextViewPrivate *priv = text_view->priv;
+ GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (text_view));
+ GdkSeat *seat;
+ GdkDevice *keyboard;
+ PangoDirection direction;
+ GtkTextDirection new_cursor_dir;
+ GtkTextDirection new_keyboard_dir;
+ gboolean split_cursor;
- if (priv->layout)
- {
- GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (text_view));
- GdkSeat *seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (text_view)));
- GdkDevice *keyboard = gdk_seat_get_keyboard (seat);
- GtkTextDirection new_cursor_dir;
- GtkTextDirection new_keyboard_dir;
- gboolean split_cursor;
+ if (!priv->layout)
+ return;
- g_object_get (settings,
- "gtk-split-cursor", &split_cursor,
- NULL);
-
- if (gdk_device_get_direction (keyboard) == PANGO_DIRECTION_RTL)
- new_keyboard_dir = GTK_TEXT_DIR_RTL;
- else
- new_keyboard_dir = GTK_TEXT_DIR_LTR;
-
- if (split_cursor)
- new_cursor_dir = GTK_TEXT_DIR_NONE;
- else
- new_cursor_dir = new_keyboard_dir;
-
- gtk_text_layout_set_cursor_direction (priv->layout, new_cursor_dir);
- gtk_text_layout_set_keyboard_direction (priv->layout, new_keyboard_dir);
- }
+ seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (text_view)));
+ if (seat)
+ keyboard = gdk_seat_get_keyboard (seat);
+ else
+ keyboard = NULL;
+
+ if (keyboard)
+ direction = gdk_device_get_direction (keyboard);
+ else
+ direction = PANGO_DIRECTION_LTR;
+
+ g_object_get (settings,
+ "gtk-split-cursor", &split_cursor,
+ NULL);
+
+ if (direction == PANGO_DIRECTION_RTL)
+ new_keyboard_dir = GTK_TEXT_DIR_RTL;
+ else
+ new_keyboard_dir = GTK_TEXT_DIR_LTR;
+
+ if (split_cursor)
+ new_cursor_dir = GTK_TEXT_DIR_NONE;
+ else
+ new_cursor_dir = new_keyboard_dir;
+
+ gtk_text_layout_set_cursor_direction (priv->layout, new_cursor_dir);
+ gtk_text_layout_set_keyboard_direction (priv->layout, new_keyboard_dir);
}
static void
gtk_tooltip_trigger_tooltip_query (GtkWidget *widget)
{
GdkDisplay *display;
- double x, y;
- GdkSurface *surface;
+ GdkSeat *seat;
GdkDevice *device;
+ GdkSurface *surface;
+ double x, y;
GtkWidget *toplevel;
int dx, dy;
display = gtk_widget_get_display (widget);
/* Trigger logic as if the mouse moved */
- device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
- surface = gdk_device_get_surface_at_position (device, &x, &y);
+ seat = gdk_display_get_default_seat (display);
+ if (seat)
+ device = gdk_seat_get_pointer (seat);
+ else
+ device = NULL;
+ if (device)
+ surface = gdk_device_get_surface_at_position (device, &x, &y);
+ else
+ surface = NULL;
if (!surface)
return;
gint x, y;
GdkSurface *surface;
GtkWidget *tooltip_widget;
+ GdkSeat *seat;
GdkDevice *device;
GtkTooltip *tooltip;
gboolean return_value = FALSE;
surface = gtk_native_get_surface (GTK_NATIVE (tooltip->native));
- device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
+ seat = gdk_display_get_default_seat (display);
+ if (seat)
+ device = gdk_seat_get_pointer (seat);
+ else
+ device = NULL;
+
+ if (device)
+ gdk_surface_get_device_position (surface, device, &px, &py, NULL);
+ else
+ px = py = 0;
- gdk_surface_get_device_position (surface, device, &px, &py, NULL);
x = round (px);
y = round (py);
return NULL;
}
- result = g_ptr_array_new ();
seat = gdk_display_get_default_seat (_gtk_widget_get_display (widget));
- device = gdk_seat_get_pointer (seat);
- if (is_my_surface (widget, gdk_device_get_last_event_surface (device)))
+ if (!seat)
{
- g_ptr_array_add (result, device);
+ *out_n_devices = 0;
+ return NULL;
}
+ device = gdk_seat_get_pointer (seat);
+
+ result = g_ptr_array_new ();
+ if (is_my_surface (widget, gdk_device_get_last_event_surface (device)))
+ g_ptr_array_add (result, device);
devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL_POINTING);
for (l = devices; l; l = l->next)
gtk_widget_add_controller (GTK_WIDGET (window), GTK_EVENT_CONTROLLER (target));
seat = gdk_display_get_default_seat (gtk_widget_get_display (widget));
- g_signal_connect (seat, "device-removed",
- G_CALLBACK (device_removed_cb), window);
+ if (seat)
+ g_signal_connect (seat, "device-removed",
+ G_CALLBACK (device_removed_cb), window);
controller = gtk_event_controller_motion_new ();
gtk_event_controller_set_propagation_phase (controller,
{
GtkWindow *window = GTK_WINDOW (object);
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
+ GdkSeat *seat;
g_clear_pointer (&priv->extra_input_region, cairo_region_destroy);
g_free (priv->title);
priv->keys_changed_handler = 0;
}
- g_signal_handlers_disconnect_by_func (gdk_display_get_default_seat (priv->display),
- device_removed_cb,
- window);
+ seat = gdk_display_get_default_seat (priv->display);
+ if (seat)
+ g_signal_handlers_disconnect_by_func (seat, device_removed_cb, window);
#ifdef GDK_WINDOWING_X11
g_signal_handlers_disconnect_by_func (gtk_settings_get_for_display (priv->display),
gtk_inspector_window_select_widget_under_pointer (GtkInspectorWindow *iw)
{
GdkDisplay *display;
+ GdkSeat *seat;
GdkDevice *device;
GtkWidget *widget;
display = gtk_inspector_window_get_inspected_display (iw);
- device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
+ seat = gdk_display_get_default_seat (display);
+ if (!seat)
+ return;
+
+ device = gdk_seat_get_pointer (seat);
widget = find_widget_at_pointer (device);
display = gdk_display_get_default ();
seat0 = gdk_display_get_default_seat (display);
-
- g_assert_true (GDK_IS_SEAT (seat0));
+ if (seat0 != NULL)
+ g_assert_true (GDK_IS_SEAT (seat0));
found_default = FALSE;
list = gdk_display_list_seats (display);
+
for (l = list; l; l = l->next)
{
seat = l->data;
if (seat == seat0)
found_default = TRUE;
}
- g_list_free (list);
- g_assert_true (found_default);
+ if (seat0 != NULL)
+ g_assert_true (found_default);
+ else
+ g_assert_true (list == NULL);
+
+ g_list_free (list);
}
static void
display = gdk_display_get_default ();
seat0 = gdk_display_get_default_seat (display);
+ if (seat0 == NULL)
+ {
+ g_test_skip ("Display has no seats");
+ return;
+ }
+
g_assert_true (GDK_IS_SEAT (seat0));
caps = gdk_seat_get_capabilities (seat0);
{
GtkShortcutTrigger *trigger[4];
GdkDisplay *display;
+ GdkSeat *seat;
GdkSurface *surface;
GdkDevice *device;
GdkEvent *event;
};
int i, j;
+ display = gdk_display_get_default ();
+ seat = gdk_display_get_default_seat (display);
+ if (!seat)
+ {
+ g_test_skip ("Display has no seat");
+ return;
+ }
+
trigger[0] = g_object_ref (gtk_never_trigger_get ());
trigger[1] = gtk_keyval_trigger_new (GDK_KEY_a, GDK_CONTROL_MASK);
trigger[2] = gtk_mnemonic_trigger_new (GDK_KEY_u);
trigger[3] = gtk_alternative_trigger_new (g_object_ref (trigger[1]),
g_object_ref (trigger[2]));
- display = gdk_display_get_default ();
- device = gdk_seat_get_keyboard (gdk_display_get_default_seat (display));
+ device = gdk_seat_get_keyboard (seat);
surface = gdk_surface_new_toplevel (display, 100, 100);
for (i = 0; i < G_N_ELEMENTS (tests); i++)