From c46e0e60155c204651ce67504e10b8523bfcbdc9 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Tue, 28 Sep 2010 18:03:03 +0000 Subject: [PATCH] Ensure kiosk_mode and frame windows are (a) handled the same wrt menus and (b) not trying to manipulate non-existant menus svn path=/trunk/netsurf/; revision=10855 --- amiga/clipboard.c | 4 ++++ amiga/gui.c | 28 +++++++++++++++++----------- amiga/menu.c | 3 +++ amiga/theme.c | 2 ++ 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/amiga/clipboard.c b/amiga/clipboard.c index d84add7f2..81ff68687 100755 --- a/amiga/clipboard.c +++ b/amiga/clipboard.c @@ -64,6 +64,8 @@ void gui_start_selection(struct gui_window *g) { if(!g) return; if(!g->shared->win) return; + if(g->shared->bw->browser_window_type != BROWSER_WINDOW_NORMAL) return; + if(option_kiosk_mode == true) return; OnMenu(g->shared->win, AMI_MENU_CLEAR); OnMenu(g->shared->win, AMI_MENU_COPY); @@ -76,6 +78,8 @@ void gui_clear_selection(struct gui_window *g) { if(!g) return; if(!g->shared->win) return; + if(g->shared->bw->browser_window_type != BROWSER_WINDOW_NORMAL) return; + if(option_kiosk_mode == true) return; OffMenu(g->shared->win, AMI_MENU_CLEAR); OffMenu(g->shared->win, AMI_MENU_CUT); diff --git a/amiga/gui.c b/amiga/gui.c index fa935b22c..6372a435a 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -1274,19 +1274,22 @@ void ami_handle_msg(void) switch(nskey) { case 'n': - if(option_kiosk_mode == false) + if((option_kiosk_mode == false) && + (gwin->bw->browser_window_type == BROWSER_WINDOW_NORMAL)) browser_window_create(NULL, gwin->bw, 0, true, false); break; case 't': - if(option_kiosk_mode == false) + if((option_kiosk_mode == false) && + (gwin->bw->browser_window_type == BROWSER_WINDOW_NORMAL)) browser_window_create(NULL, gwin->bw, 0, true, true); break; case 'k': - if(option_kiosk_mode == false) + if((option_kiosk_mode == false) && + (gwin->bw->browser_window_type == BROWSER_WINDOW_NORMAL)) browser_window_destroy(gwin->bw); break; @@ -1295,7 +1298,8 @@ void ami_handle_msg(void) break; case 'q': - if(option_kiosk_mode == false) + if((option_kiosk_mode == false) && + (gwin->bw->browser_window_type == BROWSER_WINDOW_NORMAL)) ami_quit_netsurf(); break; @@ -1325,7 +1329,8 @@ void ami_handle_msg(void) break; case 'h': - if(option_kiosk_mode == false) + if((option_kiosk_mode == false) && + (gwin->bw->browser_window_type == BROWSER_WINDOW_NORMAL)) ami_open_tree(hotlist,AMI_TREE_HOTLIST); break; @@ -1337,7 +1342,8 @@ void ami_handle_msg(void) break; case 'u': // open url - if(option_kiosk_mode == false) + if((option_kiosk_mode == false) && + (gwin->bw->browser_window_type == BROWSER_WINDOW_NORMAL)) ActivateGadget((struct Gadget *)gwin->objects[GID_URL], gwin->win, NULL); break; @@ -3490,6 +3496,7 @@ void gui_window_set_icon(struct gui_window *g, hlcache_handle *icon) if(option_kiosk_mode == true) return; if(!g) return; + if(g->shared->bw->browser_window_type != BROWSER_WINDOW_NORMAL) return; if(g->tab_node && (g->shared->tabs > 1)) GetAttr(CLICKTAB_Current, g->shared->objects[GID_TABS], @@ -3638,7 +3645,8 @@ void gui_window_place_caret(struct gui_window *g, int x, int y, int height) g->c_y = y; g->c_h = height; - if(option_kiosk_mode == false) + if((option_kiosk_mode == false) && + (g->shared->bw->browser_window_type == BROWSER_WINDOW_NORMAL)) OnMenu(g->shared->win, AMI_MENU_PASTE); } @@ -3650,7 +3658,8 @@ void gui_window_remove_caret(struct gui_window *g) if(!g) return; if(g->c_h == 0) return; - if(option_kiosk_mode == false) + if((option_kiosk_mode == false) && + (g->shared->bw->browser_window_type == BROWSER_WINDOW_NORMAL)) OffMenu(g->shared->win, AMI_MENU_PASTE); GetAttr(SPACE_AreaBox, g->shared->objects[GID_BROWSER], (ULONG *)&bbox); @@ -3678,9 +3687,6 @@ void gui_window_new_content(struct gui_window *g) g->shared->oldv = 0; g->favicon = NULL; - if(g->shared->bw->browser_window_type != BROWSER_WINDOW_NORMAL || - option_kiosk_mode == true) return; - ami_menu_update_disabled(g, c); } diff --git a/amiga/menu.c b/amiga/menu.c index 8e0f99252..595cf1d4e 100755 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -847,6 +847,9 @@ void ami_menu_update_disabled(struct gui_window *g, hlcache_handle *c) { struct Window *win = g->shared->win; + if(g->shared->bw->browser_window_type != BROWSER_WINDOW_NORMAL) return; + if(option_kiosk_mode == true) return; + OffMenu(win,AMI_MENU_CUT); OffMenu(win,AMI_MENU_COPY); OffMenu(win,AMI_MENU_PASTE); diff --git a/amiga/theme.c b/amiga/theme.c index 3ac37c12d..cf9148581 100644 --- a/amiga/theme.c +++ b/amiga/theme.c @@ -390,6 +390,7 @@ void gui_window_start_throbber(struct gui_window *g) if(!g) return; if(option_kiosk_mode) return; + if(g->shared->bw->browser_window_type != BROWSER_WINDOW_NORMAL) return; if(g->tab_node && (g->shared->tabs > 1)) { @@ -420,6 +421,7 @@ void gui_window_stop_throbber(struct gui_window *g) if(!g) return; if(option_kiosk_mode) return; + if(g->shared->bw->browser_window_type != BROWSER_WINDOW_NORMAL) return; if(g->tab_node && (g->shared->tabs > 1)) {