summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
authorAdrian Lees <adrian@aemulor.com>2005-11-28 00:20:15 +0000
committerAdrian Lees <adrian@aemulor.com>2005-11-28 00:20:15 +0000
commitb67b382c49a6390ccd23bd51def3be35629a7e4f (patch)
treeccb7422ebb9e6dfab682bc97a363cce111de5deb /riscos
parent6f2e8ea329b5600eb7e6b0f956121c25819698c4 (diff)
downloadnetsurf-b67b382c49a6390ccd23bd51def3be35629a7e4f.tar.gz
netsurf-b67b382c49a6390ccd23bd51def3be35629a7e4f.tar.bz2
[project @ 2005-11-28 00:20:15 by adrianl]
Fix IS_MENU check to prevent Illegal window handle error in menus. Removed debug svn path=/import/netsurf/; revision=1886
Diffstat (limited to 'riscos')
-rw-r--r--riscos/menus.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/riscos/menus.c b/riscos/menus.c
index a1951099f..a873d9fab 100644
--- a/riscos/menus.c
+++ b/riscos/menus.c
@@ -128,9 +128,11 @@ static wimp_MENU(GLOBAL_HISTORY_RECENT_URLS) url_suggest;
wimp_menu *url_suggest_menu = (wimp_menu *)&url_suggest;
/* the values given in PRM 3-157 for how to check menus/windows are
- * incorrect so we use a hack of checking if the sub-menu is within
- * 256KB of its parent */
-#define IS_MENU(menu, submenu) (abs((int)(submenu) - (int)(menu)) < 0x40000)
+ * incorrect so we use a hack of checking if the sub-menu has bit 0
+ * set which is undocumented but true of window handles on
+ * all target OS versions */
+#define IS_MENU(menu, submenu) !((int)(submenu) & 1)
+
/**
* Create menu structures.
@@ -708,11 +710,6 @@ void ro_gui_menu_warning(wimp_message_menu_warning *warning) {
menu_entry = &menu_entry->sub_menu->
entries[warning->selection.items[i]];
- LOG(("menu (%s): %p submenu: %p",
- menu_entry->data.indirected_text.text,
- menu_entry,
- menu_entry->sub_menu));
-
if (IS_MENU(menu_entry, menu_entry->sub_menu)) {
sub_menu = menu_entry->sub_menu;
i = 0;
@@ -2317,11 +2314,6 @@ bool ro_gui_menu_translate(struct menu_definition *menu)
entry->menu_entry->data.indirected_text.size =
strlen(translated);
- LOG(("menu (%s): %p submenu: %p",
- entry->menu_entry->data.indirected_text.text,
- entry->menu_entry,
- submenu));
-
/* child menu title - this is the same as the text of
* the parent menu entry, so just copy the pointer */
if (submenu != wimp_NO_SUB_MENU &&