[gtk/gtk-3-24] window: Deprecate gtk_window_present()



commit 2ca4a3cb41fc6d606e85eb5e2414d1d4757fa64b
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jul 25 17:18:55 2018 +0200

    window: Deprecate gtk_window_present()
    
    And expect gtk_window_present_with_time() to be used instead.

 gtk/gtkwindow.c | 43 +++++++++++++++++++++++--------------------
 gtk/gtkwindow.h |  2 +-
 2 files changed, 24 insertions(+), 21 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 762adda344..1a954f1dc7 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -10483,23 +10483,11 @@ gtk_window_draw (GtkWidget *widget,
  * gtk_window_present:
  * @window: a #GtkWindow
  *
- * Presents a window to the user. This may mean raising the window
- * in the stacking order, deiconifying it, moving it to the current
- * desktop, and/or giving it the keyboard focus, possibly dependent
- * on the user’s platform, window manager, and preferences.
+ * Presents a window to the user. This function should not be used
+ * as when it is called, it is too late to gather a valid timestamp
+ * to allow focus stealing prevention to work correctly.
  *
- * If @window is hidden, this function calls gtk_widget_show()
- * as well.
- * 
- * This function should be used when the user tries to open a window
- * that’s already open. Say for example the preferences dialog is
- * currently open, and the user chooses Preferences from the menu
- * a second time; use gtk_window_present() to move the already-open dialog
- * where the user can see it.
- *
- * If you are calling this function in response to a user interaction,
- * it is preferable to use gtk_window_present_with_time().
- * 
+ * Deprecated: 3.24: Use gtk_window_present_with_time() instead.
  **/
 void
 gtk_window_present (GtkWindow *window)
@@ -10513,10 +10501,25 @@ gtk_window_present (GtkWindow *window)
  * @timestamp: the timestamp of the user interaction (typically a 
  *   button or key press event) which triggered this call
  *
- * Presents a window to the user in response to a user interaction.
- * If you need to present a window without a timestamp, use 
- * gtk_window_present(). See gtk_window_present() for details. 
- * 
+ * Presents a window to the user. This may mean raising the window
+ * in the stacking order, deiconifying it, moving it to the current
+ * desktop, and/or giving it the keyboard focus, possibly dependent
+ * on the user’s platform, window manager, and preferences.
+ *
+ * If @window is hidden, this function calls gtk_widget_show()
+ * as well.
+ *
+ * This function should be used when the user tries to open a window
+ * that’s already open. Say for example the preferences dialog is
+ * currently open, and the user chooses Preferences from the menu
+ * a second time; use gtk_window_present() to move the already-open dialog
+ * where the user can see it.
+ *
+ * Presents a window to the user in response to a user interaction. The
+ * timestamp should be gathered when the window was requested to be shown
+ * (when clicking a link for example), rather than once the window is
+ * ready to be shown.
+ *
  * Since: 2.8
  **/
 void
diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h
index 322cfc96f8..e5d333155b 100644
--- a/gtk/gtkwindow.h
+++ b/gtk/gtkwindow.h
@@ -366,7 +366,7 @@ GDK_AVAILABLE_IN_ALL
 gboolean gtk_window_propagate_key_event   (GtkWindow        *window,
                                           GdkEventKey      *event);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_24_FOR(gtk_window_present_with_time)
 void     gtk_window_present            (GtkWindow *window);
 GDK_AVAILABLE_IN_ALL
 void     gtk_window_present_with_time  (GtkWindow *window,


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