Index: lib/ephy-prefs.h
===================================================================
RCS file: /cvs/gnome/epiphany/lib/ephy-prefs.h,v
retrieving revision 1.28
diff -u -p -r1.28 ephy-prefs.h
--- lib/ephy-prefs.h	23 Jan 2004 22:50:01 -0000	1.28
+++ lib/ephy-prefs.h	14 Apr 2004 12:45:41 -0000
@@ -44,6 +44,7 @@ G_BEGIN_DECLS
 #define CONF_STATE_UPLOAD_DIR		"/apps/epiphany/directories/upload"
 
 /* Lockdown */
+#define CONF_LOCKDOWN_FULLSCREEN		"/apps/epiphany/lockdown/fullscreen"
 #define CONF_LOCKDOWN_DISABLE_ARBITRARY_URL	"/apps/epiphany/lockdown/disable_arbitrary_url"
 #define CONF_LOCKDOWN_DISABLE_BOOKMARK_EDITING  "/apps/epiphany/lockdown/disable_bookmark_editing"
 #define CONF_LOCKDOWN_DISABLE_TOOLBAR_EDITING	"/apps/epiphany/lockdown/disable_toolbar_editing"
@@ -53,6 +54,7 @@ G_BEGIN_DECLS
 #define CONF_LOCKDOWN_DISABLE_PRINTING		"/desktop/gnome/lockdown/disable_printing"
 #define CONF_LOCKDOWN_DISABLE_PRINT_SETUP	"/desktop/gnome/lockdown/disable_print_setup"
 #define CONF_LOCKDOWN_DISABLE_COMMAND_LINE	"/desktop/gnome/lockdown/disable_command_line"
+#define CONF_LOCKDOWN_DISABLE_QUIT		"/apps/epiphany/lockdown/disable_quit"
 
 /* System prefs */
 #define CONF_DESKTOP_FTP_HANDLER	"/desktop/gnome/url-handlers/ftp/command"
Index: src/ephy-shell.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/ephy-shell.c,v
retrieving revision 1.85
diff -u -p -r1.85 ephy-shell.c
--- src/ephy-shell.c	29 Mar 2004 18:48:38 -0000	1.85
+++ src/ephy-shell.c	14 Apr 2004 12:45:42 -0000
@@ -554,6 +554,8 @@ ephy_shell_new_tab (EphyShell *shell,
 	if (flags & EPHY_NEW_TAB_IN_NEW_WINDOW) in_new_window = TRUE;
 	if (flags & EPHY_NEW_TAB_IN_EXISTING_WINDOW) in_new_window = FALSE;
 
+	in_new_window = in_new_window && !eel_gconf_get_boolean (CONF_LOCKDOWN_FULLSCREEN);
+
 	jump_to = (flags & EPHY_NEW_TAB_JUMP);
 
 	if (!in_new_window && parent_window != NULL)
Index: src/ephy-tab.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/ephy-tab.c,v
retrieving revision 1.103
diff -u -p -r1.103 ephy-tab.c
--- src/ephy-tab.c	14 Apr 2004 12:21:40 -0000	1.103
+++ src/ephy-tab.c	14 Apr 2004 12:45:43 -0000
@@ -39,6 +39,7 @@
 #include "ephy-history.h"
 #include "ephy-embed-shell.h"
 #include "ephy-shell.h"
+#include "ephy-session.h"
 
 #include <glib/gi18n.h>
 #include <libgnomevfs/gnome-vfs-uri.h>
@@ -934,24 +935,49 @@ ephy_tab_new_window_cb (EphyEmbed *embed
 			EphyEmbedChrome chromemask, EphyTab *tab)
 {
 	EphyTab *new_tab;
-	EphyWindow *window;
 
 	LOG ("ephy_tab_new_window_cb tab %p with parent %p chrome %d",
 	     tab, ((GtkWidget *) tab)->parent, chromemask)
 
-	if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_JAVASCRIPT_CHROME))
+	if (eel_gconf_get_boolean (CONF_LOCKDOWN_FULLSCREEN))
 	{
-		window = ephy_window_new ();
+		/* we cannot use gtk_widget_get_toplevel() to get the parent window
+		 * from the tab, because if the tab is destroyed (i.e. the new window
+		 * is opened on close), the parent is NULL. So we use
+		 * ephy_session_get_active_window() which in fulscreen-lockdown mode
+		 * should return the lone EphyWindow.
+		 *
+		 * To avoid crashers when the new window is opened but closes on onBlur,
+		 * we jump to the new tab.
+		 */
+		EphySession *session;
+
+		session = EPHY_SESSION (ephy_shell_get_session (ephy_shell));
+		new_tab = ephy_shell_new_tab
+			(ephy_shell,
+			 ephy_session_get_active_window (session),
+			 tab, NULL,
+			 EPHY_NEW_TAB_IN_EXISTING_WINDOW |
+			 EPHY_NEW_TAB_JUMP);
 	}
 	else
 	{
-		window = ephy_window_new_with_chrome (chromemask);
-	}
+		EphyWindow *window;
 
