I stumbled onto this while using freopen() for debugging purposes.
Basically, freopen() fails if the FILE has been created with
an invalid handle.
So, this MR contains:
- basic tests for freopen (no issue there, just for coverage purposes)
- tests for freopen on FILE with invalid handle
- fix for freopen
--
v2: msvcrt: Fix freopen() on FILE with handle=-2.
isfd
msvcrt/tests: Add tests for freopen().
https://gitlab.winehq.org/wine/wine/-/merge_requests/3578
Starting in Sonoma, apps can no longer force themselves to the
foreground with -activateIgnoringOtherApps:. winemac currently does
that in a few places - when an app creates its first window, and in
the implementation of APIs like SetFocus.
There's nothing we can do to work around the new behavior in the
general case. This patch makes Wine apps running in the same prefix
yield to one another, so that windows from multiple EXEs can at least
behave as intended.
---
As noted in a comment, there's an inherent race condition in handling this issue the way I've done it here. Sonoma does provide another API that would theoretically alleviate that, but in practice it has some quirks that make it unsuitable. Gory details follow.
An app can yield activation to either another `NSRunningApplication` (`-yieldActivationToApplication:`) or to the bundle identifier of an application that may not have launched yet (`-yieldActivationToApplicationWithBundleIdentifier:`). Ideally we could just use the latter to issue a blanket yield to the loader/preloader.
A temporary roadblock: yielding to the bundle ID of the loader/preloader doesn't work at all at the moment. It seems that the new APIs rely on LaunchServices' picture of the world, and even though the loader & preloader have an embedded Info.plist, LS only seems to notice them if they're actually in a .app bundle. I hacked that together locally, and yielding to a bundled preloader works, but...
Yields to bundle IDs seem to be canceled if the user interacts with the yielding application in certain ways. This includes clicking or typing into a window, or moving a window around. This is probably part of the "heuristics" that Apple mentioned are involved in deciding whether to let an app come forward.
So, it seems that we need to issue yields directly in response to another app trying to activate itself, rather than trying to do it preemptively. The distributed notification in this patch was the cleanest way I could think to orchestrate that.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3582
After investigation, it looks like the PixelOffsetModeHalf/PixelOffsetModeHighQuality is using floating point numbers, while PixelOffsetModeNone/PixelOffsetModeHighSpeed is using integers to calculate bitmap colours.
After using floating numbers, most tests are passing now.
--
v2: gdiplus: implement PixelOffsetModeHighQuality for GdipDrawImagePointsRect
https://gitlab.winehq.org/wine/wine/-/merge_requests/3568
I stumbled onto this while using freopen() for debugging purposes.
Basically, freopen() fails if the FILE has been created with
an invalid handle.
So, this MR contains:
- basic tests for freopen (no issue there, just for coverage purposes)
- tests for freopen on FILE with invalid handle
- fix for freopen
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3578