Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble when mooving to the rightmost zone #374

Closed
RamonUnch opened this issue Feb 21, 2023 · 13 comments
Closed

Trouble when mooving to the rightmost zone #374

RamonUnch opened this issue Feb 21, 2023 · 13 comments

Comments

@RamonUnch
Copy link
Owner

RamonUnch commented Feb 21, 2023

@RamonUnch , I found Chrome like browsers or electron apps has troubles when moving to the rightmost zone. The right side of the window are cut off (min, max, close buttons) or shift over the right edge so they are invisible. See the screenshot. This problem does not happen with normal desktop apps such as notepad, explorer window etc. Can this issue be addressed in the AltSnap? By the way, I am using Grid Layout (5x2).

See the screenshot for the issue. The red line indicate the right side screen boarder.

screenshot_20230220_133949_001

Originally posted by @zhichaoh in #368 (comment)


#368 (comment)

I found the root cause of this issue is that Chrome and its derived apps has minimal size and cannot shrink below that size. See: https://stackoverflow.com/questions/59199833/chrome-doesnt-scale-below-x-500px. FancyZone has the same issue. So this not an issue with AltSnap but rather the design of Chrome.

@RamonUnch
Copy link
Owner Author

As you say many windows do have a minimum/maximim size, so when the zone to which you snap to is too small, you will have trouble.
This is still a relevant issue though because ideally AltSnap would ensure the window stay fully visible even when snapped to the rightmost zone, and not let any go out of the monitor.

@zhichaoh
Copy link

An acceptable way for me is to move the window and window's right edge align with the Monitor screen's right edge instead of "cutting the window" if resizing Chrome like windows is impossible. It may feel a little bit strange as it may appear that the window is not resizing down to the zone area completely. But it is understandable.

@zhichaoh
Copy link

zhichaoh commented Feb 22, 2023

