From: Vladimir Testov <vladimir.testov@rosalab.ru>
To: grub-devel@gnu.org
Subject: [PATCH][BUGFIX] wrong determination of first printed entry in some cases
Date: Wed, 27 Mar 2013 11:16:50 +0400 [thread overview]
Message-ID: <75800570.iPTj3cSyZK@icedphoenix> (raw)
[-- Attachment #1: Type: text/plain, Size: 857 bytes --]
bug found and fixed
Steps to reproduce
1. more than one OS (or dummy entries as in the test stand)
2. one should have more than one kernels (so in additional options there will
be more than one entry)
3. in main boot screen there should be enough entries so the scrollbar appears
4. we should save default boot entry from submenu and it should not be the
first entry
5. the submenu with default entry should be at the bottom so the first shown
entry is not the first entry of the main screen
6. move in the submenu, selected by default
7. (in the selected submenu) every entry placed before the default entry isn't
shown. Nevertheless, they appear as soon as we press "up" key.
screeshots attached
after the patch the described problem is fixed
--
With best regards,
_______________________________
Vladimir Testov, ROSA Laboratory.
www.rosalab.ru
[-- Attachment #2: BUG_1_main_boot_menu.png --]
[-- Type: image/png, Size: 9165 bytes --]
[-- Attachment #3: BUG_2_go_into_default_submenu.png --]
[-- Type: image/png, Size: 7847 bytes --]
[-- Attachment #4: BUG_3_press_up_key.png --]
[-- Type: image/png, Size: 8829 bytes --]
[-- Attachment #5: grub-2.00-first-shown-entry.patch --]
[-- Type: text/x-patch, Size: 2423 bytes --]
diff -Naur grub-2.00/grub-core/gfxmenu/gui_list.c grub-fix/grub-core/gfxmenu/gui_list.c
--- grub-2.00/grub-core/gfxmenu/gui_list.c 2011-12-14 14:36:07.000000000 +0400
+++ grub-fix/grub-core/gfxmenu/gui_list.c 2013-03-27 10:04:55.000000000 +0400
@@ -541,6 +541,16 @@
self->view = view;
}
+/* Refresh list variables */
+static void
+list_refresh_info (void *vself,
+ grub_gfxmenu_view_t view)
+{
+ list_impl_t self = vself;
+ if (view->nested)
+ self->first_shown_index = 0;
+}
+
static struct grub_gui_component_ops list_comp_ops =
{
.destroy = list_destroy,
@@ -557,7 +567,8 @@
static struct grub_gui_list_ops list_ops =
{
- .set_view_info = list_set_view_info
+ .set_view_info = list_set_view_info,
+ .refresh_list = list_refresh_info
};
grub_gui_component_t
diff -Naur grub-2.00/grub-core/gfxmenu/view.c grub-fix/grub-core/gfxmenu/view.c
--- grub-2.00/grub-core/gfxmenu/view.c 2012-02-24 14:19:45.000000000 +0400
+++ grub-fix/grub-core/gfxmenu/view.c 2013-03-27 10:08:40.967372527 +0400
@@ -237,6 +237,27 @@
}
static void
+refresh_menu_visit (grub_gui_component_t component,
+ void *userdata)
+{
+ grub_gfxmenu_view_t view;
+ view = userdata;
+ if (component->ops->is_instance (component, "list"))
+ {
+ grub_gui_list_t list = (grub_gui_list_t) component;
+ list->ops->refresh_list (list, view);
+ }
+}
+
+/* Refresh list information (useful for submenus) */
+static void
+refresh_menu_components (grub_gfxmenu_view_t view)
+{
+ grub_gui_iterate_recursively ((grub_gui_component_t) view->canvas,
+ refresh_menu_visit, view);
+}
+
+static void
draw_message (grub_gfxmenu_view_t view)
{
char *text = view->progress_message_text;
@@ -294,6 +315,7 @@
view->screen.x, view->screen.y,
view->screen.width, view->screen.height);
+ refresh_menu_components (view);
update_menu_components (view);
grub_gfxmenu_view_redraw (view, &view->screen);
diff -Naur grub-2.00/include/grub/gui.h grub-fix/include/grub/gui.h
--- grub-2.00/include/grub/gui.h 2011-05-18 17:34:32.000000000 +0400
+++ grub-fix/include/grub/gui.h 2013-03-27 10:18:55.534836740 +0400
@@ -67,6 +67,8 @@
{
void (*set_view_info) (void *self,
grub_gfxmenu_view_t view);
+ void (*refresh_list) (void *self,
+ grub_gfxmenu_view_t view);
};
struct grub_gui_progress_ops
reply other threads:[~2013-03-27 7:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=75800570.iPTj3cSyZK@icedphoenix \
--to=vladimir.testov@rosalab.ru \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).