filechooserwidget: Remove some GdkEvent usage

This commit is contained in:
Timm Bäder 2019-04-28 11:05:37 +02:00
parent 0f6d83bb5f
commit 2bd348558e

View File

@ -1259,13 +1259,10 @@ places_sidebar_show_error_message_cb (GtkPlacesSidebar *sidebar,
}
static gboolean
key_is_left_or_right (const GdkEvent *event)
key_is_left_or_right (guint keyval,
guint state)
{
guint modifiers, keyval, state;
if (!gdk_event_get_keyval (event, &keyval) ||
!gdk_event_get_state (event, &state))
return FALSE;
guint modifiers;
modifiers = gtk_accelerator_get_default_mod_mask ();
@ -1326,11 +1323,8 @@ key_press_cb (GtkEventControllerKey *controller,
{
GtkFileChooserWidget *impl = (GtkFileChooserWidget *) data;
GtkFileChooserWidgetPrivate *priv = impl->priv;
const GdkEvent *event;
const char *string;
event = gtk_get_current_event ();
if (should_trigger_location_entry (impl, keyval, state, &string) &&
(priv->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER))
@ -1339,7 +1333,7 @@ key_press_cb (GtkEventControllerKey *controller,
return GDK_EVENT_STOP;
}
if (key_is_left_or_right (event))
if (key_is_left_or_right (keyval, state))
{
if (gtk_widget_child_focus (priv->places_sidebar, GTK_DIR_LEFT))
return GDK_EVENT_STOP;