mirror of
https://github.com/reactos/reactos.git
synced 2024-06-26 07:51:52 +00:00
[NTUSER] Allow Window Snap to be disabled (#5014)
- Add IntIsWindowSnapEnabled helper function that reads registry value WindowArrangementActive. - Check the registry and store the value to newly-added g_bWindowSnapEnabled global variable on startup. - Check the global variable before Window Snap. Win+Left, Win+Right, Win+Up, and Win+Down can be disabled by registry value WindowArrangementActive. Snapping mouse can be also disabled. CORE-16379
This commit is contained in:
parent
0dde428d00
commit
ea55101aad
|
@ -813,7 +813,7 @@ IntDefWindowProc(
|
||||||
|
|
||||||
if (topWnd && !IsTaskBar) /* Second test is so we are not touching the Taskbar */
|
if (topWnd && !IsTaskBar) /* Second test is so we are not touching the Taskbar */
|
||||||
{
|
{
|
||||||
if ((topWnd->style & WS_THICKFRAME) == 0)
|
if ((topWnd->style & WS_THICKFRAME) == 0 || !g_bWindowSnapEnabled)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -418,7 +418,7 @@ DefWndDoSizeMove(PWND pwnd, WORD wParam)
|
||||||
UserSystemParametersInfo(SPI_GETWORKAREA, 0, &snapRect, 0);
|
UserSystemParametersInfo(SPI_GETWORKAREA, 0, &snapRect, 0);
|
||||||
|
|
||||||
/* if this is the taskbar, then we want to just exit */
|
/* if this is the taskbar, then we want to just exit */
|
||||||
if (IsTaskBar)
|
if (IsTaskBar || !g_bWindowSnapEnabled)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ DBG_DEFAULT_CHANNEL(UserSysparams);
|
||||||
SPIVALUES gspv;
|
SPIVALUES gspv;
|
||||||
BOOL gbSpiInitialized = FALSE;
|
BOOL gbSpiInitialized = FALSE;
|
||||||
BOOL g_PaintDesktopVersion = FALSE;
|
BOOL g_PaintDesktopVersion = FALSE;
|
||||||
|
BOOL g_bWindowSnapEnabled = TRUE;
|
||||||
|
|
||||||
// HACK! We initialize SPI before we have a proper surface to get this from.
|
// HACK! We initialize SPI before we have a proper surface to get this from.
|
||||||
#define dpi 96
|
#define dpi 96
|
||||||
|
@ -100,8 +101,6 @@ static const WCHAR* KEY_KDBPREF = L"Control Panel\\Accessibility\\Keyboard Prefe
|
||||||
static const WCHAR* KEY_SCRREAD = L"Control Panel\\Accessibility\\Blind Access";
|
static const WCHAR* KEY_SCRREAD = L"Control Panel\\Accessibility\\Blind Access";
|
||||||
static const WCHAR* VAL_ON = L"On";
|
static const WCHAR* VAL_ON = L"On";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** Loading the settings ******************************************************/
|
/** Loading the settings ******************************************************/
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -215,6 +214,19 @@ SpiFixupValues(VOID)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Is Window Snap enabled? */
|
||||||
|
static BOOL IntIsWindowSnapEnabled(VOID)
|
||||||
|
{
|
||||||
|
WCHAR szValue[2];
|
||||||
|
if (RegReadUserSetting(L"Control Panel\\Desktop", L"WindowArrangementActive",
|
||||||
|
REG_SZ, szValue, sizeof(szValue)))
|
||||||
|
{
|
||||||
|
szValue[RTL_NUMBER_OF(szValue) - 1] = UNICODE_NULL; /* Avoid buffer overrun */
|
||||||
|
return (_wtoi(szValue) != 0);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
VOID
|
VOID
|
||||||
SpiUpdatePerUserSystemParameters(VOID)
|
SpiUpdatePerUserSystemParameters(VOID)
|
||||||
|
@ -344,6 +356,8 @@ SpiUpdatePerUserSystemParameters(VOID)
|
||||||
if (SPITESTPREF(UPM_LISTBOXSMOOTHSCROLLING)) gpsi->PUSIFlags |= PUSIF_LISTBOXSMOOTHSCROLLING;
|
if (SPITESTPREF(UPM_LISTBOXSMOOTHSCROLLING)) gpsi->PUSIFlags |= PUSIF_LISTBOXSMOOTHSCROLLING;
|
||||||
}
|
}
|
||||||
gdwLanguageToggleKey = UserGetLanguageToggle();
|
gdwLanguageToggleKey = UserGetLanguageToggle();
|
||||||
|
|
||||||
|
g_bWindowSnapEnabled = IntIsWindowSnapEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
|
|
|
@ -4,6 +4,7 @@ extern ATOM AtomMessage;
|
||||||
extern ATOM AtomWndObj; /* WNDOBJ list */
|
extern ATOM AtomWndObj; /* WNDOBJ list */
|
||||||
extern ATOM AtomLayer;
|
extern ATOM AtomLayer;
|
||||||
extern ATOM AtomFlashWndState;
|
extern ATOM AtomFlashWndState;
|
||||||
|
extern BOOL g_bWindowSnapEnabled;
|
||||||
|
|
||||||
#define HAS_DLGFRAME(Style, ExStyle) \
|
#define HAS_DLGFRAME(Style, ExStyle) \
|
||||||
(((ExStyle) & WS_EX_DLGMODALFRAME) || \
|
(((ExStyle) & WS_EX_DLGMODALFRAME) || \
|
||||||
|
|
Loading…
Reference in a new issue