-	new_tab = ephy_tab_new ();
-	gtk_widget_show (GTK_WIDGET (new_tab));
+		if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_JAVASCRIPT_CHROME))
+		{
+			window = ephy_window_new ();
+		}
+		else
+		{
+			window = ephy_window_new_with_chrome (chromemask);
+		}
 
-        ephy_window_add_tab (window, new_tab, EPHY_NOTEBOOK_INSERT_GROUPED, FALSE);
+		new_tab = ephy_tab_new ();
+		gtk_widget_show (GTK_WIDGET (new_tab));
+	
+		ephy_window_add_tab (window, new_tab, EPHY_NOTEBOOK_INSERT_GROUPED, FALSE);
+	}
 
 	*new_embed = ephy_tab_get_embed (new_tab);
 }
Index: src/ephy-window.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/ephy-window.c,v
retrieving revision 1.180
diff -u -p -r1.180 ephy-window.c
--- src/ephy-window.c	9 Apr 2004 21:12:49 -0000	1.180
+++ src/ephy-window.c	14 Apr 2004 12:45:44 -0000
@@ -525,6 +519,14 @@ ephy_window_fullscreen (EphyWindow *wind
 
 	window->priv->mode = EPHY_WINDOW_MODE_FULLSCREEN;
 
+	sync_chromes_visibility (window);
+
+	if (eel_gconf_get_boolean (CONF_LOCKDOWN_FULLSCREEN))
+	{
+		/* no need to show "exit fullscreen" button */
+		return;
+	}
+
 	popup = gtk_window_new (GTK_WINDOW_POPUP);
 	window->priv->exit_fullscreen_popup = popup;
 
@@ -554,8 +556,6 @@ ephy_window_fullscreen (EphyWindow *wind
 	g_signal_connect (G_OBJECT (gdk_screen_get_default ()),
                           "size-changed", G_CALLBACK (size_changed_cb),
 			  window);
-
-	sync_chromes_visibility (window);
 }
 
 static void
@@ -563,12 +563,15 @@ ephy_window_unfullscreen (EphyWindow *wi
 {
 	window->priv->mode = EPHY_WINDOW_MODE_NORMAL;
 
-	g_signal_handlers_disconnect_by_func (G_OBJECT (gdk_screen_get_default ()),
-                                              G_CALLBACK (size_changed_cb),
-					      window);
+	if (window->priv->exit_fullscreen_popup != NULL)
+	{
+		g_signal_handlers_disconnect_by_func (G_OBJECT (gdk_screen_get_default ()),
+						      G_CALLBACK (size_changed_cb),
+						      window);
 
-	gtk_widget_destroy (window->priv->exit_fullscreen_popup);
-	window->priv->exit_fullscreen_popup = NULL;
+		gtk_widget_destroy (window->priv->exit_fullscreen_popup);
+		window->priv->exit_fullscreen_popup = NULL;
+	}
 
 	sync_chromes_visibility (window);
 }
@@ -912,7 +915,7 @@ update_actions_sensitivity (EphyWindow *
 	GtkActionGroup *popups_action_group = GTK_ACTION_GROUP (window->priv->popups_action_group);
 	GtkAction *action;
 	gboolean bookmarks_editable, save_to_disk;
-	gboolean printing, print_setup;
+	gboolean printing, print_setup, fullscreen;
 
 	action = gtk_action_group_get_action (action_group, "ViewToolbar");
 	g_object_set (action, "sensitive", eel_gconf_key_is_writable (CONF_WINDOWS_SHOW_TOOLBARS), NULL);
@@ -964,6 +967,14 @@ update_actions_sensitivity (EphyWindow *
 
 	action = gtk_action_group_get_action (action_group, "EditToolbar");
 	g_object_set (action, "sensitive", ! eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_TOOLBAR_EDITING), NULL);
+
+	fullscreen = eel_gconf_get_boolean (CONF_LOCKDOWN_FULLSCREEN);
+	action = gtk_action_group_get_action (action_group, "FileNewWindow");
+	g_object_set (action, "sensitive", !fullscreen, NULL);
+	action = gtk_action_group_get_action (action_group, "ViewFullscreen");
+	g_object_set (action, "sensitive", !fullscreen, NULL);
+	action = gtk_action_group_get_action (action_group, "TabsDetach");
+	g_object_set (action, "sensitive", !fullscreen, NULL);
 }
 
 static void
@@ -1670,6 +1681,11 @@ tab_detached_cb (EphyNotebook *notebook,
 
 	g_return_if_fail (EPHY_IS_TAB (tab));
 
+	if (eel_gconf_get_boolean (CONF_LOCKDOWN_FULLSCREEN))
+	{
+		return;
+	}
+
 	window = ephy_window_new ();
 	ephy_notebook_move_tab (notebook,
 				EPHY_NOTEBOOK (ephy_window_get_notebook (window)),
@@ -1690,7 +1706,12 @@ tab_delete_cb (EphyNotebook *notebook,
 {
 	g_return_val_if_fail (EPHY_IS_TAB (tab), FALSE);
 
-	if (ephy_embed_has_modified_forms (ephy_tab_get_embed (tab)))
+	if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_QUIT) &&
+	    gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->priv->notebook)) == 1)
+	{
+		return TRUE;
+	}
+	else if (ephy_embed_has_modified_forms (ephy_tab_get_embed (tab)))
 	{
 		return !confirm_close_with_modified_forms (window);
 	}
@@ -1976,6 +1992,11 @@ ephy_window_init (EphyWindow *window)
 			  G_CALLBACK (ephy_window_delete_event_cb),
 			  window);
 
+	if (eel_gconf_get_boolean (CONF_LOCKDOWN_FULLSCREEN))
+	{
+		gtk_window_fullscreen (GTK_WINDOW (window));
+	}
+
 	/* lockdown pref notifiers */
 	window->priv->disable_arbitrary_url_notifier_id = eel_gconf_notification_add
 		(CONF_LOCKDOWN_DISABLE_ARBITRARY_URL,
Index: src/window-commands.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/window-commands.c,v
retrieving revision 1.121
diff -u -p -r1.121 window-commands.c
--- src/window-commands.c	5 Apr 2004 17:53:29 -0000	1.121
+++ src/window-commands.c	14 Apr 2004 12:45:44 -0000
@@ -285,7 +285,7 @@ window_cmd_file_new_window (GtkAction *a
 	tab = ephy_window_get_active_tab (window);
 	g_return_if_fail (tab != NULL);
 
-	ephy_shell_new_tab (ephy_shell, NULL, tab, NULL,
+	ephy_shell_new_tab (ephy_shell, window, tab, NULL,
 			    EPHY_NEW_TAB_NEW_PAGE |
 			    EPHY_NEW_TAB_IN_NEW_WINDOW);
 }
@@ -435,6 +435,12 @@ window_cmd_file_close_window (GtkAction 
 		              EphyWindow *window)
 {
 	EphyTab *tab;
+
+	if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_QUIT) &&
+	    gtk_notebook_get_n_pages (GTK_NOTEBOOK (ephy_window_get_notebook (window))) == 1)
+	{
+		return;
+	}
 
 	tab = ephy_window_get_active_tab (window);
 	g_return_if_fail (tab != NULL);
