diff --git a/AltSnap.ini b/AltSnap.ini index 16ab4653..b1462667 100644 Binary files a/AltSnap.ini and b/AltSnap.ini differ diff --git a/AltSnap.txt b/AltSnap.txt index da1d4091..bbe4e0d0 100644 --- a/AltSnap.txt +++ b/AltSnap.txt @@ -1,7 +1,7 @@ *=========================================================================* * ALTSNAP for Windows NT4/2000/XP/Vista/7/8.x/10/11 * * Modified by Raymond Gillibert from original AltDrag by Stefan Sundin * -* release 1.53 (June 23, 2022) * +* release 1.54 (August 2, 2022) * *-------------------------------------------------------------------------* * Download MEGA: https://mega.nz/folder/mW5ExCCT#gI8DQICICk-y4FIjxaqtGg * * Download GitHub: https://github.com/RamonUnch/AltSnap/releases/ * @@ -184,6 +184,66 @@ Note that this version has some more feature. =========================================================================== == CHANGELOG == +== AltSnap 1.54 == + + + New: You can now set `UseZones=9` in the `[Zones]` section of the .ini + file and Windows will snap to the layout without having to press Shift. + Pressing shift or hitting space will disable zone-snapping instead. #219 + + + Now if you use Zones, and disable the **Toggle maximize state with the + resize button while moving** advanced option, then Zone snapping will be + toggled by any secondary buttons, like with FancyZones. #219 + + + New: Now you can set the opacity of the hollow rectangle (0-255) used + when the show window content while dragging option is disabled or when + FullWin=0. to do this you must modify the `TransWinOpacity` value in the + `[Performance]` section of the .ini file. #223 + + + New now you can set the value of `BLCapButtons` in the `[Advanced]` + section of the .ini file to choose for each mouse button if the titlebar + action will be or not extended to the caption buttons and the top + resizing border. Use `BLCapButtons=0` if you want all buttons to + consider the extended caption and use -1 for none of them. The default + value is 3 to avoid the extended caption for the left and right mouse + buttons so that AltSnap avoids interaction with the minimize, maximize + and close caption buttons ([_] [O] [X]). If you are unsure stick to + the default value if you want less titlebar detection use -1. #236 + + * Now a checkmark in the action menu will indicate the always on top state + of the pointed window. Same for Maximized and Borderless flags (#184). + + * Changed: Now when auto Snapping is enabled at the maximum level, then + pressing shift will disable snapping instead of doing nothing. + + * Changed: Now several keys can be selected for the alternate action + ie: the `ModKey` value in the `[Input]` section is a key list and works + like the Hotkeys value. Same was applied to `HScrollKey`. (#207) + + * Fixed: Now smarter areo-snapping will be properly re-enabled when you + release Shift. (#211) + + * Fixed: Snapping to the layout will no longer ignore the Max snapping + speed option. (#218) + + * Fixed multiple Action menu popping up in some cases. (#213) + + * Fixed some stuck mouse buttons in some cases when using the Move + Windows with a long left click option. + + * Fixed #220, Minic aero snapping is no longer necessary for Snapping + to the snap layout (Zones). + + * Fixed: Modifying the config will no longer reset the `UseZones` value. + + * Fixed #226, #229: Now the `DWMWA_CAPTION_BUTTON_BOUNDS` rectangle is + used to ensure that we are inside a titlebar and not caption buttons. + This fixes an annoying Windows 10 bug. + + * Fixed, now the common french e dans l'o `œ` character is available in + the default extended character menu (LATIN SMALL/CAPITAL LIGATURE OE). + + * Updated Chinese translation, thanks to @yatli. + == AltSnap 1.53 == * New: An extra key menu can now be enabled in the Keyboard tab of the @@ -1312,7 +1372,7 @@ Note that this version has some more feature. =========================================================================== == OS Requirement == -AltDrag should work on NT4sp3+/2000/XP/2003/Vista/7/8/10. +AltDrag should work on NT4sp3+/2000/XP/2003/Vista/7/8/10/11. This program needs at least Windows NT4 service pack 3 or later. This is because it relies on the 'LowLevel Keyboard/Mouse Proc' functions diff --git a/Lang/_en_US baseline.txt b/Lang/_en_US baseline.txt index 8f2c19f6..92a6cc39 100644 Binary files a/Lang/_en_US baseline.txt and b/Lang/_en_US baseline.txt differ diff --git a/Makefile b/Makefile index fc508f1b..0b113a4b 100644 --- a/Makefile +++ b/Makefile @@ -1,35 +1,84 @@ CC=gcc WR=windres -INCLUDE=-IC:\msys64\mingw32\i686-w64-mingw32\include -ID:\Straw\M81\mingw32\i686-w64-mingw32\include - -WARNINGS=-Wall -Wformat-security -Wstrict-overflow -Wsign-compare -Wclobbered \ - -Wempty-body -Wignored-qualifiers -Wuninitialized -Wtype-limits -Woverride-init \ - -Wlogical-op -Wno-multichar -Wno-attributes -Wduplicated-cond -Wduplicated-branches \ - -Wnull-dereference -Wno-unused-function -Wshadow -Warray-bounds=2 -Wstack-usage=4096 -Werror=vla +WARNINGS=-Wall \ + -Wformat-security \ + -Wstrict-overflow \ + -Wsign-compare \ + -Wclobbered \ + -Wempty-body \ + -Wignored-qualifiers \ + -Wuninitialized \ + -Wtype-limits \ + -Woverride-init \ + -Wlogical-op \ + -Wno-multichar \ + -Wno-attributes \ + -Wduplicated-cond \ + -Wduplicated-branches \ + -Wnull-dereference \ + -Wno-unused-function \ + -Wshadow \ + -Warray-bounds=2 \ + -Wstack-usage=4096 \ + -Werror=vla # -Wunused-parameter # -Wtraditional-conversion # -fira-region=one/mixed # -Wstack-usage=2048 +# -finput-charset=UTF-8 +# -Wc++-compat + +CFLAGS=-Os -std=c99 \ + -finput-charset=UTF-8 \ + -m32 -march=i386 -mtune=i686 \ + -mno-stack-arg-probe \ + -mpreferred-stack-boundary=2 \ + -momit-leaf-frame-pointer \ + -fno-stack-check \ + -fno-stack-protector \ + -fno-ident \ + -fomit-frame-pointer \ + -fshort-enums \ + -fno-exceptions \ + -fno-dwarf2-cfi-asm \ + -fno-asynchronous-unwind-tables \ + -fgcse-sm \ + -fgcse-las \ + -fno-plt \ + -D__USE_MINGW_ANSI_STDIO=0 \ + -Wp,-D_FORTIFY_SOURCE=2 \ + $(WARNINGS) + +LDFLAGS=-nostdlib \ + -lmsvcrt \ + -lkernel32 \ + -luser32 \ + -lgdi32 \ + -s \ + -Wl,-s,-dynamicbase \ + -Wl,-nxcompat \ + -Wl,--no-seh \ + -Wl,--relax \ + -Wl,--disable-runtime-pseudo-reloc \ + -Wl,--enable-auto-import \ + -Wl,--disable-stdcall-fixup -OPTI=-O2 -fira-region=mixed -fno-align-functions -fno-align-jumps -fno-align-labels -fno-align-loops -freorder-blocks-algorithm=simple -fno-tree-ch -# -fshort-enums -CFLAGS=-Os -std=c99 -fno-stack-check -fno-stack-protector -fno-ident -fomit-frame-pointer \ - -mno-stack-arg-probe -m32 -march=i386 -mtune=i686 -mpreferred-stack-boundary=2 -momit-leaf-frame-pointer \ - -nostdlib -lmsvcrt -lkernel32 -luser32 -lgdi32 -s -fgcse-sm -fgcse-las -fno-plt \ - -Wl,-s,-dynamicbase,-nxcompat,--no-seh,--relax,--disable-runtime-pseudo-reloc,--enable-auto-import,--disable-stdcall-fixup \ - -D__USE_MINGW_ANSI_STDIO=0 -Wp,-D_FORTIFY_SOURCE=2 -fshort-enums\ - $(INCLUDE) $(WARNINGS) -fno-exceptions -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables +EXELD = $(LDFLAGS) \ + -Wl,--tsaware \ + -lcomctl32 \ + -ladvapi32 \ + -lshell32 \ + -Wl,--disable-reloc-section default: AltSnap.exe hooks.dll hooks.dll : hooks.c hooks.h hooksr.o unfuck.h nanolibc.h zones.c snap.c - $(CC) -o hooks.dll hooks.c hooksr.o $(CFLAGS) -mdll -e_DllMain@12 + $(CC) -o hooks.dll hooks.c hooksr.o $(CFLAGS) $(LDFLAGS) -mdll -e_DllMain@12 -# --disable-reloc-section AltSnap.exe : altsnapr.o altsnap.c hooks.h tray.c config.c languages.h languages.c unfuck.h nanolibc.h - $(CC) -o AltSnap.exe altsnap.c altsnapr.o $(CFLAGS) -Wl,--tsaware,--disable-reloc-section -lcomctl32 -mwindows -ladvapi32 -lshell32 -e_unfuckWinMain@0 + $(CC) -o AltSnap.exe altsnap.c altsnapr.o $(CFLAGS) $(EXELD) -mwindows -e_unfuckWinMain@0 altsnapr.o : altsnap.rc window.rc resource.h AltSnap.exe.manifest media/find.cur media/find.ico media/icon.ico media/tray-disabled.ico media/tray-enabled.ico $(WR) altsnap.rc altsnapr.o -Fpe-i386 diff --git a/MakefileX64 b/MakefileX64 index ce64bc57..a2e82c29 100644 --- a/MakefileX64 +++ b/MakefileX64 @@ -7,9 +7,9 @@ WARNINGS=-Wall -Wformat-security -Wstrict-overflow -Wsign-compare -Wclobbered \ CFLAGS=-Os -fno-stack-check -fno-stack-protector -fno-ident -fomit-frame-pointer \ -mno-stack-arg-probe -momit-leaf-frame-pointer -m64 -march=x86-64 -mtune=generic \ - -nostdlib -lmsvcrt -lkernel32 -luser32 -lgdi32 -s -fgcse-sm -fgcse-las -fno-plt \ + -nostdlib -lmsvcrt -lkernel32 -luser32 -lgdi32 -lmsvcrt -lwinmm -s -fgcse-sm -fgcse-las -fno-plt \ -Wl,-dynamicbase,-nxcompat,--no-seh,--relax,--disable-runtime-pseudo-reloc,--enable-auto-import,--disable-stdcall-fixup \ - -Wp,-D_FORTIFY_SOURCE=2 -fshort-enums\ + -D__USE_MINGW_ANSI_STDIO=0 -Wp,-D_FORTIFY_SOURCE=2 -fshort-enums\ $(INCLUDE) $(WARNINGS) -fno-exceptions -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables default: AltSnap.exe hooks.dll diff --git a/Makefiledb b/Makefiledb index 4e04294d..12b1b670 100644 --- a/Makefiledb +++ b/Makefiledb @@ -11,11 +11,12 @@ WARNINGS=-Wall -Wformat-security -Wstrict-overflow -Wsign-compare -Wclobbered \ # -Wstack-usage=2048 ## DEBUG FLAGS -CFLAGS= -nostdlib -Os -g -DLOG_STUFF=1 -m32 -march=i386 -mtune=generic \ +CFLAGS= -Os -g -DLOG_STUFF=1 -m32 -march=i386 -mtune=generic \ + -fsanitize=address -fno-omit-frame-pointer \ -lmsvcrt -lkernel32 -luser32 -lgdi32 -fgcse-sm -fgcse-las -fno-plt \ - -Wl,-dynamicbase,-nxcompat,--no-seh,--relax,--disable-runtime-pseudo-reloc,--enable-auto-import,--disable-stdcall-fixup \ + -Wl,-dynamicbase,-nxcompat,--no-seh,--relax,--enable-auto-import,--disable-stdcall-fixup \ -D__USE_MINGW_ANSI_STDIO=0 -Wp,-D_FORTIFY_SOURCE=2 -fshort-enums\ - $(INCLUDE) $(WARNINGS) -fno-exceptions -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables + $(INCLUDE) $(WARNINGS) default: AltSnap.exe hooks.dll @@ -24,7 +25,7 @@ hooks.dll : hooks.c hooks.h hooksr.o unfuck.h nanolibc.h zones.c snap.c #--disable-reloc-section, -mwindows AltSnap.exe : altsnapr.o altsnap.c hooks.h tray.c config.c languages.h languages.c unfuck.h nanolibc.h - $(CC) -o AltSnap.exe altsnap.c altsnapr.o $(CFLAGS) -Wl,--tsaware,--disable-reloc-section -lcomctl32 -ladvapi32 -lshell32 -e_unfuckWinMain@0 + $(CC) -o AltSnap.exe altsnap.c altsnapr.o $(CFLAGS) -Wl,--tsaware -lcomctl32 -ladvapi32 -lshell32 -e_unfuckWinMain@0 altsnapr.o : altsnap.rc window.rc resource.h AltSnap.exe.manifest media/find.cur media/find.ico media/icon.ico media/tray-disabled.ico media/tray-enabled.ico windres altsnap.rc altsnapr.o -Fpe-i386 diff --git a/altsnap.rc b/altsnap.rc index 002cdf9a..58f3729f 100644 --- a/altsnap.rc +++ b/altsnap.rc @@ -8,8 +8,8 @@ CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "AltSnap.exe.manifest" #define VS_VERSION_INFO 1 VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,5,3,0 - PRODUCTVERSION 1,5,3,0 + FILEVERSION 1,5,4,0 + PRODUCTVERSION 1,5,4,0 FILEFLAGSMASK 0x3fL FILEFLAGS 0x0L FILEOS 0x40004L @@ -21,7 +21,7 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "AltSnap" - VALUE "FileVersion", "1.53" + VALUE "FileVersion", "1.54" VALUE "InternalName", "altsnap" VALUE "OriginalFilename", "AltSnap.exe" VALUE "CompanyName", "Gillibert Software" diff --git a/hooks.h b/hooks.h index 0fb4794a..04528ebf 100644 --- a/hooks.h +++ b/hooks.h @@ -20,11 +20,12 @@ #define LP_AGGRKILL (1) #define LP_TOPMOST (1<<1) #define LP_BORDERLESS (1<<2) +#define LP_MAXIMIZED (1<<3) // App #define APP_NAME L"AltSnap" #define APP_NAMEA "AltSnap" -#define APP_VERSION "1.53" +#define APP_VERSION "1.54" #define APP_PROPPT APP_NAMEA"-RDim" #define APP_PROPFL APP_NAMEA"-RFlag" #define APP_PROPOFFSET APP_NAMEA"-ROffset" diff --git a/hooks.rc b/hooks.rc index a26512ed..68044df8 100644 --- a/hooks.rc +++ b/hooks.rc @@ -1,6 +1,6 @@ 1 VERSIONINFO - FILEVERSION 1,5,3,0 - PRODUCTVERSION 1,5,3,0 + FILEVERSION 1,5,4,0 + PRODUCTVERSION 1,5,4,0 FILEFLAGSMASK 0x3fL FILEFLAGS 0x0L FILEOS 0x40004L @@ -14,7 +14,7 @@ BEGIN VALUE "FileDescription", "Hooks for AltSnap" VALUE "InternalName", "hooks" VALUE "OriginalFilename", "hooks.dll" - VALUE "FileVersion", "1.53" + VALUE "FileVersion", "1.54" VALUE "CompanyName", "Gillibert Software" VALUE "LegalCopyright", "Gillibert" END diff --git a/languages.h b/languages.h index abf850ff..29eb0a96 100644 --- a/languages.h +++ b/languages.h @@ -524,7 +524,7 @@ static const struct strings en_US = { /* autoremaximize */ L"Automatically &remaximize windows when changing monitor", /* aerotopmaximizes */ L"&Maximize windows snapped at top", /* aerodbclickshift */ L"Invert shift &behavior for double-click aero snapping", - /* maxwithlclick */ L"&Toggle maximize state with right-click while moving", + /* maxwithlclick */ L"&Toggle maximize state with the resize button while moving", /* restoreonclick */ L"Rest&ore window with single click like original AltDrag", /* fullscreen */ L"Enable on &full screen windows", /* blmaximized */ L"&Disable AltSnap on Maximized windows", @@ -549,8 +549,8 @@ static const struct strings en_US = { "1) Open several of those Test Windows\n" "2) Dispose them as you please\n" "3) Hit the *&Save test windows as snap layout* option in the tray menu", - - /* A */ L"àáâäãåæª%ÄăąǎǟǡǣǻǽÈȃȧ|Ȧá¸%â±¥|ȺÉ|Ɐɑ|â±­É’|â±°â²|â²€â“", \ + /* Extended character list for each virtual key */ + /* A */ L"àáâäæãåª%ÄăąǎǟǡǣǻǽÈȃȧ|Ȧá¸%â±¥|ȺÉ|Ɐɑ|â±­É’|â±°â²|â²€â“", \ /* B */ L"%ƀɓƃƅɃ%ɓḃḅḇⓑ", \ /* C */ L"碩%ćĉċÄƈḉȼ|Ȼɕⓒ", \ /* D */ L"ð%ÄÄ‘É–É—ÆŒÆḋá¸á¸á¸‘ḓdžDždzDzȡȸⓓ", \ @@ -564,7 +564,7 @@ static const struct strings en_US = { /* L */ L"£%ĺļľŀłƛljLjȴƚ|Ƚⱡ|â± É«|Ɫḷḹḻḽⓛ", \ /* M */ L"µ%ḿá¹á¹ƒÉ±|Ɱɯⓜ", \ /* N */ L"ñ%ńņňʼnŋɲƞ|ȠnjNjǹȵ%ṅṇṉṋâ“", \ - /* O */ L"òóôöõø°%ÅÅÅ‘%ɔɵơƣǒǫǭǿÈÈÈ£|Ȣȫ|Ȫȭ|Ȭȯ|Ȯȱ|È°á¹á¹á¹‘ṓ%ⱺⓞ", \ + /* O */ L"òóôöœõø°%ÅÅÅ‘%ɔɵơƣǒǫǭǿÈÈÈ£|Ȣȫ|Ȫȭ|Ȭȯ|Ȯȱ|È°á¹á¹á¹‘ṓ%ⱺⓞ", \ /* P */ L"¶þ·•%ƥᵽ|Ᵽṕṗⓟ", \ /* Q */ L"¿¤‰‘’“â€â€žâ€¦â€“—«»‹›%ȹɋ|ÉŠâ“ ", \ /* R */ L"®%ŕŗřƦȑȓṙṛá¹á¹ŸÉ|Ɍɽ|Ɽⱹⓡ", \ diff --git a/nanolibc.h b/nanolibc.h index d6fd1867..553d2083 100644 --- a/nanolibc.h +++ b/nanolibc.h @@ -203,7 +203,7 @@ static int wcscmpL(const wchar_t *__restrict__ a, const wchar_t *__restrict__ b) static int wcscmp_star(const wchar_t *__restrict__ a, const wchar_t *__restrict__ b) { if(!b) return 0; -// if (*b == '*') return 1; /* Should not start with '*' */ + /* if (*b == '*') return 1; */ /* Should not start with '*' */ while(*a && *a == *b) { a++; b++; } return (*a != *b) & (*b != '*'); } diff --git a/tray.c b/tray.c index cee87e44..89da00fa 100644 --- a/tray.c +++ b/tray.c @@ -6,6 +6,10 @@ * Modified By Raymond Gillibert in 2020 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#ifndef NIF_INFO +#define NIF_INFO 0x00000010 +#endif + static struct { // NOTIFYICONDATA for NT4 DWORD cbSize; HWND hWnd; diff --git a/unfuck.h b/unfuck.h index 0cafde69..85bcdcd0 100644 --- a/unfuck.h +++ b/unfuck.h @@ -415,7 +415,7 @@ static BOOL IsVisible(HWND hwnd) } /* Use the DWM api to obtain the rectangel that *should* contain all - * caption buttons. This is usefull to ensure we are not in one of them. + * caption buttons. This is usefull to ensure we are not in one of them. */ static BOOL GetCaptionButtonsRect(HWND hwnd, RECT *rc) {