diff options
author | mdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2012-02-11 13:01:37 +0000 |
---|---|---|
committer | mdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2012-02-11 13:01:37 +0000 |
commit | 64b37e3f69a2180522632db7891afff0dc579e1a (patch) | |
tree | 6deb62c5bdd30a1bacba805e5fd0272f4d5db529 /navit | |
parent | 52afa5e955540d63d8387c166202ac7bd0c18ccb (diff) | |
download | navit-64b37e3f69a2180522632db7891afff0dc579e1a.tar.gz |
Fix:gui_internal:Allow gui.menu() to be called from osd button without strange mouse behavior after leving menu.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4931 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit')
-rw-r--r-- | navit/gui/internal/gui_internal.c | 19 | ||||
-rw-r--r-- | navit/navit_shipped.xml | 2 |
2 files changed, 13 insertions, 8 deletions
diff --git a/navit/gui/internal/gui_internal.c b/navit/gui/internal/gui_internal.c index 5b2febff1..bacddb734 100644 --- a/navit/gui/internal/gui_internal.c +++ b/navit/gui/internal/gui_internal.c @@ -5630,20 +5630,25 @@ static void gui_internal_cmd_menu2(struct gui_priv *this, char *function, struct attr **in, struct attr ***out, int *valid) { char *href=NULL; - int replace=0; - if (in && in[0] && ATTR_IS_STRING(in[0]->type)) { - href=in[0]->u.str; - if (in[1] && ATTR_IS_INT(in[1]->type)) - replace=in[1]->u.num; + int i=0, ignore=0, replace=0; + + if (in && in[i] && ATTR_IS_INT(in[i]->type)) + ignore=in[i++]->u.num; + + if (in && in[i] && ATTR_IS_STRING(in[i]->type)) { + href=in[i++]->u.str; + if (in[i] && ATTR_IS_INT(in[i]->type)) + replace=in[i++]->u.num; } + if (this->root.children) { if (!href) return; gui_internal_html_load_href(this, href, replace); return; } - /* FIXME: third argument should be 1 when called from OSD button and 0 when called from dbus or similar interface (see r2872) */ - gui_internal_cmd_menu(this, NULL, 0, href); + + gui_internal_cmd_menu(this, NULL, ignore, href); } diff --git a/navit/navit_shipped.xml b/navit/navit_shipped.xml index 18b2b49a1..a3fc960be 100644 --- a/navit/navit_shipped.xml +++ b/navit/navit_shipped.xml @@ -103,7 +103,7 @@ Navigation</text></img> Usage of negative values change the button origins. x="0" y="0" specifies the top left, x="-0" y="-0" the bottom right corner. It's always the top left corner of the icon, so you need to consider the icon's size when you enter the values. --> <osd enabled="no" type="button" x="0" y="0" command="gui.fullscreen=!gui.fullscreen" src="toggle_fullscreen.xpm"/> - <osd enabled="no" type="button" x="-96" y="0" command="gui.menu()" src="menu.xpm"/> + <osd enabled="no" type="button" x="-96" y="0" command="gui.menu(1)" src="menu.xpm"/> <osd enabled="no" type="button" x="-96" y="-96" command="zoom_in()" src="zoom_in.png"/> <osd enabled="no" type="button" x="0" y="-96" command="zoom_out()" src="zoom_out.png"/> |