b30: Window Zoom Button

Need help with a script? This is the place to discuss how to get your code running!

b30: Window Zoom Button

Postby sctell » Mon Dec 04, 2017 12:24 am

I have noticed that when clicking on the window zoom button the window does not actually go full screen.

Also when dragging to resize you cannot drag to the full window size.

Is this a bug. See images below:

Screen Shot.png
Screen Shot.png (11.24 KiB) Viewed 101 times


Screen Shot 1.png
Screen Shot 1.png (11.51 KiB) Viewed 101 times



All the best

Terry
sctell
 
Posts: 1124
Joined: Sun Jul 06, 2008 10:41 am

Re: b30: Window Zoom Button

Postby codegreen » Mon Dec 04, 2017 6:59 am

FWIW absent a maximumSize uprop, in SC4 this limit is determined by banging together the results of some Toolbox calls that report a window's port rectangle, structure widths, and the suggested runtime positioning bounds for its dominant device.

Thus any 'unexpected' behavior here is Apple's doing, and should affect all versions of SC4 equally. If you find otherwise, please let us know...

Thanks,
-Mark
codegreen
 
Posts: 1503
Joined: Mon Jul 14, 2008 11:03 pm

Re: b30: Window Zoom Button

Postby sctell » Mon Dec 04, 2017 7:16 am

Out of interest the example in the help guide for screeRect suggests this:

Code: Select all
on mouseUp
put item 3 of the screenRect into tRight
put item 4 of screenRect() into tBottom
set the rect of this wd to 1,41,tRight,tBottom
end mouseUp



This is incorrect on my 1920 x 1080 iMac running sierra.
if i use 45 instead of 41 it seems to work correctly.

Code: Select all
on mouseUp
put item 3 of the screenRect into tRight
put item 4 of screenRect() into tBottom
set the rect of this wd to 1,45,tRight,tBottom
end mouseUp


I presume therefore that the zoom button must use another method entirely.


All the best

Terry
sctell
 
Posts: 1124
Joined: Sun Jul 06, 2008 10:41 am

Re: b30: Window Zoom Button

Postby codegreen » Mon Dec 04, 2017 8:42 am

The screenRect returns the rect of the underlying graphic device itself not its available positioning bounds (which also depend on things like the menu bar visibility and placement and the size and location of the Dock) so it should always return the same value on a given monitor/resolution setup.

The structure widths of various window styles are what's changed repeatedly across OS versions. Since the bounds of SC wds are really those of the accompanying graphics port any changes to structure widths will introduce squirm into positioning calculations (like that example) which assume fixed values.

FWIW IIRC Apple didn't start tweaking structure widths until long after that script was written...

-Mark
codegreen
 
Posts: 1503
Joined: Mon Jul 14, 2008 11:03 pm

Re: b30: Window Zoom Button

Postby codegreen » Mon Dec 04, 2017 7:05 pm

Also I think since Classic days Apple has added a small margin that further insets window positioning bounds, presumably so mouse-oriented users have somewhere to click to easily switch back to the Finder (which most think of as The Computer, not an app).

-Mark
codegreen
 
Posts: 1503
Joined: Mon Jul 14, 2008 11:03 pm


Return to Scripting in SuperTalk

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron