This is the third serie related to rewriting cmd's command engine.
Currently, cmd stores block of commands as a linked list of CMD_LIST.
Even for nested commands (like 'if' command inside a 'for' command), it's
parsed as a single list of commands, using a 'depth' attribute and marker
for end of block to describe the structure.
This leads to several issues:
- parsing for nested commands is not 100% robust,
- chaining of commands (and its precedence) is not handled,
- no separation between parsing and execution (esp. for 'IF' and 'FOR'
commands, which behave slightly differently than regular commands
when dealing with variables with delayed expansion),
- data model doesn't 100% fit native behavior (eg redirections can
apply to a block of commands, whereas redirections are attached
to individual commands)
- ...
The final goal is to replace this with:
- a tree of commands:
+ binary nodes for command chaining,
+ 'IF' and 'FOR' commands being parsed and stored as such
+ leaf being a command
It will require a couple more series to reach that goal, so
this series puts in place the basic building bits:
- introducing a new structure CMD_NODE to hold that each node
of such a tree,
- moving the chaining operator into that CMD_NODE (meaning
that we move from a linked list to a binary tree degenerated
into a list: left is command, right is next node).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5609
strmbase is built against msvcrt (and needs to remain as such to be used in tests). Hence modules that link to it also need to be built against msvcrt.
In practice, this happens to work, but it causes some subtle strangeness. In particular, since ucrtbase does not export the simple printf functions, we end up instead linking to ntdll, whose implementation is notably incomplete, missing any float specifiers. While it's possible that ntdll should add those, we shouldn't be linking against ntdll's CRT anyway.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5607
The most important thing here is a workaround for an OS bug: rapidly hiding and showing the dock icon can result in multiple icons for the same app, and those icons will ignore NSApp.applicationIconImage. Making sure transitions happen no less than 0.5 seconds apart from one another seems to fix it.
Also, hiding a dock icon will deactivate an app. That's not desirable if it still has visible windows, so attempt to force a reactivation. That's often not successful on Sonoma due to the cooperative app activation heuristics, but it's the best we can do, and it should be a rare case.
Also, there is some logic in -transformProcessToForeground: that we often want to happen regardless of whether the app is getting a dock icon (e.g. App Nap and activation). So I've renamed that function to more accurately communicate what it does, and consolidate it with -tryToActivateIgnoringOtherApps:.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5604
The most important thing here is a workaround for an OS bug: rapidly hiding and showing the dock icon can result in multiple icons for the same app, and those icons will ignore NSApp.applicationIconImage. Making sure transitions happen no less than 1 second apart from one another seems to fix it. *Edit:* v2 update: 0.5 seconds is not always long enough. A good test case is the Notepad++ installer: after you select a language, it rapidly hides and shows some windows, and without a longer delay the icon will wind up with the default system terminal-looking icon. One second is probably overkill, but this ought to be a somewhat uncommon case.
Also, hiding a dock icon will deactivate an app. That's not desirable if it still has visible windows, so attempt to force a reactivation. That's often not successful on Sonoma due to the cooperative app activation heuristics, but it's the best we can do, and it should be a rare case.
Also, there is some logic in -transformProcessToForeground: that we often want to happen regardless of whether the app is getting a dock icon (e.g. App Nap and activation). So I've renamed that function to more accurately communicate what it does, and consolidate it with -tryToActivateIgnoringOtherApps:.
--
v2: winemac.drv: Consolidate foregrounding and dock icon behavior.
winemac.drv: Remove incorrect documentation for orderBelow: and rename a parameter.
winemac.drv: Reactivate the app if needed after hiding its dock icon.
winemac.drv: Enforce a delay between dock icon hides and shows.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5604