Skip to content

Commit

Permalink
Merge branch 'main' into jeremypw/completion-incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremypw authored Jan 29, 2024
2 parents 9e78c87 + 898b19b commit 8a9ce28
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/View/ViewContainer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ namespace Files.View {
public void set_active_state (bool is_active, bool animate = true) {
var aslot = get_current_slot ();
if (aslot != null) {
aslot.grab_focus ();
/* Since async loading it may not have been determined whether slot is loadable */
aslot.set_active_state (is_active, animate);
if (is_active) {
Expand Down
25 changes: 13 additions & 12 deletions src/View/Window.vala
Original file line number Diff line number Diff line change
Expand Up @@ -336,18 +336,19 @@ public class Files.View.Window : Hdy.ApplicationWindow {
};

key_controller.key_pressed.connect ((keyval, keycode, state) => {
if (!current_container.has_focus) {
return Gdk.EVENT_PROPAGATE;
}

var mods = state & Gtk.accelerator_get_default_mod_mask ();
/* Use find function instead of view interactive search */
if (mods == 0 || mods == Gdk.ModifierType.SHIFT_MASK) {
/* Use printable characters to initiate search */
var uc = (unichar)(Gdk.keyval_to_unicode (keyval));
if (uc.isprint ()) {
activate_action ("find", uc.to_string ());
return Gdk.EVENT_STOP;
var focus_widget = get_focus ();
if (focus_widget != null && current_container != null &&
focus_widget.is_ancestor (current_container)) {

var mods = state & Gtk.accelerator_get_default_mod_mask ();
/* Use find function instead of view interactive search */
if (mods == 0 || mods == Gdk.ModifierType.SHIFT_MASK) {
/* Use printable characters to initiate search */
var uc = (unichar)(Gdk.keyval_to_unicode (keyval));
if (uc.isprint ()) {
activate_action ("find", uc.to_string ());
return Gdk.EVENT_STOP;
}
}
}

Expand Down

0 comments on commit 8a9ce28

Please sign in to comment.