[balsa/wip/gtk4: 239/351] Use gtkwidget_get_realized



commit 7b3ae4760111007c7aa19cc27269ca21e854689f
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Tue Mar 20 20:32:42 2018 -0400

    Use gtkwidget_get_realized
    
    to check whether a widget has been realized, instead of using
    gtk_widget_get_has_surface, which indicates something totally different.
    
    More fallout from the GdkWindow rename.

 libbalsa/address-view.c |    2 +-
 src/balsa-index.c       |    6 +++---
 src/balsa-message.c     |    2 +-
 src/sendmsg-window.c    |    2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/libbalsa/address-view.c b/libbalsa/address-view.c
index 9318163..0fb166a 100644
--- a/libbalsa/address-view.c
+++ b/libbalsa/address-view.c
@@ -845,7 +845,7 @@ lbav_entry_changed_cb(GtkEntry * entry, LibBalsaAddressView * address_view)
 
     completion = gtk_entry_get_completion(entry);
 
-    if (gtk_widget_get_has_surface(GTK_WIDGET(entry)))
+    if (gtk_widget_get_realized(GTK_WIDGET(entry)))
         lbav_entry_setup_matches(address_view, entry, completion,
                                  LIBBALSA_ADDRESS_VIEW_MATCH_FAST);
     address_view->last_was_escape = FALSE;
diff --git a/src/balsa-index.c b/src/balsa-index.c
index 8e4f990..5c1516c 100644
--- a/src/balsa-index.c
+++ b/src/balsa-index.c
@@ -1409,7 +1409,7 @@ bndx_mailbox_changed_idle(BalsaIndex * bindex)
 static void
 bndx_mailbox_changed_cb(LibBalsaMailbox * mailbox, BalsaIndex * bindex)
 {
-    if (!gtk_widget_get_has_surface(GTK_WIDGET(bindex)))
+    if (!gtk_widget_get_realized(GTK_WIDGET(bindex)))
         return;
 
     /* Find the next message to be shown now, not later in the idle
@@ -2107,7 +2107,7 @@ bndx_expand_to_row(BalsaIndex * index, GtkTreePath * path)
     GtkTreePath *tmp;
     gint i, j;
 
-    if (!gtk_widget_get_has_surface(GTK_WIDGET(index)))
+    if (!gtk_widget_get_realized(GTK_WIDGET(index)))
         return;
 
     tmp = gtk_tree_path_copy(path);
@@ -2660,7 +2660,7 @@ balsa_index_ensure_visible(BalsaIndex * index)
     GdkRectangle rect;
     GtkTreePath *path = NULL;
 
-    if (!gtk_widget_get_has_surface(GTK_WIDGET(tree_view)))
+    if (!gtk_widget_get_realized(GTK_WIDGET(tree_view)))
         return;
 
     if (!bndx_find_current_msgno(index, &path, NULL)) {
diff --git a/src/balsa-message.c b/src/balsa-message.c
index 8b90597..94a2d9a 100644
--- a/src/balsa-message.c
+++ b/src/balsa-message.c
@@ -3258,7 +3258,7 @@ balsa_message_find_in_message(BalsaMessage * bm)
         bm_find_set_status(bm, BM_FIND_STATUS_INIT);
 
         gtk_widget_show(bm->find_bar);
-        if (gtk_widget_get_has_surface(bm->find_entry))
+        if (gtk_widget_get_realized(bm->find_entry))
             gtk_widget_grab_focus(bm->find_entry);
     }
 }
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index b817cf4..45e4e89 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -6155,7 +6155,7 @@ sw_spell_check_activated(GSimpleAction * action,
     BalsaSpellCheck *sc;
 
     if (bsmsg->spell_checker) {
-        if (gtk_widget_get_has_surface(bsmsg->spell_checker)) {
+        if (gtk_widget_get_realized(bsmsg->spell_checker)) {
             gtk_window_present(GTK_WINDOW(bsmsg->spell_checker));
             return;
         } else


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]