wine-gecko does actually support synchronous XMLHttpRequests, even if they are deprecated, but unfortunately it is very broken compared to IE or all the other major browsers (more details [here](https://bugzilla.mozilla.org/show_bug.cgi?id=697151)). Thankfully, it still provides us with the event message loop, which is enough to fix it on mshtml side and act like IE.
For sync XHRs, send() is supposed to block all script code, except for notifications sent to the sync XHR. This is because when …
[View More]send() blocks, no other piece of code in the script should execute other than the sync XHR handlers. Unfortunately, that's not the case in Gecko's broken implementation, which can execute handlers as if they were APCs while it's "blocked" in send().
Note that it doesn't actually block, though, because we still process the message loop (non-event related tasks such as navigation, paints, and other stuff), and that's normal. Gecko doesn't block everything related to script events, only some things on the document and timers, but that's far from enough and not even enough for our purposes since we use our own timer tasks. And not even message events are blocked, even though we *also* use our own message event dispatchers (but it doesn't block Gecko ones either).
So what we have to do is we need to track all the timers and events dispatched that result in script handlers being executed, while "blocking" inside of a sync XHR send(), and queue them up to defer them to be dispatched later, after send() unblocks. But this is easier said that done. There are many corner cases to consider here, for example:
* Events dispatched *synchronously* from within a sync XHR handler or other piece of code called from it.
* Nested sync XHR send() calls (called during handler of another sync XHR).
* Async XHRs having their events dispatched during a blocking sync XHR send() are complicated. `readyStateChange` for example needs to have the async XHR's readyState at the time it was sent, **not** at the time it was actually dispatched, since we're going to delay it and dispatch it later. It's similar with other XHR states, such as responseText (which can be partial).
* Aborts of async XHRs during such handlers.
These patches hopefully should address all the issues and, on a high level, work like this:
* Track the `readyState` and `responseText` length manually, so we can override / force them to specific values.
* "Snapshot" the async XHR at the time we encounter an event for it, and queue this event with such information. When later dispatching this event (after being deferred), we temporarily set the state of the async XHR to the snapshot.
* To deal with nested event dispatches, keep track of a "dispatch depth" (everytime we dispatch an event we increase the depth, and when it returns we decrease it).
* For sync XHRs, we note the depth when send() is called, and defer events at that depth, since they're dispatched during the "blocked" message loop and need to be delayed (except for sync XHR events, which is a special case since it must be dispatched synchronously). When it returns, we restore the previous blocking depth.
--
v5: mshtml: Send all readystatechange events for synchronous XHRs in IE9
mshtml: Implement synchronous XMLHttpRequest.
mshtml: Add separate task list for tasks dispatching events.
mshtml: Track readyState in XHRs and report it manually.
mshtml: Register all event handlers when creating the XMLHttpRequest.
mshtml: Pass optional args to XMLHttpRequest.open() correctly.
mshtml: Free the task after the destructor.
mshtml: Use proper types for readystate_locked and readystate_pending.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2098
[View Less]
When dmSize is zero or greter than size of input buffer, `IsValidDevmodeW()`
failed in Windows 10.
But current implementation in wine, it will return `true` because
there is no check to `dm.dmSize`.
--
v7: winspool: Check the alignment of dmSize in IsValidDevmodeW()
https://gitlab.winehq.org/wine/wine/-/merge_requests/2262
When dmSize is zero or greter than size of input buffer, `IsValidDevmodeW()`
failed in Windows 10.
But current implementation in wine, it will return `true` because
there is no check to `dm.dmSize`.
--
v6: winspool: Check the alignment of dmSize in IsValidDevmodeW()
https://gitlab.winehq.org/wine/wine/-/merge_requests/2262
When dmSize is zero or greter than size of input buffer, `IsValidDevmodeW()`
failed in Windows 10.
But current implementation in wine, it will return `true` because
there is no check to `dm.dmSize`.
--
v5: winspool: Check dmSize in IsValidDevmodeW
https://gitlab.winehq.org/wine/wine/-/merge_requests/2262
Related bug report: #54405
The game engine (FVP) does compare GetGlyphOutlineA result with zero and checks GetLastError in that case. Maybe I'm missing something but I believe the last error shouldn't be set for "empty" characters. I don't know why it was omitted in tests.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2253
The idea here is to track the cursor changes on the server side, ultimately [1] using a private message to notify user drivers of changes to apply, instead of tracking the changes in user drivers with throttle mechanisms.
This would greatly simplify winex11 mouse message handling as we would not need to try syncing the window cursor on every mouse move, and ultimately it would also make it possible to have a single thread listening to input in the background. Currently the input thread needs …
[View More]to own the windows that are under the cursor to be able to set it.
Having a single input thread (per-process at least, but ideally and ultimately per-prefix), will solve several issues with input not being received when the foreground thread isn't actively checking their message, as well as issues with DInput incorrectly checking window messages when it should not.
[1] See https://gitlab.winehq.org/rbernon/wine/-/merge_requests/8/commits
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2038
[View Less]
This restores the feature we had with the testbot running related on intermediate commits, though it only does it on Linux and it would be nice to have it on Windows too.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1240
This adds a new Input tab to winecfg, moving the mouse grab settings there. Then this makes winex11 keyboard layout detection configurable as well, allowing the user to override the keyboard layout detection if for some reason it was incorrect.
This isn't solving anything yet, but I then intend to make keyboard scancode detection configurable as well, and optional.
As I described in https://www.winehq.org/pipermail/wine-devel/2020-October/175641.html, I believe that X11 keyboard keycode to …
[View More]scancode mapping is most of the time a fixed mapping, except in some rare cases.
Trying to detect it from the keyboard layout will never work reliably, especially nowadays where keyboard layouts are completely made up from Linux IME (for instance a GNOME language settings with up to four keyboard layouts translates to a single Xkb mapping using groups for each layout). The X11 keycode are remapped only in some more rarely used implementations, such as XVNC and we should try to detect it only in such cases.
Many Windows applications are depending on accurate scancodes, and making the mapping detection optional (and disabled by default) will solve all the issues we have in the most common case (https://bugs.winehq.org/show_bug.cgi?id=30984, https://bugs.winehq.org/show_bug.cgi?id=45605).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2062
[View Less]
In the implementation of
[`evr_disconnect()`](https://gitlab.winehq.org/wine/wine/-/blob/wine-8.2/dlls/evr/evr.c#L325-333),
it will try to clear types of mixer by pass null to
`IMFTransform_SetInputType()`:
```c
static void evr_disconnect(struct strmbase_renderer *iface)
{
struct evr *filter = impl_from_strmbase_renderer(iface);
if (filter->mixer)
IMFTransform_SetInputType(filter->mixer, 0, NULL, 0);
evr_set_input_type(filter, NULL);
evr_release_services(filter)…
[View More];
}
```
This null ptr (`media_type`) will be pass to
[`video_mixer_collect_output_types()`](https://gitlab.winehq.org/wine/wine/-/blob/wine-8.2/dlls/evr/mixer.c#L869)
and cause a [crash](https://gitlab.winehq.org/wine/wine/-/blob/wine-8.2/dlls/evr/mixer.c…:
```c
static HRESULT WINAPI video_mixer_transform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *media_type, DWORD flags)
{
...
if (!mixer->device_manager)
hr = MF_E_NOT_INITIALIZED;
else
{
if (SUCCEEDED(hr = video_mixer_get_processor_service(mixer, &service)))
{
if (SUCCEEDED(hr = video_mixer_init_dxva_videodesc(media_type, &video_desc)))
...
```
In this patch, `video_mixer_transform_SetInputType()` will only clear types when
got a NULL `media_type` and return `S_OK`.
--
v6: evr: Fix crash when clear input type for the mixer
https://gitlab.winehq.org/wine/wine/-/merge_requests/2263
[View Less]