Making windows smaller

Certain application windows will not resize below a certain amount.

Some you can make really small, whilst you are not using that app, others you cannot.

Two notable exceptions are
Keyboard Maestro editor (in terms of width)
Console (in terms of height)

Is there any way to determine what "minimum" limits have been set for an application window?

PS Why is there a minimum width limit on the KM Editor?

Because the author of the KM Editor specified that there was a minimum. It's hardcoded into the app. I suspect that the reason for the minimums is that the KM Editor would be very difficult to use if the panes were any smaller. Why do you want a smaller minimum? Which pane do you feel is "too large" at its current minimum? What do you want the minimum to be?

Do you mean programmatically or manually? It's easy to find the minimum manually. Just minimize the window and then measure its size. You can also measure its size using a KM token like %FrontWindowSize%. Here's a way using KM actions to display the minimum window size of the current application: (you can display or save the values, in the example below the minimum window size values are displayed)

image

1 Like

There is no programmatic way to query an app and ask for its smallest window size, unfortunately.

I've often thought about writing a macro that would track this info, as it would be useful in many situations. It's not overly difficult in concept:

Use a dictionary to store App Names and minimum window sizes. Any time an app is activated, check to see if there's an entry in the dictionary. If there isn't, put a message onscreen ("Getting minimum window size, please stand by."). Store the current window size, resize to a small size as in @Airy's macro, then write the app name and %FrontWindowSize% token to a new dictionary entry. Resize back to the stored size, clear onscreen message. If a dictionary entry already exists, the macro just exits.

Simple in theory, but I haven't felt the need for this enough to write it myself just yet :).

-rob.

1 Like

...and Outlook, Mail, Safari, BBEdit... It's probably quicker to list the apps that don't have a minimum window size.

Worse than that, window size is often context sensitive. A Finder window with the sidebar showing can only be reduced to a certain width with the KM "Manipulate Window" action -- hide the sidebar and the action can then make it smaller still (whereas you can drag the Finder window smaller and the sidebar hides automatically).

And because I was a bit bored this Sunday morning :), here's a very bare-bones macro to create a dictionary filled with apps' minimum window sizes.

Download Macro(s): Record minimum window sizes by app.kmmacros (9.2 KB)

Download Macro(s): Record minimum window sizes by app.kmmacros (9.3 KB)

Macro screenshot

Macro notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.
System information
  • macOS 14.7
  • Keyboard Maestro v11.0.3

This works as I hoped it would, which is always surprising when it happens on the first try :).

The macro runs on app switch, then checks to see if the frontmost app has an entry in the WindowSizes dictionary. If it doesn't, it saves the frontmost window's current size and location, tries to resize the window to 20x20, then records the actual window size. Finally, it restores the old window size and location and exits.

If the app already has an entry in the dictionary, the macro exits.

Here are some values from the dictionary it created during testing on my Mac:

WindowSizes
------------------------
Keyboard Maestro   :  825,258
Messages           :  660,320
Music MiniPlayer   :  350,64
Quicken            :  860,586
Safari             :  574,247
Signal             :  300,200
TextEdit           :  100,42

Now, there are more caveats than functionality with this macro :). As @Nige_S noted, Finder can have different minimums depending on whether the sidebar is open or not. And some apps may have different minimums for different window types (a topic list versus topic details, for example). Changing an existing entry requires mucking about with deleting dictionary entries. I could go on.....

To really put this to use, it'd have to be a lot more robust, but it does work as a proof of concept.

-rob.

2 Likes

Would the values be different on a screen of a different size or the same screen at a different resolution?

As they’re pixel values, I would expect they’d be resolution independent, but I didn’t do any testing to confirm that.

-rob.

I had a thought that maybe retina vs. non-retina would throw it off, so I set my 27" to full native resolution (5120x2880), and with some serious squinting, managed to run the macro again for a couple apps:

WindowSizes
------------------------
Keyboard Maestro   :  825,258
Safari             :  574,247

These are the same values as I got before, with the display set to retina resolution (2560x1440). It seems odd that the values are the same, as I would have expected the native figures to be half those values ... but then again, I get dazed and confused working with retina vs non-retina values :).

-rob.

Me too, which is why I asked the question. Thanks.