diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/fshelp.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/fshelp.c index 9a98c04b..f5b6772e 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/fshelp.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/fs/fshelp.c @@ -426,7 +426,7 @@ grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node, if (grub_errno) return -1; } - else if (read_hook != (void *)grub_disk_blocklist_read) + else if (read_hook != (grub_disk_read_hook_t)grub_disk_blocklist_read) grub_memset (buf, 0, blockend); buf += blocksize - skipfirst; diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/view.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/view.c index 51fb1752..b69f0991 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/view.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/view.c @@ -437,16 +437,21 @@ grub_gfxmenu_scroll_chosen_entry (void *data, int diren) grub_gfxmenu_view_t view = data; const char *item_title; int off; + int max; if (!view->menu->size) return; item_title = grub_menu_get_entry (view->menu, view->selected)->title; off = view->menu_title_offset[view->selected] + diren; + max = grub_utf8_get_num_code (item_title, grub_strlen(item_title)); - if (off < 0 - || off > grub_utf8_get_num_code (item_title, grub_strlen(item_title))) - return; + if (diren == 1000000) + off = (max >= 20) ? (max - 20) : 0; + else if (off < 0) + off = 0; + else if (off > max) + off = max; view->menu_title_offset[view->selected] = off; grub_gfxmenu_redraw_menu (view); diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/disk.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/disk.c index e3da637f..04d6ce76 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/disk.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/disk.c @@ -471,7 +471,7 @@ grub_err_t grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector, grub_off_t offset, grub_size_t size, void *buf) { - if (disk->read_hook == (void *)grub_disk_blocklist_read) + if (disk->read_hook == (grub_disk_read_hook_t)grub_disk_blocklist_read) { return grub_disk_blocklist_read((ventoy_img_chunk_list *)disk->read_hook_data, sector, size, disk->log_sector_size); } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c index 7781ab3b..62b4e835 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c @@ -861,6 +861,12 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) case GRUB_TERM_KEY_LEFT: menu_scroll_chosen_entry (-1); break; + case GRUB_TERM_CTRL | GRUB_TERM_KEY_RIGHT: + menu_scroll_chosen_entry (1000000); + break; + case GRUB_TERM_CTRL | GRUB_TERM_KEY_LEFT: + menu_scroll_chosen_entry (-1000000); + break; case '\n': case '\r': diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/term/efi/mouse.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/term/efi/mouse.c index c4e3ace5..957ae17f 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/term/efi/mouse.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/term/efi/mouse.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -159,9 +160,16 @@ grub_mouse_getkey (struct grub_term_input *term) grub_efi_mouse_prot_t *mouse = term->data; //int x; int y; + int delta = 0; + const char *env; grub_efi_uintn_t i; if (!mouse) return GRUB_TERM_NO_KEY; + + env = grub_env_get("mouse_delta"); + if (env) + delta = (int)grub_strtol(env, NULL, 10); + for (i = 0; i < mouse->count; i++) { efi_call_2 (mouse->mouse[i]->get_state, mouse->mouse[i], &cur); @@ -172,9 +180,9 @@ grub_mouse_getkey (struct grub_term_input *term) return 0x0d; if (cur.right) return GRUB_TERM_ESC; - if (y > 0) + if (y > delta) return GRUB_TERM_KEY_DOWN; - if (y < 0) + if (y < -delta) return GRUB_TERM_KEY_UP; } } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c index 61703ef4..c5897d9e 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c @@ -3152,7 +3152,7 @@ int ventoy_get_block_list(grub_file_t file, ventoy_img_chunk_list *chunklist, gr } else { - file->read_hook = (void *)grub_disk_blocklist_read; + file->read_hook = (grub_disk_read_hook_t)grub_disk_blocklist_read; file->read_hook_data = chunklist; for (size = file->size; size > 0; size -= read)