# HG changeset patch
# User Jan Vrany <jan.vrany@fit.cvut.cz>
# Date 1512724233 0
# Fri Dec 08 09:10:33 2017 +0000
# Branch jv
# Node ID ddbaa22b935264d423ad8df8b9a42db97232515d
# Parent 6d994e1ee4fc114b395f545f9e10a745e82774ef
Issue #186: Win32: use inline C in `#setForegroundWindow:`
...rather than FFI. It's much faster and uses lot less stack.
The latter is also important since `#setForegroundWindow:` is called
when opening debugger. In case a debugger is opened due to
a recursion interrupt, stack space is very limited so better save
every byte.
https://swing.fit.cvut.cz/projects/stx-jv/ticket/186
diff -r 6d994e1ee4fc -r ddbaa22b9352 WinWorkstation.st
a
|
b
|
|
18776 | 18776 | a different process is currently active - in this case the title bar/icon is flashed. |
18777 | 18777 | this also raises the priority of the sending thread slightly" |
18778 | 18778 | |
18779 | | <apicall: bool "SetForegroundWindow" (handle) module: "user32.dll" > |
| 18779 | %{ /* NOCONTEXT */ |
| 18780 | if (__isExternalAddress(aWindowId)) { |
| 18781 | HWND win = _HWNDVal(aWindowId); |
| 18782 | |
| 18783 | if (win) { |
| 18784 | SetForegroundWindow(win); |
| 18785 | } |
| 18786 | RETURN ( self ); |
| 18787 | } |
| 18788 | %} |
18780 | 18789 | ! |
18781 | 18790 | |
18782 | 18791 | setIconName:aString in:aWindowId |