Bug 212453 - [GTK] Gamepad events do not occur in the flatpak shell.
Summary: [GTK] Gamepad events do not occur in the flatpak shell.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Linux
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords:
Depends on:
Blocks: 133847
  Show dependency treegraph
 
Reported: 2020-05-27 19:19 PDT by ChangSeok Oh
Modified: 2022-09-17 13:38 PDT (History)
7 users (show)

See Also:


Attachments
Patch (1.55 KB, patch)
2020-10-19 12:48 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ChangSeok Oh 2020-05-27 19:19:07 PDT
After the gtk port moved to flatpak SDK, any signal from gamepads is not detected by webkit. Perhaps, sandbox of flatpak shell involved but it is not sure. https://github.com/flatpak/flatpak/issues/7
Comment 1 Philippe Normand 2020-05-28 02:15:19 PDT
Maybe Patrick could help here?
Comment 2 Philippe Normand 2020-05-29 09:25:38 PDT
ChangSeok, can you check if patching the bubblewrap launcher like in https://bugs.webkit.org/show_bug.cgi?id=212524 would help?
Comment 3 Philippe Normand 2020-05-29 09:27:39 PDT
Ah sorry, it might not help. If I understand the CMake option for this, the launcher is disabled when we build from the SDK:

if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT EXISTS "/.flatpak-info")
    WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BUBBLEWRAP_SANDBOX PUBLIC ON)
else ()
    WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BUBBLEWRAP_SANDBOX PUBLIC OFF)
endif ()
Comment 4 ChangSeok Oh 2020-05-29 16:05:57 PDT
(In reply to Philippe Normand from comment #3)
> Ah sorry, it might not help. If I understand the CMake option for this, the
> launcher is disabled when we build from the SDK:
> 
> if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT EXISTS "/.flatpak-info")
>     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BUBBLEWRAP_SANDBOX PUBLIC ON)
> else ()
>     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_BUBBLEWRAP_SANDBOX PUBLIC OFF)
> endif ()

You are right. The SDK based webkit build disables ENABLE_BUBBLEWRAP_SANDBOX. I tried to forcedly enable it in flatpak shell but I couldn't since bwrap is not available in the shell.
Comment 5 Adrian Perez 2020-10-19 11:54:53 PDT
The following merge request makes libmanette usable inside Flatpak:

  https://gitlab.gnome.org/aplazas/libmanette/-/merge_requests/19

The library needs to be built passing “-Dgudev=disabled” to Meson, and
libmanette will fall back to using “GFileMonitor” on ”/dev/input/*” to
find supported devices, which works inside the Flatpak sandbox if the
application has been configured with “--device=all”, but I suspect that
“--filesystem=/dev/input:ro” might work.
Comment 6 Adrian Perez 2020-10-19 12:44:04 PDT
(In reply to Adrian Perez from comment #5)
> The following merge request makes libmanette usable inside Flatpak:
> 
>   https://gitlab.gnome.org/aplazas/libmanette/-/merge_requests/19
> 
> The library needs to be built passing “-Dgudev=disabled” to Meson, and
> libmanette will fall back to using “GFileMonitor” on ”/dev/input/*” to
> find supported devices, which works inside the Flatpak sandbox if the
> application has been configured with “--device=all”, but I suspect that
> “--filesystem=/dev/input:ro” might work.

It turns out that we already have “--device=all” somewhere, checked with:

  % webkit-flatpak -c grep devices /.flatpak-info
  devices=dri;all;
  %

So for *development* the only moving part missing is compiling libmanette
with “-Dgudev=disabled” and then game pads should work in the MiniBrowser
for development 🙌️
Comment 7 Adrian Perez 2020-10-19 12:48:26 PDT
Created attachment 411777 [details]
Patch
Comment 8 EWS 2020-10-20 03:53:43 PDT
Committed r268721: <https://trac.webkit.org/changeset/268721>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 411777 [details].