@RamonUnch, it looks like the GlazeWM(https://github.com/lars-berger/GlazeWM) can resize the chrome windows beyond their minimal sizes.

screenshot_20230222_132303_001. See the circled windows border (brave and edge browsers). So it looks like this is doable.

@RamonUnch
Copy link
Owner Author

It is possible to ignore the min/max limits that a window specifies, AltSnap purposefully respect what each window declares (taking extra steps for that), we are not supposed to ignore this information. It seems that GlazeWM ignores the information but it is quite risky, because if a program gives indication on the min size of a window then not respecting might lead to unintended behaviour or even crash. Probably no crash though unless the program is poorly written.

I could add the option to ignore the MinMax info but it might lead to pther problems.

@zhichaoh
Copy link

Yes, absolutely agree with you. See the rightmose windows explorer title bar in my screenshot, the '+' button is shifted under the 'maximize' button. If user does not remember what that window is for due to the small size, user may get super confused.

@RamonUnch
Copy link
Owner Author

It is so simple to add an option to ignore MinMaxInfo that I just did it, Also it might help to have it around for debugging in the future. In your case you just want to ignore the Min info so set IgnoreMinMaxInfo to 1.

in the [Advanced] section of the ini file

IgnoreMinMaxInfo=1
; Set to 0 to take into account the MinMax Info (default, recommended)
; Set to 1 if you want to ignore the minimum window size
; set to 2 if you want to ignore the maximum window size
; set to 3 to completely ignore Min/Max info

AltSnap1.59test24_x64.zip

Some programs might still resize themselves back to their min size if you squish them too much.

@zhichaoh
Copy link

Thank you for the quick update. Unfortunately, it does not seem to affect the chrome browsers (this include brave, edge, microsoft teams etc). I tried both 1 and 3 for the value. My settings for Advanced section is below:
...
[Advanced]
IgnoreMinMaxInfo=3
; Set to 0 to take into account the MinMax Info (default, recommended)
; Set to 1 if you want to ignore the minimum window size
; set to 2 if you want to ignore the maximum window size
; set to 3 to completely ignore Min/Max info

DragThreshold=3
AutoRemaximize=0
; Automatically re-maximize windows when you move them between monitors.

SnapThreshold=20
; The distance, in number of pixels, when snapping starts (default 20).

AeroThreshold=5
; Distance in pixels, when Aero snapping to monitor sides (default 5).

SnapGap=4
; Gap in pixels from -128 to +127 between two snapped windows.
; Use negative values if you want an overlap, default is 0
; I suggest -1 under Win10.

AeroMaxSpeed=65535
AeroSpeedTau=64
; Speed beyond which AeroSnaps will not occur while Moving.
; AeroMaxSpeed is in pixels/Tau (from 0-65535).
; AeroSpeedTau to specifies Tau time in milliseconds (default 64).
; (i) Set AeroMaxSpeed to a "high" value (like 100) and try to move fast
; a window between two monitors, if it gets aero-snapped, decrease the value
; until it no longer snaps, and check that the window still snaps when you
; want it to.

MultipleInstances=0
; If set to 1, allows running multiple instances of AltSnap.

AlwaysElevate=1
; If set to 1, AltSnap will always request elevation.

ResizeAll=0
; If set to 1, all windows are resizable, even those without borders.

FullScreen=1
; If set to 1, all fullscreen windows are moveable.
; If set to 0, blacklists all fullscreen windows.
; A fullscreen window is set to your monitor size and has no title bar.
; It is not exactly the same than a Maximized window (see below)

BLMaximized=0
; Set to 1 to disable AltSnap on all Maximized windows.
; If set to 0 (default) maximized windows will be restored by AltSnap.
; Not the same thing than "fullscreen" window but looks quite similar.

AeroTopMaximizes=1
; If set to 1, windows get maximized when snapped at the top
; of the monitor instead of being resized to fill its top half.
; If set to 2, Shift behavior will be inverted for double-right-click:
; Aero Snap <-> Extend border to monitor.
; If set to 3, both of the above work.
; You can always hold Shift to invert the behavior.

UseCursor=1
; If set to 0, disables any cursor handling (not recommended).
; If set to 1, enables all cursor sets (default)
; If set to 2, disables the Hand cursor when moving
; If set to 3, normal cursor is always used, even when resizing.
; If set to 4, uses the ResizeAll cursor for movement instead of the Hand.

MinAlpha=8
; Minimum alpha for the transparency action, from 1-255 (default 8).
AlphaDelta=64
AlphaDeltaShift=8
; Alpha step for the transparency action, from -128 to +127 (default 64).
; The other value is applied when Shift is pressed (default 8).

ShiftSnaps=1
; Set to 0 if you do not want border-to-border windows snapping to be
; Enabled by the shift key (default is 1: enabled).

PiercingClick=1
TopmostIndicator=1
; Set to 1 to enable, in this case, if you press Alt+Click without moving,
; the click will be transmitted to the pointed program.
; Enabling this option will disable doubleclicking actions!
; If you keep it disabled (default) you still will have the click
; transmission if you hold the click down more than a double click delay.

@RamonUnch
Copy link
Owner Author

I can confirm, Chrome resizes itself if you go beyond the limits, so I am unsure of what GlazeWM does.
I could not find yest a program for which this settings make sense, so I will probably not merge this patch.

@zhichaoh
Copy link

Yes, FancyZone has the same challenge. See microsoft/PowerToys#3433 and microsoft/PowerToys#10903 for related issues regarding minimal window sizes. GlazeWM's resizing is kind of dubious too as it can mess up the title bar.

@RamonUnch
Copy link
Owner Author

Yes, FancyZone has the same challenge. See microsoft/PowerToys#3433 and microsoft/PowerToys#10903 for related issues regarding minimal window sizes. GlazeWM's resizing is kind of dubious too as it can mess up the title bar.

Indeed it seems GlazeWM is really a window manager so it is responsible for title-bar drawing, quite integrated to the system. AltSnap like FancyZones are just moving around the windows as they are and cannot do much more that what you could achieve with native resizing.

@RamonUnch
Copy link
Owner Author

Actually I just remembered now that we must pass the SWP_NOSENDCHANGING flag to SetWindowPos, I was already doing it for the Roll/UnRoll action.

Have a try with this one setting IgnoreMinMaxInfo=1 in the [Advanced] section of the ini file.
It is dirty and some programs might not function correctly, but it will allow you to actually resize windows beyond their Minimum size.

AltSnap1.60test1.zip

@zhichaoh
Copy link

It works with this fix, amazing!

@RamonUnch
Copy link
Owner Author

Present in 1.60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants