Closed Bug 338723 Opened 14 years ago Closed 14 years ago

Window resizable to zero height

Categories

(Core :: Widget: Cocoa, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mark, Assigned: jaas)

Details

Attachments

(2 files, 2 obsolete files)

In cocoafox, windows are resizable to 0px (or some other ridiculously small) height for the content area.  It's possible to resize the window so small that the grow box is not accessible.  There should be probably be some rational minimum height, as there is in carbonfox.  There does appear to be a minimum width.
Attached patch fix v1.0 (obsolete) — Splinter Review
This sets the minimum window size to 60x60, which is about what Apple recommends and also fits the Firefox toolbar/bm bar nicely :) Doesn't seem to mess with the hidden window.

It looks like there isn't a good way to tell if a resize is user or script with Cocoa, so we just enforce this on all windows. I can't think of any reason that isn't malicious for someone to create a window smaller than 60x60 in the content area. If you can, let me know.
Attachment #223046 - Flags: review?(mark)
One problem is that if you apply this patch and go into Exposé, you can see the 60x60 hidden window. You can see the 1x1 hidden window without this patch, so the real fix is to not have the hidden window show up in Exposé.
Comment on attachment 223046 [details] [diff] [review]
fix v1.0

Need something that accounts for Exposé.
Attachment #223046 - Flags: review?(mark)
Attached patch fix v2.0 (obsolete) — Splinter Review
This sets the minimum size and hides the hidden window from expose by setting its window level to kCGDesktopWindowLevelKey.
Attachment #223046 - Attachment is obsolete: true
Attachment #223073 - Flags: review?(mark)
Attached patch fix v3.0Splinter Review
somehow I missed the fact that we have an invisible window type so we can handle setting the window level on window creation - this make the patch significantly shorter :)
Attachment #223073 - Attachment is obsolete: true
Attachment #223075 - Flags: review?(mark)
Attachment #223073 - Flags: review?(mark)
Comment on attachment 223075 [details] [diff] [review]
fix v3.0

I can't resize the window horizontally narrower than 80px with or without this patch.  Is AppKit doing that?

r=me, nice to have the Exposé bug fixed too.
Attachment #223075 - Flags: review?(mark) → review+
landed on trunk
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.