snapshot: Refactor some device code

Make a bit clearer what this does.
This commit is contained in:
Timm Bäder 2020-10-11 11:55:04 +02:00 committed by Matthias Clasen
parent eca3eab96f
commit 78c343ba96

View File

@ -1141,7 +1141,6 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot *snapshot,
PangoRectangle strong_pos, weak_pos; PangoRectangle strong_pos, weak_pos;
PangoRectangle *cursor1, *cursor2; PangoRectangle *cursor1, *cursor2;
GdkSeat *seat; GdkSeat *seat;
GdkDevice *keyboard;
PangoDirection keyboard_direction; PangoDirection keyboard_direction;
PangoDirection direction2; PangoDirection direction2;
@ -1155,15 +1154,15 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot *snapshot,
"gtk-cursor-aspect-ratio", &aspect_ratio, "gtk-cursor-aspect-ratio", &aspect_ratio,
NULL); NULL);
keyboard_direction = PANGO_DIRECTION_LTR;
seat = gdk_display_get_default_seat (priv->display); seat = gdk_display_get_default_seat (priv->display);
if (seat) if (seat)
keyboard = gdk_seat_get_keyboard (seat); {
else GdkDevice *keyboard = gdk_seat_get_keyboard (seat);
keyboard = NULL;
if (keyboard) if (keyboard)
keyboard_direction = gdk_device_get_direction (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); pango_layout_get_cursor_pos (layout, index, &strong_pos, &weak_pos);