[epiphany/mcatanzaro/app-mode-fixes: 2/3] window: fix critical on startup in app mode
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [epiphany/mcatanzaro/app-mode-fixes: 2/3] window: fix critical on startup in app mode
- Date: Thu, 26 Mar 2020 19:47:04 +0000 (UTC)
commit 9bcda80d33126a559960436183c43d4cb6f01012
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Thu Mar 26 13:43:35 2020 -0500
    window: fix critical on startup in app mode
    
    This regressed in 7a4e510e. We have to make sure the title widget is
    actually a location entry before using it as such. (In app mode, there
    is no location entry.)
 src/ephy-window.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index c7643f2d6..36d0535a8 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -3040,7 +3040,6 @@ ephy_window_update_entry_focus (EphyWindow  *window,
                                 EphyWebView *view)
 {
   GtkWidget *title_widget;
-  EphyLocationEntry *lentry;
   GtkWidget *entry;
   const char *address = NULL;
 
@@ -3049,10 +3048,10 @@ ephy_window_update_entry_focus (EphyWindow  *window,
     return;
 
   title_widget = GTK_WIDGET (ephy_header_bar_get_title_widget (EPHY_HEADER_BAR (window->header_bar)));
-  lentry = EPHY_LOCATION_ENTRY (title_widget);
-  entry = ephy_location_entry_get_entry (lentry);
-
-  gtk_entry_grab_focus_without_selecting (GTK_ENTRY (entry));
+  if (EPHY_IS_LOCATION_ENTRY (title_widget)) {
+    entry = ephy_location_entry_get_entry (EPHY_LOCATION_ENTRY (title_widget));
+    gtk_entry_grab_focus_without_selecting (GTK_ENTRY (entry));
+  }
 }
 
 static void
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]