diff options
author | Michael Gratton <mike@vee.net> | 2019-04-02 11:16:34 +1100 |
---|---|---|
committer | Michael Gratton <mike@vee.net> | 2019-04-02 11:16:34 +1100 |
commit | ce2104c5cdbff6dc8595f32651d9bb260c4c5a82 (patch) | |
tree | f9542e627533950c0284d00713da4b4bac098199 | |
parent | aacab81a3efe2ad36826af0c97e60bf52cdf502f (diff) | |
download | gtk+-wip/mjog/window-present-current-time.tar.gz |
Use gtk_get_current_event_time() in gtk_window_present()wip/mjog/window-present-current-time
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
-rw-r--r-- | gtk/gtkwindow.c | 12 |
1 files 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 ()); } /** |