Construct-bugs icon indicating copy to clipboard operation
Construct-bugs copied to clipboard

Mouse lock fails (Linux CEF)

Open IdeasPerSecond opened this issue 11 months ago • 5 comments

Problem description

Pointer lock fails on Linux using the new CEF exporter

Attach a .c3p

Pointer Lock Fails Linux.zip

Steps to reproduce

  1. Export Project for Linux (CEF)
  2. Select Options image
  3. Linux Options image
  4. Extract and run on Linux (Tested with Ubuntu 24.04.1 LTS)

Observed result

Pasted image

It seems there is a Wrong Document Error, as if the pointer lock is being called in the wrong place. "Uncaught (in promise) WrongDocumentError: The root document of this element is not valid for pointer lock."

Expected result

I expected the mouse lock to work as usual, not fail completely.

More details

System details

View details

Platform information Product: Construct 3 r416.2 (stable) Browser: Chrome 131.0.6778.264 Browser engine: Chromium Context: browser Operating system: Linux 6.8.0 Device type: desktop Device pixel ratio: 1 Logical CPU cores: 8 Approx. device memory: 8 GB User agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Language setting: en-US

Local storage Storage quota (approx): 65 gb Storage usage (approx): 145 kb (0%) Persistant storage: No

Browser support notes This list contains missing features that are not required, but could improve performance or user experience if supported.

Nothing is missing. Everything is OK! WebGL information Version string: WebGL 2.0 (OpenGL ES 3.0 Chromium) Numeric version: 2 Supports NPOT textures: yes Supports GPU profiling: no Supports highp precision: yes Vendor: Google Inc. (Intel) Renderer: ANGLE (Intel, Mesa Intel(R) HD Graphics 530 (SKL GT2), OpenGL 4.6) Major performance caveat: no Maximum texture size: 16384 Point size range: 1 to 255 Extensions:

EXT_clip_control EXT_color_buffer_float EXT_color_buffer_half_float EXT_conservative_depth EXT_depth_clamp EXT_disjoint_timer_query_webgl2 EXT_float_blend EXT_polygon_offset_clamp EXT_render_snorm EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic EXT_texture_mirror_clamp_to_edge EXT_texture_norm16 KHR_parallel_shader_compile NV_shader_noperspective_interpolation OES_draw_buffers_indexed OES_sample_variables OES_shader_multisample_interpolation OES_texture_float_linear OVR_multiview2 WEBGL_blend_func_extended WEBGL_clip_cull_distance WEBGL_compressed_texture_astc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context WEBGL_multi_draw WEBGL_polygon_mode WEBGL_provoking_vertex WEBGL_stencil_texturing Audio information System sample rate: 48000 Hz Output channels: 2 Output interpretation: speakers Supported decode formats:

WebM Opus (audio/webm;codecs=opus) WebM Vorbis (audio/webm;codecs=vorbis) MPEG-4 Opus (audio/mp4;codecs=opus) MPEG-4 AAC (audio/mp4;codecs=mp4a.40.2) MP3 (audio/mpeg) FLAC (audio/flac) PCM WAV (audio/wav;codecs=1) Supported encode formats:

WebM Opus (audio/webm;codecs=opus) MPEG-4 Opus (audio/mp4;codecs=opus) Video information Supported decode formats:

WebM AV1 (video/webm;codecs=av01.0.00M.08) WebM VP9 (video/webm;codecs=vp9) WebM VP8 (video/webm;codecs=vp8) MPEG-4 AV1 (video/mp4;codecs=av01.0.00M.08) MPEG-4 H.264 (video/mp4;codecs=avc1.420034) Supported encode formats:

WebM AV1 (video/webm;codecs=av01.0.00M.08) WebM VP9 (video/webm;codecs=vp9) WebM VP8 (video/webm;codecs=vp8) WebM H.264 (video/webm;codecs=avc1.420034) MPEG-4 AV1 (video/mp4;codecs=av01.0.00M.08) MPEG-4 VP9 (video/mp4;codecs=vp9) MPEG-4 H.264 (video/mp4;codecs=avc1.420034)

IdeasPerSecond avatar Jan 14 '25 18:01 IdeasPerSecond

The sample project enables unadjusted movement, but that option is not actually supported by the Chromium browser engine on Linux yet (see the compatibility table here). So if that mode is enabled and it doesn't work, that would be my assumption why.

AshleyScirra avatar Jan 15 '25 16:01 AshleyScirra

Still fails even without the option checked, unfortunately.

IdeasPerSecond avatar Jan 15 '25 16:01 IdeasPerSecond

OK, I think this is actually that CEF doesn't support pointer lock at the moment. I'll see if we can find some workaround.

AshleyScirra avatar Jan 16 '25 15:01 AshleyScirra

Update: calling requestPointerLock() without the unadjustedMovement parameter now works on CEF. (Using the param returns the error Uncaught (in promise) NotSupportedError: The options asked for in this request are not supported on this platform.) Maybe all that's needed is a note on the parameters dialogue "unadjusted movement is currently unsupported on Linux" to avoid confusion

ToadLobe avatar Jun 09 '25 17:06 ToadLobe

I don't know if this is related but pointer lock does not work on Mac Webview no matter what the unadjusted movement setting is.

ma6x avatar Aug 08 '25 22:08 ma6x

Update: calling requestPointerLock() without the unadjustedMovement parameter now works on CEF. (Using the param returns the error Uncaught (in promise) NotSupportedError: The options asked for in this request are not supported on this platform.) Maybe all that's needed is a note on the parameters dialogue "unadjusted movement is currently unsupported on Linux" to avoid confusion

I tested today with r458.2 stable and Chromium v142, but it still doesn't work. @ToadLobe, in which version did you get it to work?

Uncaught (in promise) WrongDocumentError: The root document of this element is not valid for pointer lock.
Image

edit: Had to rollback to r449 LTS (and export using NW.js) as the Mouse lock is a non-negotiable.

Zizaco avatar Dec 01 '25 21:12 Zizaco