[epiphany/mcatanzaro/gtk-window-present-with-time: 8/8] Stop using gtk_window_present()



commit ce0eb58363f47966b523bdbb5dc084589fac6997
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Mon Mar 4 13:37:37 2019 -0600

    Stop using gtk_window_present()
    
    CI is broken due to -Wdeprecated-declarations. Fixes #694.

 src/ephy-session.c |  2 +-
 src/ephy-window.c  | 11 +++++++++--
 src/prefs-dialog.c | 14 +++++++-------
 3 files changed, 17 insertions(+), 10 deletions(-)
---
diff --git a/src/ephy-session.c b/src/ephy-session.c
index 465ac5053..ed8fb3502 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -273,7 +273,7 @@ ephy_session_undo_close_tab (EphySession *session)
   }
 
   gtk_widget_grab_focus (GTK_WIDGET (new_tab));
-  gtk_window_present (GTK_WINDOW (window));
+  gtk_window_present_with_time (GTK_WINDOW (window), gtk_get_current_event_time ());
 
   closed_tab_free (tab);
 
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 9db0041a0..ef215b9bd 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -171,10 +171,12 @@ struct _EphyWindow {
   guint is_fullscreen : 1;
   guint closing : 1;
   guint is_popup : 1;
-  guint present_on_insert : 1;
   guint updating_address : 1;
   guint force_close : 1;
   guint checking_modified_forms : 1;
+  guint present_on_insert : 1;
+
+  guint32 present_on_insert_user_time;
 };
 
 enum {
@@ -2586,7 +2588,11 @@ notebook_popup_menu_cb (GtkNotebook *notebook,
 static gboolean
 present_on_idle_cb (GtkWindow *window)
 {
-  gtk_window_present (window);
+  EphyWindow *ephy_window = EPHY_WINDOW (window);
+
+  gtk_window_present_with_time (window, ephy_window->present_on_insert_user_time);
+  ephy_window->present_on_insert_user_time = 0;
+
   return FALSE;
 }
 
@@ -2868,6 +2874,7 @@ notebook_create_window_cb (GtkNotebook *notebook,
   new_window = ephy_window_new ();
 
   new_window->present_on_insert = TRUE;
+  new_window->present_on_insert_user_time = gtk_get_current_event_time ();
 
   return ephy_window_get_notebook (new_window);
 }
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 1fe3cc726..9ef2e5515 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -677,7 +677,7 @@ on_sync_synced_tabs_button_clicked (GtkWidget   *button,
   synced_tabs_dialog = synced_tabs_dialog_new (manager);
   gtk_window_set_transient_for (GTK_WINDOW (synced_tabs_dialog), GTK_WINDOW (dialog));
   gtk_window_set_modal (GTK_WINDOW (synced_tabs_dialog), TRUE);
-  gtk_window_present (GTK_WINDOW (synced_tabs_dialog));
+  gtk_window_present_with_time (GTK_WINDOW (synced_tabs_dialog), gtk_get_current_event_time ());
 }
 
 static void
@@ -885,7 +885,7 @@ on_manage_webapp_additional_urls_button_clicked (GtkWidget   *button,
   urls_dialog = ephy_webapp_additional_urls_dialog_new ();
   gtk_window_set_transient_for (GTK_WINDOW (urls_dialog), GTK_WINDOW (dialog));
   gtk_window_set_modal (GTK_WINDOW (urls_dialog), TRUE);
-  gtk_window_present (GTK_WINDOW (urls_dialog));
+  gtk_window_present_with_time (GTK_WINDOW (urls_dialog), gtk_get_current_event_time ());
 }
 
 static void
@@ -898,7 +898,7 @@ on_manage_cookies_button_clicked (GtkWidget   *button,
 
   gtk_window_set_transient_for (GTK_WINDOW (cookies_dialog), GTK_WINDOW (dialog));
   gtk_window_set_modal (GTK_WINDOW (cookies_dialog), TRUE);
-  gtk_window_present (GTK_WINDOW (cookies_dialog));
+  gtk_window_present_with_time (GTK_WINDOW (cookies_dialog), gtk_get_current_event_time ());
 }
 
 static void
@@ -913,7 +913,7 @@ on_manage_passwords_button_clicked (GtkWidget   *button,
 
   gtk_window_set_transient_for (GTK_WINDOW (passwords_dialog), GTK_WINDOW (dialog));
   gtk_window_set_modal (GTK_WINDOW (passwords_dialog), TRUE);
-  gtk_window_present (GTK_WINDOW (passwords_dialog));
+  gtk_window_present_with_time (GTK_WINDOW (passwords_dialog), gtk_get_current_event_time ());
 }
 
 static void
@@ -926,7 +926,7 @@ on_search_engine_dialog_button_clicked (GtkWidget   *button,
 
   gtk_window_set_transient_for (search_engine_dialog, GTK_WINDOW (dialog));
   gtk_window_set_modal (search_engine_dialog, TRUE);
-  gtk_window_present (search_engine_dialog);
+  gtk_window_present_with_time (search_engine_dialog, gtk_get_current_event_time ());
 }
 
 static gboolean
@@ -1410,7 +1410,7 @@ language_editor_add_button_clicked_cb (GtkWidget   *button,
       (gpointer *)add_lang_dialog);
   }
 
-  gtk_window_present (GTK_WINDOW (pd->add_lang_dialog));
+  gtk_window_present_with_time (GTK_WINDOW (pd->add_lang_dialog), gtk_get_current_event_time ());
 }
 
 static void
@@ -1708,7 +1708,7 @@ clear_personal_data_button_clicked_cb (GtkWidget   *button,
                                NULL);
   gtk_window_set_transient_for (GTK_WINDOW (clear_dialog), GTK_WINDOW (dialog));
   gtk_window_set_modal (GTK_WINDOW (clear_dialog), TRUE);
-  gtk_window_present (GTK_WINDOW (clear_dialog));
+  gtk_window_present_with_time (GTK_WINDOW (clear_dialog), gtk_get_current_event_time ());
 }
 
 static gboolean


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