mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
app: [Windows] support resize gestures for undecorated windows
We're about to remove the client-controlled system.Action machinery for resize gestures initiated by the client. This is the replacement implementation for Windows, where the behaviour is hard-coded to mimic the decorated automatic handling. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -113,7 +113,15 @@ const (
|
||||
|
||||
HWND_TOPMOST = ^(uint32(1) - 1) // -1
|
||||
|
||||
HTCLIENT = 1
|
||||
HTCLIENT = 1
|
||||
HTLEFT = 10
|
||||
HTRIGHT = 11
|
||||
HTTOP = 12
|
||||
HTTOPLEFT = 13
|
||||
HTTOPRIGHT = 14
|
||||
HTBOTTOM = 15
|
||||
HTBOTTOMLEFT = 16
|
||||
HTBOTTOMRIGHT = 17
|
||||
|
||||
IDC_APPSTARTING = 32650 // Standard arrow and small hourglass
|
||||
IDC_ARROW = 32512 // Standard arrow
|
||||
@@ -146,13 +154,16 @@ const (
|
||||
|
||||
SCS_SETSTR = GCS_COMPREADSTR | GCS_COMPSTR
|
||||
|
||||
SM_CXSIZEFRAME = 32
|
||||
SM_CYSIZEFRAME = 33
|
||||
|
||||
SW_SHOWDEFAULT = 10
|
||||
SW_SHOWMINIMIZED = 2
|
||||
SW_SHOWMAXIMIZED = 3
|
||||
SW_SHOWNORMAL = 1
|
||||
SW_SHOW = 5
|
||||
SWP_FRAMECHANGED = 0x0020
|
||||
|
||||
SWP_FRAMECHANGED = 0x0020
|
||||
SWP_NOMOVE = 0x0002
|
||||
SWP_NOOWNERZORDER = 0x0200
|
||||
SWP_NOSIZE = 0x0001
|
||||
@@ -231,6 +242,7 @@ const (
|
||||
WM_MOUSEMOVE = 0x0200
|
||||
WM_MOUSEWHEEL = 0x020A
|
||||
WM_MOUSEHWHEEL = 0x020E
|
||||
WM_NCHITTEST = 0x0084
|
||||
WM_PAINT = 0x000F
|
||||
WM_QUIT = 0x0012
|
||||
WM_SETCURSOR = 0x0020
|
||||
@@ -316,6 +328,7 @@ var (
|
||||
_GetMessage = user32.NewProc("GetMessageW")
|
||||
_GetMessageTime = user32.NewProc("GetMessageTime")
|
||||
_GetMonitorInfo = user32.NewProc("GetMonitorInfoW")
|
||||
_GetSystemMetrics = user32.NewProc("GetSystemMetrics")
|
||||
_GetWindowLong = user32.NewProc("GetWindowLongPtrW")
|
||||
_GetWindowLong32 = user32.NewProc("GetWindowLongW")
|
||||
_GetWindowPlacement = user32.NewProc("GetWindowPlacement")
|
||||
@@ -499,6 +512,11 @@ func GetMessageTime() time.Duration {
|
||||
return time.Duration(r) * time.Millisecond
|
||||
}
|
||||
|
||||
func GetSystemMetrics(nIndex int) int {
|
||||
r, _, _ := _GetSystemMetrics.Call(uintptr(nIndex))
|
||||
return int(r)
|
||||
}
|
||||
|
||||
// GetWindowDPI returns the effective DPI of the window.
|
||||
func GetWindowDPI(hwnd syscall.Handle) int {
|
||||
// Check for GetDpiForWindow, introduced in Windows 10.
|
||||
|
||||
Reference in New Issue
Block a user