Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57665
---
The issue is that The Medium launcher uses a dialog window procedure, and implements its background by doing a StretchBlt call on WM_PAINT in the dialog procedure call, which happens before the window message loop.
It then itself calls InvalidateRect(hwnd, NULL, 0), which queues a WM_PAINT as well but with only the RDW_INVALIDATE flag.
Next, when the window message loop is executed, the WM_PAINT message is being processed as it should, but as we've invalidate the window with RDW_ERASE ourselves from the expose event, the WM_NCPAINT handler erases the entire window, clearing the pixels that the launcher has just painted.
This regressed since the window surface clipping region logic changed, as the expose event handling was previously not calling `NtUserRedrawWindow` on windows with a surface and without a clipping region. The clipping region was also previously not always set, or set later, and we're setting it more consistently since 51b16963f6e0e8df43118deac63f640aee4698b7, even when it matches the window rect, for compatibility with some old wineandroid logic (where I believe it was used to clip window surfaces to their proper sizes).
--
v4: winex11: Avoid setting RDW_ERASE on expose events.
explorer: Paint the desktop even without RDW_ERASE.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7157
On Wed Apr 9 16:03:30 2025 +0000, eric pouech wrote:
> I'd rather pick a non fixed font with correct charset over of fixed font
> with a non matching charset (agreeing that that case didn't exist in
> current code, and is potentially pedantic)
I've added a patch that prioritizes charset. I've also removed always false conditions from the check.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7777#note_100426
--
v2: conhost: Imrove best matching font selection in set_first_font.
conhost: Merge validate_font and validate_font_metric helpers.
conhost: Allow raster fonts in enum_first_font_proc.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7777
Calling MFScheduleWorkItemEx() schedules the operation in the timer
queue, but unless GetParameters() returns the timer queue, callback
invocation will occur in the standard queue.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7696
Implementation and test function for ADsBuildVarArrayInt, using ADsBuildVarArrayStr as reference.
- /dlls/activeds/activeds_main.c
- /dlls/activeds/tests/activeds.c
- /include/adshlp.h
--
v14: activeds: Implement ADsBuildVarArrayInt.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7752
Implementation and test function for ADsBuildVarArrayInt, using ADsBuildVarArrayStr as reference.
- /dlls/activeds/activeds_main.c
- /dlls/activeds/tests/activeds.c
- /include/adshlp.h
--
v13: activeds: Implement ADsBuildVarArrayInt.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7752
Implementation and test function for ADsBuildVarArrayInt, using ADsBuildVarArrayStr as reference.
- /dlls/activeds/activeds_main.c
- /dlls/activeds/tests/activeds.c
- /include/adshlp.h
--
v12: activeds: Implement ADsBuildVarArrayInt.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7752
This MR adds tests that examine the values of the samples output by the byte stream handlers.
It is marked as draft as it is dependent on the fixes included within MR !7569.
I've also renamed the tests as they previously exclusively tested the sample output timestamps. The tests now also look at the number of buffers included in a sample and total size of the buffers within a sample.
--
v4: mfplat/tests: Add tests for MP3 Byte Stream Output.
mfplat/tests: Add tests for Byte Stream Output.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7672
This fixes "out of realized font handles" errors seen with Valve games like Half-Life 2 (which uses more than 1000 font handles).
The new limit of 5000 is roughly inspired by the Windows limit, although there are differences. On Windows 11 I can call `CreateFont()` (and then `SetMapMode()`, `SelectObject()`, `SetTextAlign()` to realize the font) exactly 5000 times before it hits the handle limit.
Under Wine, child fonts use handles as well, so the limit is usually hit before 5000 `CreateFont()` calls. But, there is caching so that `CreateFont()` calls with identical arguments do not count towards the limit. Ultimately the old limit of 256 was sufficient for almost all applications, and 5000 should be enough for all but the worst-behaved apps.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7771
This MR modifies winegstreamer to match Windows behaviour in that:
1. the video decoders will output the PTS and duration of the input sample (if provided); and
2. the WMV decoder will set any value not provided to zero
It also adds support for supplying a DTS value to the MFTs.
I've marked this as draft as it fixes the tests in MR !7563 (in addition to fixing some existing `test_wmv_decoder` tests). Also, as demonstrated in MR !7569, our demuxers output different timestamps to Windows. This change will result in those different timestamps being forwarded from the decoder. So we may also want to address that difference prior to accepting this MR.
--
v4: winegstreamer: Use provided PTS and duration in video_decoder.
mf/tests: Add negative timestamp tests for h264.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7623
These functions are used by Visual Studio 2019, when opening or converting some projects.
Signed-off-by: Lorenzo Ferrillo <lorenzofersteam(a)live.it>
--
v23: kernelbase: Check for PERF_SIZE_LARGE in PerfSetULongLongCounterValue and PerfSetULongCounterValue
kernelbase: Check for PERF_ATTRIB_BY_REFERENCE attribute in PerfSetCounterRefValue
advapi32/test: Add Test For PerfSetULongLongCounterValue
advapi32/tests: Create Tests for PerfSetULongCounterValue.
advapi32: Forward PerfSetULongCounterValue and PerfSetULongLongCounterValue to kernelbase
kernelbase: Add implementation for PerfSetULongLongCounterValue
kernelbase: Add implementation of PerfSetULongCounterValue
kernelbase: factor out common functionality for performance counter functions
https://gitlab.winehq.org/wine/wine/-/merge_requests/3799
These functions are used by Visual Studio 2019, when opening or converting some projects.
Signed-off-by: Lorenzo Ferrillo <lorenzofersteam(a)live.it>
--
v22: kernelbase: Check for PERF_SIZE_LARGE in PerfSetULongLongCounterValue and PerfSetULongCounterValue
kernelbase: Check for PERF_ATTRIB_BY_REFERENCE attribute in PerfSetCounterRefValue
advapi32/test: Add Test For PerfSetULongLongCounterValue
advapi32/tests: Create Tests for PerfSetULongCounterValue.
advapi32: Forward PerfSetULongCounterValue and PerfSetULongLongCounterValue to kernelbase
kernelbase: Add implementation for PerfSetULongLongCounterValue
kernelbase: Add implementation of PerfSetULongCounterValue
kernelbase: factor out common functionality for performance counter functions
https://gitlab.winehq.org/wine/wine/-/merge_requests/3799
On Tue Apr 8 17:12:58 2025 +0000, Ralf Habacker wrote:
> Is there still something to do here or can it be merged?
Yes, someone needs to come up with better a solution to the file deletion problem. I don't think this series is going to be accepted without one.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7650#note_100277
This will later allow for optimization by limiting the area we
consider to the region's bounding rectangle.
--
v2: gdiplus/tests: Test rounding of region rectangles.
gdiplus: Implement path to region conversion without gdi32.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7654
In Korean input, if ime is in the composition state, when non-printable key
(ENTER, TAB, etc.) are pressed, it returns a result_string and passes the
non-printable key to WinProc with the WM_IME_KEYDOWN message.
This can be seen in ‘imm32/test/imm32.c::test_ga_na_da()’.
In the current winemac.drv, if you select the “Korean 2-Set Keyboard” input
source and type ‘r-k-ENTER’, it only outputs the result string ‘0xAC00’.
WM_IME_KEYDOWN message generation does not exist.
At this point, the WINE_IME_POST_UPDATE call occurs, and macdrv_ImeProcessKey
returns FALSE. A FALSE return value means that the key was not consumed by ime,
and a WM_KEYDOWN message should be generated.
However, because an ime_update call occurred, ImeProcessKey should return TRUE,
and (wparam not modified) raw WM_KEYDOWN message should be generated via a
different path, so a WM_IME_KEYDOWN message is required.
This patch allows the macdrv_ImeProcessKey return value to be passed to
ImeToAsciiEx() to determine if a WM_IME_KEYDOWN message should be generated.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7767
In winemac.drv, Multiple ime update calls occur during ImeProcessKey.
These multiple ime update calls need to be properly merged into ‘data->update’.
However, currently win32u/imm.c::post_ime_update() only keeps the last ime
update call.
Valid rules are:
- The comp_str is discarded when the next ime update call occurs,
so it is only valid when the last ime update call has the comp_str.
- The result_str is retained even if the next ime update call occurs.
- If the next ime update call has the result_str, it is appended after
the previous result_str. (e.g. 'r-k-1' or 'r-k-<SPACE>')
Test key sequences are:
- "Japanese Romanji" : 'nihongo-<SPACE>-n'
- "Korean 2-Set Keyboard" : 'r-k-s-k'
- "Korean 2-Set Keyboard" : 'r-k-1" or 'r-k-<SPACE>'
--
v2: win32u: Preserve result string from multiple WINE_IME_POST_UPDATE call during ImeProcessKey.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7766
XIM events are handled by Xlib internally and need to go through XFilterEvent to be processed.
This allows for keyboard input to be processed while connected to an input method daemon when an application only polls for keyboard input.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7509
In winemac.drv, Multiple ime update calls occur during ImeProcessKey.
These multiple ime update calls need to be properly merged into ‘data->update’.
However, currently win32u/imm.c::post_ime_update() only keeps the last ime
update call.
Valid rules are:
- The comp_str is discarded when the next ime update call occurs,
so it is only valid when the last ime update call has the comp_str.
- The result_str is retained even if the next ime update call occurs.
- If the next ime update call has the result_str, it is appended after
the previous result_str. (e.g. 'r-k-1' or 'r-k-<SPACE>')
Test key sequences are:
- "Japanese Romanji" : 'nihongo-<SPACE>-n'
- "Korean 2-Set Keyboard" : 'r-k-s-k'
- "Korean 2-Set Keyboard" : 'r-k-1" or 'r-k-<SPACE>'
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7766
This serie mainly moves the handling of local variables
described with DEFRANGE into the new reader.
Fixing in the process a couple of bugs.
Rest if mainly cleanup and helpers.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7765
Implementation and test function for ADsBuildVarArrayInt, using ADsBuildVarArrayStr as reference.
- /dlls/activeds/activeds_main.c
- /dlls/activeds/tests/activeds.c
- /include/adshlp.h
--
v11: activeds: Implement ADsBuildVarArrayInt.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7752
Implementation and test function for ADsBuildVarArrayInt, using ADsBuildVarArrayStr as reference.
- /dlls/activeds/activeds_main.c
- /dlls/activeds/tests/activeds.c
- /include/adshlp.h
--
v10: activeds: Implement ADsBuildVarArrayInt.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7752
Implementation and test function for ADsBuildVarArrayInt, using ADsBuildVarArrayStr as reference.
- /dlls/activeds/activeds_main.c
- /dlls/activeds/tests/activeds.c
- /include/adshlp.h
--
v9: activeds: Implement ADsBuildVarArrayInt.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7752
--
v3: amstream: Implement dynamic formats in ddraw stream.
amstream/tests: Test for dynamic formats in ddraw stream.
amstream: Implement custom allocator for ddraw stream.
amstream/tests: Test for custom allocator in ddraw stream.
amstream: Release allocator when Disconnect is called in ddraw stream.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7715
Implementation and test function for ADsBuildVarArrayInt, using ADsBuildVarArrayStr as reference.
- /dlls/activeds/activeds_main.c
- /dlls/activeds/tests/activeds.c
- /include/adshlp.h
--
v8: activeds: Implement ADsBuildVarArrayInt.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7752
This patch implements the sysinfo_get_UserName function, an existing FIXME for adsldp.
--
v2: adsldp/tests: remove todos from sysinfo
Implement sysinfo_get_UserName in adsldp.c
https://gitlab.winehq.org/wine/wine/-/merge_requests/7745
These functions are used by Visual Studio 2019, when opening or converting some projects.
Signed-off-by: Lorenzo Ferrillo <lorenzofersteam(a)live.it>
--
v20: kernelbase:return pointer for counter instead of index. remove auxilliary function to set the value
https://gitlab.winehq.org/wine/wine/-/merge_requests/3799
Sending key events through `-[NSTextInputContext handleEvent:]`, as we do in `macdrv_send_text_input_event`, results in doubled characters for certain macOS input sources. The Romaji source does this reliably, as do certain third-party sources. (The built-in dictation does it as well, but we already blacklist that - !5660 - because it remains "active" even when it's not.)
I can't find this spelled out directly, but if you read between the lines, it seems clear that you're only supposed to send key *down* events to `-[NSTextInputContext handleEvent:]` and not key ups. Supporting evidence:
1. [The old documentation on the text system](https://developer.apple.com/library/archive/documentation/TextFonts… only mentions `handleEvent:` being called in the context of `-keyDown:`.
2. [The guide to implementing a custom text view/NSTextInputClient](https://developer.apple.com/library/archive/documen… only mentions overriding `-keyDown:` and sending those events to `-handleEvent:`.
3. [iTerm only sends key down events to `-handleEvent:`](https://github.com/gnachman/iTerm2/blob/6134ea0a9d9d0fee5e7d7704fc98efec1fc77c24/sources/iTermKeyboardHandler.m#L355). You have to unpack the logic a bit from there, but `-handleKeyDownEvent:...` is the only method that calls `-handleEventWithCocoa:inputContext:`, which is what (usually) calls `-handleEvent:` on the `inputContext`.
4. [The InputMethodKit method on the IMKServerInput protocol to handle NSEvents directly](https://developer.apple.com/documentation/objectivec/nsobject/138… only mentions getting key down events.
So presumably input source authors sometimes do not check the type of the NSEvent they're receiving and process all key events equally, be they downs or ups, which results in the doubled input.
This patch fixes the issues with Romaji and the problematic third-party method we've encountered.
--
v3: winemac.drv: Only send key down events to the window's inputContext.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7701
--
v2: amstream: Release the allocator used by the direct draw stream.
amstream: Implement dynamic formats in ddraw stream.
amstream/tests: Test for dynamic formats in ddraw stream.
amstream: Implement custom allocator for ddraw stream.
amstream/tests: Test for custom allocator in ddraw stream.
amstream: Implement IMemAllocator stub for ddraw stream.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7715
Follow-up of !2786, which appears to have been abandoned.
--
v12: 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/7650
--
v3: win32u: Add a nulldrv pbuffer stub implementation.
winemac: Use the generic pbuffer implementation.
winewayland: Use the generic pbuffer implementation.
win32u: Introduce a generic pbuffer implementation from winex11.
opengl32/tests: Add more pbuffer tests.
win32u: Handle some pixel format initialization.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7758
--
v2: win32u: Add a nulldrv pbuffer stub implementation.
winemac: Use the generic pbuffer implementation.
winewayland: Use the generic pbuffer implementation.
win32u: Introduce a generic pbuffer implementation from winex11.
opengl32/tests: Add more pbuffer tests.
win32u: Handle some pixel format initialization.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7758
This MR enforces alignment of TLS slots as described in PE file.
--
v4: ntdll: Let layout of TLS vector be closer to native.
ntdll: Enforce the alignment of TLS directory entries.
kernel32: Add test for TLS memory layout.
kernel32/tests: Add a test about TLS slot alignment.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7251
The game "Marvel Heroes" uses AES for some session validation on login. It uses `CryptImportKey` to configure the key, but this fails in Wine (see for example the documentation of MHServerEmu: https://github.com/Crypto137/MHServerEmu/blob/f250fbd8d62a8d18afa6592e39058…) because it leaves garbage(?) data in the reserved field of the key blob header. This is ignored on Windows (tested on Windows 10, but seems to be the same on other Windows versions, since the game runs without problem), but Wine verifies this value and exits early. This removes the check and adds a barebones test to verify this behavior.
--
v2: rsaenh: Ignore reserved field in import_key
https://gitlab.winehq.org/wine/wine/-/merge_requests/7744