зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1432414 - Use gtk_get_current_event_time() instead of gdk_x11_display_get_user_time() on Wayland, r=jhorak
Emulate what gtk+/gtkwindow.c gtk_window_present_with_time() does - use gdk_x11_display_get_user_time() on X11 and gtk_get_current_event_time() on Wayland to get event timestamp. MozReview-Commit-ID: GEU6ZrQxq6v --HG-- extra : rebase_source : db2f3ac03ae4ec9f9c1655cf682bff60a96dd3da
This commit is contained in:
Родитель
04acd987f8
Коммит
0cd098101c
|
@ -229,6 +229,7 @@ STUB(gtk_file_filter_new)
|
|||
STUB(gtk_file_filter_set_name)
|
||||
STUB(gtk_fixed_new)
|
||||
STUB(gtk_frame_new)
|
||||
STUB(gtk_get_current_event_time)
|
||||
STUB(gtk_grab_add)
|
||||
STUB(gtk_grab_remove)
|
||||
STUB(gtk_handle_box_new)
|
||||
|
|
|
@ -1363,13 +1363,17 @@ SetUserTimeAndStartupIDForActivatedWindow(GtkWidget* aWindow)
|
|||
/* static */ guint32
|
||||
nsWindow::GetLastUserInputTime()
|
||||
{
|
||||
// gdk_x11_display_get_user_time tracks button and key presses,
|
||||
// DESKTOP_STARTUP_ID used to start the app, drop events from external
|
||||
// drags, WM_DELETE_WINDOW delete events, but not usually mouse motion nor
|
||||
// gdk_x11_display_get_user_time/gtk_get_current_event_time tracks
|
||||
// button and key presses, DESKTOP_STARTUP_ID used to start the app,
|
||||
// drop events from external drags,
|
||||
// WM_DELETE_WINDOW delete events, but not usually mouse motion nor
|
||||
// button and key releases. Therefore use the most recent of
|
||||
// gdk_x11_display_get_user_time and the last time that we have seen.
|
||||
guint32 timestamp =
|
||||
gdk_x11_display_get_user_time(gdk_display_get_default());
|
||||
GdkDisplay* gdkDisplay = gdk_display_get_default();
|
||||
guint32 timestamp = GDK_IS_X11_DISPLAY(gdkDisplay) ?
|
||||
gdk_x11_display_get_user_time(gdkDisplay) :
|
||||
gtk_get_current_event_time();
|
||||
|
||||
if (sLastUserInputTime != GDK_CURRENT_TIME &&
|
||||
TimestampIsNewerThan(sLastUserInputTime, timestamp)) {
|
||||
return sLastUserInputTime;
|
||||
|
|
Загрузка…
Ссылка в новой задаче