[gtk/wip/mjog/window-present-current-time] Use gtk_get_current_event_time() in gtk_window_present()



commit ce2104c5cdbff6dc8595f32651d9bb260c4c5a82
Author: Michael Gratton <mike vee net>
Date:   Tue Apr 2 11:16:34 2019 +1100

    Use gtk_get_current_event_time() in gtk_window_present()
    
    This makes gtk_window_present() try a bit harder to get a valid
    timestamp when presenting a window, since it's often not possible to do
    so. Update docs to better reflect reality.
    
    See #624

 gtk/gtkwindow.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index fdead34439..2d7fbe6bd7 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -8089,14 +8089,18 @@ gtk_window_snapshot (GtkWidget   *widget,
  * gtk_window_present:
  * @window: a #GtkWindow
  *
- * 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.
+ * Presents a window to the user. When presenting a window in response
+ * to an GDK windowing event, call gtk_window_present_with_time() with
+ * the timestamp from the event instead, since this call may not be
+ * able to gather a valid timestamp to allow focus stealing prevention
+ * to work correctly.
+ *
+ * See gtk_window_present_with_time() for more details.
  **/
 void
 gtk_window_present (GtkWindow *window)
 {
-  gtk_window_present_with_time (window, GDK_CURRENT_TIME);
+  gtk_window_present_with_time (window, gtk_get_current_event_time ());
 }
 
 /**


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