[Bug 51672] New: Imperiums: Greek Wars has small black window on launch (caused by wrong position).
WineHQ Bugzilla
wine-bugs at winehq.org
Tue Aug 24 09:42:34 CDT 2021
https://bugs.winehq.org/show_bug.cgi?id=51672
Bug ID: 51672
Summary: Imperiums: Greek Wars has small black window on launch
(caused by wrong position).
Product: Wine
Version: 6.15
Hardware: x86-64
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: user32
Assignee: wine-bugs at winehq.org
Reporter: gabrielopcode at gmail.com
Distribution: ---
The game depends on some specific detail on Windows for Maximized position
placement. Windows seems to "forget" the maximized placement for any
non-maximized windows, as well as maximized top-level windows that cover the
work area.
Presumably, since applications typically save window positions via placement
(such as on exit) to reload them later, it does this to prevent those apps from
having weird maximized window positions when reloaded on a different screen or
a screen having a different work area, so in this case it forgets it to simply
say "just maximize to the entire work area" like normal maximized windows.
The game relies on this implicitly, because it changes styles and borders,
which affect its position and size. First, it creates the main game window as
hidden with the WS_CLIPCHILDREN | WS_MAXIMIZE | WS_MAXIMIZEBOX styles and the
WS_EX_CONTROLPARENT | WS_EX_APPWINDOW exstyles set, so it's actually maximized.
Implicitly, it ends up having a border around it, so it's position is something
like (-3,-3) on the screen (because it's maximized and not fullscreen),
covering the entire screen +3 on other side too.
Then, before showing the window, it sets the style on it again to the same
thing, which actually removes the implicit border. Since the window is still
hidden, it doesn't get updated by anything (WM or not) so its position remains
at (-3,-3). This is still correct even on Windows, despite the fact it's in the
wrong position technically speaking, so there's nothing wrong here.
The problem comes next: it shows the window with SW_MAXIMIZE. On Windows, this
resets its position to (0,0) since there is no border now. Wine currently keeps
its position at (-3,-3), although it does size the window down to be the size
of the work area / screen. So for example for 1920x1080 size, this would have
its rect be (-3,-3)-(1917,1077) instead of (0,0)-(1920,1080) as it is on
Windows. This completely confuses the game, rendering a small black window,
which makes it unplayable.
--
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.
More information about the wine-bugs
mailing list