Skip to content

Commit

Permalink
Prepare 1.54
Browse files Browse the repository at this point in the history
  • Loading branch information
RamonUnch authored Aug 2, 2022
1 parent 610d5bd commit 3008c2e
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 38 deletions.
Binary file modified AltSnap.ini
Binary file not shown.
64 changes: 62 additions & 2 deletions AltSnap.txt
Original file line number Diff line number Diff line change
@@ -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/ *
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Binary file modified Lang/_en_US baseline.txt
Binary file not shown.
83 changes: 66 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions MakefileX64
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions Makefiledb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions altsnap.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions hooks.rc
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions languages.h
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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ȡȸⓓ", \
Expand All @@ -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"®%ŕŗřƦȑȓṙṛṝṟɍ|Ɍɽ|Ɽⱹⓡ", \
Expand Down
2 changes: 1 addition & 1 deletion nanolibc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 != '*');
}
Expand Down
4 changes: 4 additions & 0 deletions tray.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion unfuck.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 3008c2e

Please sign in to comment.