This MR introduces support for basic window management in the Wayland driver.
A summary of the commits (but see commit messages for more info):
1. Replace double locking during `wayland_surface` destruction (to protect `xdg_surface` user data) with a simpler mechanism, since we established in the last MR that we don't need to worry about HWND recycling.
2. Support compositor initiated window closing.
3. Respect compositor size hints.
4. Handling/syncing of maximized state, requested by either the compositor or app/Wine.
5. Interactive window moving (but only in the compositor virtual space, see notes below!)
6. Interactive window resizing.
A few notes:
1. At the moment, the driver doesn't change the position of windows in the Windows virtual screen space, since Wayland doesn't provide any relevant position information. This can lead to situations where parts of the window become apparently inaccessible to mouse input, because although those parts are visible from a Wayland perspective they are outside the Windows virtual screen. In future MRs I will provide mitigations/workarounds for this fundamental incompatibility between Win32 and Wayland.
2. To support interactive window moving/resizing, both the `xdg_toplevel` and the `wl_seat` need to remain valid during our request, so we introduce a double lock to ensure their concurrent validity.
Thanks!
--
v2: winewayland.drv: Fix removal of wl_seat globals.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3909
This matches what is done in the upstream headers; end users
including d3d12.h don't need to explicitly include d3d12sdklayers.h.
Signed-off-by: Martin Storsjö <martin(a)martin.st>
--
v2: include: Add an #include of d3d12sdklayers.h in vkd3d_d3d12.idl
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/373
This goes on top of MR 345.
--
v16: tests/shader-runner: Test shaders with dxcompiler.
tests/shader-runner: Replace immediate shader type strings with an enum.
tests/shader-runner: Do not exit if a 'require' directive is not met.
tests/shader-runner: Handle individual keywords in shader directives.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/346
- Changes to allow WNetAddConnection*() and WNetCancelConnection*() to succeed
regardless of available providers (where none have been implemented yet).
Allowing for manual configuration outside of wine.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3966
--
v3: vkd3d-shader/dxil: Read the DXIL input and output signatures.
vkd3d-shader/dxil: Read the DXIL metadata tables.
vkd3d-shader/dxil: Emit an error on allocation failure in dxil_record_to_string().
vkd3d-shader/dxil: Read global constants in sm6_parser_globals_init().
vkd3d-shader/dxil: Read immediate constant arrays.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/372
This matches what is done in the upstream headers; end users
including d3d12.h don't need to explicitly include d3d12sdklayers.h.
Signed-off-by: Martin Storsjö <martin(a)martin.st>
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/373
It's possible that a state object pointer not in the topology node collection gets passed to
session_get_node_object(). Instead of returning the last node when the object is not found, we
should return a NULL so that the state of the last node is not changed by mistake.
--
v8: mf/tests: Test IMFMediaSession::Start().
mf: Add seeking support for IMFMediaSession::Start().
mf/tests: Add a create_test_topology() helper.
mf: Add a session_flush_nodes() helper.
mf: Make session_get_node_object() more robust.
mf: Avoid a double free of presentation clock timers.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3572
On Wed Sep 27 02:39:04 2023 +0000, Zhiyi Zhang wrote:
> I doubt it's returning true even when a light theme is on. Please add
> some tests for this function. In the test, you can get the function
> pointer from ordinal. Also, could you point me to that .NET source code
> that uses this function?
There is also a WinRT dark theme option in winecfg. I think you can use that to report whether to return true in this function. See 3503ab4. In the test, you can test if the AppsUseLightTheme registry value corresponds to the return value of this function.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3959#note_46915
Zhiyi Zhang (@zhiyi) commented about dlls/uxtheme/system.c:
> UnregisterUserApiHook();
> return TRUE;
> }
> +
> +/**********************************************************************
> + * ShouldUseDarkMode (UXTHEME.138)
> + *
> + * RETURNS
> + * whether or not the app should use dark mode (true for most)
> + */
> +BOOL WINAPI ShouldUseDarkMode(void)
> +{
> + return TRUE;
I doubt it's returning true even when a light theme is on. Please add some tests for this function. In the test, you can get the function pointer from ordinal. Also, could you point me to that .NET source code that uses this function?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3959#note_46914
This comes from behavioral study of Windows, which doesn't seem to check if the
lock is actually exclusively held, and just simply decrement the value stored
in the lock.
This fixes a dead lock which prevents WeCom from starting up.
--
v26: ntdll: wake up SRWLOCK waiters by thread id
ntdll: allow SRWLOCKs to be quickly re-acquired
ntdll: An implementation of SRWLOCK that closer matches Windows'.
include: add atomic read/write of pointers
https://gitlab.winehq.org/wine/wine/-/merge_requests/3504
Mostly to avoid polluting other logs and artifacts, and also to avoid
recompiling crosstests over and over.
--
v5: ci: Wrap complex commands in CI scripts.
ci: Build crosstests with -Wno-array-bounds.
ci: Build crosstests in a dedicated CI job.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/359
This MR replaces `vkd3d_shader_register.immconst_type` with `vkd3d_shader_register.dimension` which is intended for all register types and not just immconsts.
This dimension is parsed in tpf.c, and initialized according to the register type in d3dbc.c.
Having this field in vkd3d_shader_register allows us to avoid hardcoding special cases for the register dimensions when writing sm4 bytecode (e.g. for the sampler src register in gather instructions). Also, it allows for some fixes to d3d_asm.c, which are introduced in part 2 (https://gitlab.winehq.org/fcasas/vkd3d/-/commits/add_vkd3d_reg_dim).
--
v9: vkd3d-shader/d3dbc: Initialize register dimension for all register types.
vkd3d-shader/tpf: Parse register dimension for all register types.
vkd3d-shader: Turn vkd3d_shader_register.immconst_type into vkd3d_shader_register.dimension.
vkd3d-shader/tpf: Use vsir_register_init() in shader_sm1_parse_dst_param().
vkd3d-shader/tpf: Use vsir_register_init() in shader_sm1_parse_src_param().
vkd3d-shader/tpf: Use vsir_register_init() in shader_sm4_read_param().
vkd3d-shader/spirv: Use vsir_register_init() in spirv_compiler_emit_default_control_point_phase().
vkd3d-shader/spirv: Use vsir_register_init() in spirv_compiler_emit_resource_declaration().
vkd3d-shader/spirv: Use vsir_register_init() in spirv_compiler_emit_sampler_declaration().
vkd3d-shader/spirv: Use vsir_register_init() in spirv_compiler_emit_dcl_immediate_constant_buffer().
vkd3d-shader/spirv: Use vsir_register_init() in spirv_compiler_emit_cbv_declaration().
vkd3d-shader/spirv: Use vsir_register_init() in spirv_compiler_emit_dcl_indexable_temp().
vkd3d-shader/spirv: Use vsir_register_init() in spirv_compiler_emit_hull_shader_builtins().
vkd3d-shader/spirv: Use vsir_register_init() in spirv_compiler_get_invocation_id().
vkd3d-shader: Rename shader_register_init() to vsir_register_init().
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/319
This goes on top of MR 320.
--
v11: tests/shader-runner: Add a '--dump-dxil' command line switch.
tests/shader-runner: Test shaders with dxcompiler.
tests/shader-runner: Do not apply todo to result probes.
tests/shader-runner: Replace immediate shader type strings with an enum.
tests/shader-runner: Do not exit if a 'require' directive is not met.
tests/shader-runner: Handle individual keywords in shader directives.
vkd3d-shader/dxil: Convert into an error the warning for an unhandled instrinsic.
vkd3d-shader/dxil: Do not compile compute shaders.
vkd3d-shader/dxil: Do not access null code blocks on failure.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/346
In clock_change_state() when a clock is running, a timer is removed from clock->timers. The same
timer is then used to create an async result, which will eventually calls present_clock_timer_callback_Invoke()
and removes the same timer.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3955
Windows 10 [received support](https://devblogs.microsoft.com/commandline/af_unix-comes-to-window… for AF_UNIX sockets in Insider Build 17063. This merge request adds basic support for AF_UNIX sockets to ws2_32 and wineserver.
Of particular note is the difficulty in handling `sun_path`. Most of the functions that allow for translating Windows paths to Unix paths are not accessible from ws2_32. I considered the following options:
* Pass the Windows path to wineserver and do the conversion there.
* This is, as far as I can tell, not possible without major rearchitecting. wineserver does not have functions to translate Windows paths to Unix paths, for obvious reasons.
* Obtain the current working directory of the requesting process and temporarily change directories to there.
* This only handles relative paths and fails for absolute paths, UNC paths, etc.
* Conditionally change directories based on whether the path is relative or not.
* This is error-prone and wineserver does not have the requisite functions to do this cleanly.
I ultimately decided to pass the translated Unix path to wineserver, which changes directories to `dirname(path)`. It then provides `bind` and `connect` with `basename(path)`. This is not threadsafe, but wineserver is not (currently) multithreaded.
Abstract sockets are not fully supported by this patch, matching the behavior of Windows.
--
v62: ws2_32/tests: Add test for AF_UNIX sockets.
server: Fix getsockname() and accept() on AF_UNIX sockets.
server: Introduce error when attempting to create a SOCK_DGRAM AF_UNIX socket.
server: Allow for deletion of socket files.
ws2_32: Add support for AF_UNIX sockets.
ws2_32: Add afunix.h header.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786
This MR replaces `vkd3d_shader_register.immconst_type` with `vkd3d_shader_register.dimension` which is intended for all register types and not just immconsts.
This dimension is parsed in tpf.c, and initialized according to the register type in d3dbc.c.
Having this field in vkd3d_shader_register allows us to avoid hardcoding special cases for the register dimensions when writing sm4 bytecode (e.g. for the sampler src register in gather instructions). Also, it allows for some fixes to d3d_asm.c, which are introduced in part 2 (https://gitlab.winehq.org/fcasas/vkd3d/-/commits/add_vkd3d_reg_dim).
--
v8: vkd3d-shader/d3dbc: Initialize register dimension for all register types.
vkd3d-shader/tpf: Parse register dimension for all register types.
vkd3d-shader: Turn vkd3d_shader_register.immconst_type into vkd3d_shader_register.dimension.
vkd3d-shader/tpf: Use vsir_register_init() in shader_sm1_parse_dst_param().
vkd3d-shader/tpf: Use vsir_register_init() in shader_sm1_parse_src_param().
vkd3d-shader/tpf: Use vsir_register_init() in shader_sm4_read_param().
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/319