Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GTK] Check window focus with gtk_window_is_active() #23598

Conversation

GeorgesStavracas
Copy link
Contributor

@GeorgesStavracas GeorgesStavracas commented Jan 31, 2024

7ca356b

[GTK] Check window focus with gtk_window_is_active()
https://bugs.webkit.org/show_bug.cgi?id=258264

Reviewed by Michael Catanzaro.

In GTK3, gtk_widget_has_focus() called on a GtkWindow has the semantics
of "does this window receive input". This semantic is not preserved in
GTK4; instead, gtk_window_is_active() is what yields the same results.

By using gtk_widget_has_focus() in UIGamepadProviderGtk, it always
returned false, and prevented gamepad detection from properly working.
Switch that to gtk_window_is_active().

* Source/WebKit/UIProcess/Gamepad/gtk/UIGamepadProviderGtk.cpp:
(WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):

Canonical link: https://commits.webkit.org/273882@main

3180c76

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-wpe
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ›  gtk
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv-sim
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@GeorgesStavracas GeorgesStavracas requested a review from a team as a code owner January 31, 2024 18:07
@TingPing TingPing added the WebKitGTK Bugs related to the Gtk API layer. label Jan 31, 2024
@mcatanzaro mcatanzaro added the safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks label Jan 31, 2024
@mcatanzaro
Copy link
Contributor

Welcome ;)

@webkit-ews-buildbot webkit-ews-buildbot added merge-queue Applied to send a pull request to merge-queue and removed safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks labels Feb 1, 2024
@webkit-ews-buildbot
Copy link
Collaborator

Safe-Merge-Queue: Build #10856.

https://bugs.webkit.org/show_bug.cgi?id=258264

Reviewed by Michael Catanzaro.

In GTK3, gtk_widget_has_focus() called on a GtkWindow has the semantics
of "does this window receive input". This semantic is not preserved in
GTK4; instead, gtk_window_is_active() is what yields the same results.

By using gtk_widget_has_focus() in UIGamepadProviderGtk, it always
returned false, and prevented gamepad detection from properly working.
Switch that to gtk_window_is_active().

* Source/WebKit/UIProcess/Gamepad/gtk/UIGamepadProviderGtk.cpp:
(WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):

Canonical link: https://commits.webkit.org/273882@main
@webkit-commit-queue webkit-commit-queue merged commit 7ca356b into WebKit:main Feb 1, 2024
@webkit-commit-queue
Copy link
Collaborator

Committed 273882@main (7ca356b): https://commits.webkit.org/273882@main

Reviewed commits have been landed. Closing PR #23598 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Feb 1, 2024
@GeorgesStavracas GeorgesStavracas deleted the eng/GTK-gamepad-API-does-not-work branch February 1, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebKitGTK Bugs related to the Gtk API layer.
Projects
None yet
6 participants