diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-08-01 03:03:36 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-08-01 03:03:36 +0800 |
commit | f4136997688796f1b6ad574f70d58ed32f3eb6c6 (patch) | |
tree | bf369681d8a2758842b955e4f0cd334839e1e79f | |
parent | 0429fb7f9526f93c453591c57139e7ac837429f1 (diff) | |
download | gsoc2013-epiphany-f4136997688796f1b6ad574f70d58ed32f3eb6c6.tar gsoc2013-epiphany-f4136997688796f1b6ad574f70d58ed32f3eb6c6.tar.gz gsoc2013-epiphany-f4136997688796f1b6ad574f70d58ed32f3eb6c6.tar.bz2 gsoc2013-epiphany-f4136997688796f1b6ad574f70d58ed32f3eb6c6.tar.lz gsoc2013-epiphany-f4136997688796f1b6ad574f70d58ed32f3eb6c6.tar.xz gsoc2013-epiphany-f4136997688796f1b6ad574f70d58ed32f3eb6c6.tar.zst gsoc2013-epiphany-f4136997688796f1b6ad574f70d58ed32f3eb6c6.zip |
Diconnect from screen's size-changed signal on finalize too.
2004-07-31 Christian Persch <chpe@cvs.gnome.org>
* src/ephy-window.c: (ephy_window_get_type),
(update_exit_fullscreen_popup_position), (screen_size_changed_cb),
(destroy_exit_fullscreen_popup), (ephy_window_destroy),
(add_widget), (ephy_window_fullscreen), (ephy_window_unfullscreen),
(update_chromes_actions), (update_actions_sensitivity):
Diconnect from screen's size-changed signal on finalize too.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | src/ephy-window.c | 119 |
2 files changed, 74 insertions, 55 deletions
@@ -1,3 +1,13 @@ +2004-07-31 Christian Persch <chpe@cvs.gnome.org> + + * src/ephy-window.c: (ephy_window_get_type), + (update_exit_fullscreen_popup_position), (screen_size_changed_cb), + (destroy_exit_fullscreen_popup), (ephy_window_destroy), + (add_widget), (ephy_window_fullscreen), (ephy_window_unfullscreen), + (update_chromes_actions), (update_actions_sensitivity): + + Diconnect from screen's size-changed signal on finalize too. + 2004-07-31 Adam Hooper <adamh@cvs.gnome.org> * src/ephy-tab.c: (ephy_tab_set_property), (ephy_tab_get_property), diff --git a/src/ephy-window.c b/src/ephy-window.c index b74bb4d8f..7ec311d48 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -379,9 +379,9 @@ static GObjectClass *parent_class = NULL; GType ephy_window_get_type (void) { - static GType ephy_window_type = 0; + static GType type = 0; - if (ephy_window_type == 0) + if (type == 0) { static const GTypeInfo our_info = { @@ -396,45 +396,12 @@ ephy_window_get_type (void) (GInstanceInitFunc) ephy_window_init }; - ephy_window_type = g_type_register_static (GTK_TYPE_WINDOW, - "EphyWindow", - &our_info, 0); + type = g_type_register_static (GTK_TYPE_WINDOW, + "EphyWindow", + &our_info, 0); } - return ephy_window_type; -} - -static void -ephy_window_destroy (GtkObject *gtkobject) -{ - EphyWindow *window = EPHY_WINDOW (gtkobject); - - LOG ("EphyWindow destroy %p", window) - - if (window->priv->closing == FALSE) - { - EphyExtension *manager; - - window->priv->closing = TRUE; - - /* Let the extensions detach themselves from the window */ - manager = EPHY_EXTENSION (ephy_shell_get_extensions_manager (ephy_shell)); - ephy_extension_detach_window (manager, window); - } - - if (window->priv->exit_fullscreen_popup) - { - gtk_widget_destroy (window->priv->exit_fullscreen_popup); - window->priv->exit_fullscreen_popup = NULL; - } - - GTK_OBJECT_CLASS (parent_class)->destroy (gtkobject); -} -static void -add_widget (GtkUIManager *merge, GtkWidget *widget, EphyWindow *window) -{ - gtk_box_pack_start (GTK_BOX (window->priv->menu_dock), - widget, FALSE, FALSE, 0); + return type; } static void @@ -448,6 +415,7 @@ update_exit_fullscreen_popup_position (EphyWindow *window) gtk_window_get_size (GTK_WINDOW (popup), &popup_width, &popup_height); + /* FIXME multihead */ gdk_screen_get_monitor_geometry (gdk_screen_get_default (), gdk_screen_get_monitor_at_window (gdk_screen_get_default (), @@ -468,12 +436,58 @@ update_exit_fullscreen_popup_position (EphyWindow *window) } static void -size_changed_cb (GdkScreen *screen, EphyWindow *window) +screen_size_changed_cb (GdkScreen *screen, + EphyWindow *window) { update_exit_fullscreen_popup_position (window); } static void +destroy_exit_fullscreen_popup (EphyWindow *window) +{ + if (window->priv->exit_fullscreen_popup != NULL) + { + /* FIXME multihead */ + g_signal_handlers_disconnect_by_func + (gdk_screen_get_default (), + G_CALLBACK (screen_size_changed_cb), window); + + gtk_widget_destroy (window->priv->exit_fullscreen_popup); + window->priv->exit_fullscreen_popup = NULL; + } +} + +static void +ephy_window_destroy (GtkObject *gtkobject) +{ + EphyWindow *window = EPHY_WINDOW (gtkobject); + + LOG ("EphyWindow destroy %p", window) + + if (window->priv->closing == FALSE) + { + EphyExtension *manager; + + window->priv->closing = TRUE; + + /* Let the extensions detach themselves from the window */ + manager = EPHY_EXTENSION (ephy_shell_get_extensions_manager (ephy_shell)); + ephy_extension_detach_window (manager, window); + } + + destroy_exit_fullscreen_popup (window); + + GTK_OBJECT_CLASS (parent_class)->destroy (gtkobject); +} + +static void +add_widget (GtkUIManager *merge, GtkWidget *widget, EphyWindow *window) +{ + gtk_box_pack_start (GTK_BOX (window->priv->menu_dock), + widget, FALSE, FALSE, 0); +} + +static void exit_fullscreen_button_clicked_cb (GtkWidget *button, EphyWindow *window) { GtkAction *action; @@ -566,13 +580,16 @@ ephy_window_fullscreen (EphyWindow *window) gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + gtk_window_set_resizable (GTK_WINDOW (popup), FALSE); + + /* FIXME multihead */ + g_signal_connect (gdk_screen_get_default (), "size-changed", + G_CALLBACK (screen_size_changed_cb), window); + update_exit_fullscreen_popup_position (window); gtk_widget_show (popup); - g_signal_connect (G_OBJECT (gdk_screen_get_default ()), - "size-changed", G_CALLBACK (size_changed_cb), - window); egg_editable_toolbar_set_model (EGG_EDITABLE_TOOLBAR (window->priv->toolbar), @@ -585,15 +602,7 @@ ephy_window_unfullscreen (EphyWindow *window) { window->priv->mode = EPHY_WINDOW_MODE_NORMAL; - 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; - } + destroy_exit_fullscreen_popup (window); egg_editable_toolbar_set_model (EGG_EDITABLE_TOOLBAR (window->priv->toolbar), @@ -958,7 +967,7 @@ connect_proxy_cb (GtkUIManager *manager, static void update_chromes_actions (EphyWindow *window) { - GtkActionGroup *action_group = GTK_ACTION_GROUP (window->priv->action_group); + GtkActionGroup *action_group = window->priv->action_group; GtkAction *action; gboolean show_statusbar, show_menubar, show_toolbar, show_bookmarksbar; @@ -997,8 +1006,8 @@ update_chromes_actions (EphyWindow *window) static void update_actions_sensitivity (EphyWindow *window) { - GtkActionGroup *action_group = GTK_ACTION_GROUP (window->priv->action_group); - GtkActionGroup *popups_action_group = GTK_ACTION_GROUP (window->priv->popups_action_group); + GtkActionGroup *action_group = window->priv->action_group; + GtkActionGroup *popups_action_group = window->priv->popups_action_group; GtkAction *action; gboolean bookmarks_editable, save_to_disk; gboolean printing, print_setup, fullscreen; |