diff options
Diffstat (limited to 'amiga')
-rw-r--r-- | amiga/gui.c | 18 | ||||
-rwxr-xr-x | amiga/gui.h | 2 | ||||
-rwxr-xr-x | amiga/gui_options.c | 1 |
3 files changed, 20 insertions, 1 deletions
diff --git a/amiga/gui.c b/amiga/gui.c index f223fc6ab..296132712 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -87,6 +87,7 @@ #include <proto/keymap.h> #include <proto/locale.h> #include <proto/Picasso96API.h> +#include <proto/popupmenu.h> #include <proto/utility.h> #include <proto/wb.h> @@ -580,9 +581,11 @@ static nserror ami_set_options(struct nsoption_s *defaults) } } + if(popupmenu_lib_ok == FALSE) + nsoption_set_bool(context_menu, false); + #ifndef __amigaos4__ nsoption_set_bool(download_notify, false); - nsoption_set_bool(context_menu, false); nsoption_set_bool(font_antialiasing, false); nsoption_set_bool(truecolour_mouse_pointers, false); #endif @@ -999,6 +1002,19 @@ int main(int argc, char** argv) nserror ret; Object *splash_window = ami_gui_splash_open(); + /* Open popupmenu.library just to check the version. + * Versions older than 53.11 are dangerous, so we + * forcibly disable context menus if these are in use. + */ + popupmenu_lib_ok = FALSE; + if(PopupMenuBase = OpenLibrary("popupmenu.library", 53)) { + LOG(("popupmenu.library v%d.%d", + PopupMenuBase->lib_Version, PopupMenuBase->lib_Revision)); + if(LIB_IS_AT_LEAST((struct Library *)PopupMenuBase, 53, 11)) + popupmenu_lib_ok = TRUE; + CloseLibrary(PopupMenuBase); + } + user = GetVar("user", temp, 1024, GVF_GLOBAL_ONLY); current_user = ASPrintf("%s", (user == -1) ? "Default" : temp); current_user_dir = ASPrintf("PROGDIR:Users/%s", current_user); diff --git a/amiga/gui.h b/amiga/gui.h index 4ec329eb8..947066063 100755 --- a/amiga/gui.h +++ b/amiga/gui.h @@ -176,4 +176,6 @@ struct browser_window *curbw; struct gui_globals browserglob; uint32 ami_appid; BOOL ami_autoscroll; +BOOL popupmenu_lib_ok; #endif + diff --git a/amiga/gui_options.c b/amiga/gui_options.c index 1bf20ad47..a5568dac6 100755 --- a/amiga/gui_options.c +++ b/amiga/gui_options.c @@ -1328,6 +1328,7 @@ void ami_gui_opts_open(void) GA_RelVerify, TRUE, GA_Text, gadlab[GID_OPTS_CONTEXTMENU], GA_Selected, nsoption_bool(context_menu), + GA_Disabled, !popupmenu_lib_ok, CheckBoxEnd, #endif LAYOUT_AddChild, gow->objects[GID_OPTS_FASTSCROLL] = CheckBoxObject, |