mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
filechooserwidget: Remove some GdkEvent usage
This commit is contained in:
parent
0f6d83bb5f
commit
2bd348558e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user