aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-notebook.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-10-03 02:50:51 +0800
committerChristian Persch <chpe@src.gnome.org>2005-10-03 02:50:51 +0800
commitabe1a40d562514cfe6b3c8dae1397d511062ddab (patch)
tree08fb5018af362336c9b92f0e1d83d25c2bd3b2b8 /src/ephy-notebook.c
parent8a92076ee578e5c6aa8bb0a39fcdbe8741ce2e52 (diff)
downloadgsoc2013-epiphany-abe1a40d562514cfe6b3c8dae1397d511062ddab.tar
gsoc2013-epiphany-abe1a40d562514cfe6b3c8dae1397d511062ddab.tar.gz
gsoc2013-epiphany-abe1a40d562514cfe6b3c8dae1397d511062ddab.tar.bz2
gsoc2013-epiphany-abe1a40d562514cfe6b3c8dae1397d511062ddab.tar.lz
gsoc2013-epiphany-abe1a40d562514cfe6b3c8dae1397d511062ddab.tar.xz
gsoc2013-epiphany-abe1a40d562514cfe6b3c8dae1397d511062ddab.tar.zst
gsoc2013-epiphany-abe1a40d562514cfe6b3c8dae1397d511062ddab.zip
Use nsIDOMWindowInternal::Close to close tabs. Delay tabs destruction to
2005-10-02 Christian Persch <chpe@cvs.gnome.org> * configure.ac: * embed/ephy-embed-shell.c: (ephy_embed_shell_dispose), (ephy_embed_shell_finalize), (ephy_embed_shell_class_init): * embed/ephy-embed.c: (ephy_embed_base_init), (ephy_embed_show_page_certificate), (ephy_embed_close): * embed/ephy-embed.h: * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * embed/mozilla/mozilla-embed.cpp: * src/ephy-notebook.c: (ephy_notebook_class_init), (close_button_clicked_cb): * src/ephy-notebook.h: * src/ephy-python.c: (ephy_python_init), (ephy_python_shutdown), (ephy_python_schedule_gc): * src/ephy-shell.c: (ephy_shell_class_init), (gnome_session_init), (ephy_shell_dispose), (ephy_shell_finalize): * src/ephy-tab.c: (ephy_tab_init): * src/ephy-window.c: (construct_confirm_close_dialog), (confirm_close_with_modified_forms), (embed_modal_alert_cb), (idle_tab_remove_cb), (schedule_tab_close), (embed_close_request_cb), (embed_destroy_browser_cb), (tab_added_cb), (tab_removed_cb), (tab_close_request_cb), (setup_notebook), (remove_true), (ephy_window_dispose), (cancel_handler), (ephy_window_init), (ephy_window_finalize): * src/window-commands.c: (event_with_shift), (window_cmd_view_reload), (window_cmd_file_close_window): Use nsIDOMWindowInternal::Close to close tabs. Delay tabs destruction to an idle handler, to avoid crashes when tabs are closed from signal handlers (blur, mousedown, keydown etc). Fixes bug #172878, bug #172879, bug #172882, bug #303254, bug #313425.
Diffstat (limited to 'src/ephy-notebook.c')
-rw-r--r--src/ephy-notebook.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index fd4d41208..63e4a92c1 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -113,7 +113,7 @@ enum
TAB_REMOVED,
TABS_REORDERED,
TAB_DETACHED,
- TAB_DELETE,
+ TAB_CLOSE_REQUEST,
LAST_SIGNAL
};
@@ -260,14 +260,14 @@ ephy_notebook_class_init (EphyNotebookClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
- signals[TAB_DELETE] =
- g_signal_new ("tab_delete",
+ signals[TAB_CLOSE_REQUEST] =
+ g_signal_new ("tab-close-request",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EphyNotebookClass, tab_delete),
- g_signal_accumulator_true_handled, NULL,
- ephy_marshal_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
+ G_STRUCT_OFFSET (EphyNotebookClass, tab_close_req),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE,
1,
EPHY_TYPE_TAB);
@@ -1023,16 +1023,10 @@ sync_label (EphyTab *tab, GParamSpec *pspec, GtkWidget *proxy)
static void
close_button_clicked_cb (GtkWidget *widget, GtkWidget *tab)
{
- EphyNotebook *notebook;
- gboolean inhibited = FALSE;
-
- notebook = EPHY_NOTEBOOK (gtk_widget_get_parent (tab));
- g_signal_emit (G_OBJECT (notebook), signals[TAB_DELETE], 0, tab, &inhibited);
+ GtkWidget *notebook;
- if (inhibited == FALSE)
- {
- ephy_notebook_remove_tab (notebook, EPHY_TAB (tab));
- }
+ notebook = gtk_widget_get_parent (tab);
+ g_signal_emit (notebook, signals[TAB_CLOSE_REQUEST], 0, tab);
}
static void