[epiphany] Fix a runtime critical warning when starting a web application
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Fix a runtime critical warning when starting a web application
- Date: Tue, 28 May 2019 14:26:33 +0000 (UTC)
commit ec7b8031151fd9fbea17cd4fb15a9ed7bc025b91
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Tue May 28 10:45:11 2019 +0200
Fix a runtime critical warning when starting a web application
GLib-GObject-CRITICAL **: 09:47:02.477: g_object_bind_property_full: assertion 'G_IS_OBJECT (source)'
failed
ephy_shell_get_session() returns NULL in web app mode too.
src/ephy-window.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index e94e0363d..423d55e3d 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -3523,6 +3523,7 @@ ephy_window_constructed (GObject *object)
EphyEmbedShellMode mode;
EphyWindowChrome chrome = EPHY_WINDOW_CHROME_DEFAULT;
GApplication *app;
+ EphySession *session;
G_OBJECT_CLASS (ephy_window_parent_class)->constructed (object);
@@ -3700,14 +3701,15 @@ ephy_window_constructed (GObject *object)
action_group = gtk_widget_get_action_group (GTK_WIDGET (window), "tab");
action = g_action_map_lookup_action (G_ACTION_MAP (action_group), "reopen");
- if (mode == EPHY_EMBED_SHELL_MODE_INCOGNITO || mode == EPHY_EMBED_SHELL_MODE_AUTOMATION) {
- g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
- } else {
- g_object_bind_property (G_OBJECT (ephy_shell_get_session (shell)),
+ session = ephy_shell_get_session (shell);
+ if (session) {
+ g_object_bind_property (session,
"can-undo-tab-closed",
action,
"enabled",
G_BINDING_SYNC_CREATE);
+ } else {
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
}
window->mouse_gesture_controller = ephy_mouse_gesture_controller_new (window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]