-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Description
Shell#getLocation is currently returning coordinates outside of the monitor, when the window is maximized (at least for Windows 11). We could replace This call by replace GetWindowRect
with DwmGetWindowAttribute
that returns a better location in this case.
Reproduction
--
Expected Behavior
If the location of a shell is fetched via the API, the given location should always be assigned to the monitor it is assigned to from the OS.
Necessary configuration:
--
Additional knowledge
As DwmGetWindowAttribute return different types for different attributes, we probably need to have a more sophisticated approach in OS.java for this, simple test was done with:
/**
* @param hwnd cast=(HWND)
* */
public static final native void DwmGetWindowAttribute (long hwnd, int dwAttribute, RECT pvAttribute, int cbAttribute);
and then called with
RECT rect = new RECT();
OS.DwmGetWindowAttribute(handle, 9, rect, RECT.sizeof);
For more information see https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/nf-dwmapi-dwmgetwindowattribute
Metadata
Metadata
Assignees
Labels
Type
Projects
Status