fix: kernel and desktop bug fixes
This commit is contained in:
@@ -384,7 +384,11 @@ void file_push_history(FileDialogState* st) {
|
||||
if (montauk::streq(st->history[st->history_pos], st->current_path)) return;
|
||||
}
|
||||
st->history_pos++;
|
||||
if (st->history_pos >= MAX_HISTORY) st->history_pos = MAX_HISTORY - 1;
|
||||
if (st->history_pos >= MAX_HISTORY) {
|
||||
for (int i = 1; i < MAX_HISTORY; i++)
|
||||
safe_copy(st->history[i - 1], sizeof(st->history[i - 1]), st->history[i]);
|
||||
st->history_pos = MAX_HISTORY - 1;
|
||||
}
|
||||
safe_copy(st->history[st->history_pos], sizeof(st->history[st->history_pos]), st->current_path);
|
||||
st->history_count = st->history_pos + 1;
|
||||
}
|
||||
@@ -664,6 +668,12 @@ void file_activate_selected(FileDialogState* st, bool from_double_click) {
|
||||
}
|
||||
|
||||
void file_go_home(FileDialogState* st) {
|
||||
if (st->home_dir[0] && is_dir_path(st->home_dir)) {
|
||||
safe_copy(st->current_path, sizeof(st->current_path), st->home_dir);
|
||||
file_read_dir(st);
|
||||
file_push_history(st);
|
||||
return;
|
||||
}
|
||||
file_read_drives(st);
|
||||
file_push_history(st);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user