Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Adora

macrumors 6502
Original poster
Jun 30, 2024
345
137
Some Windows on macOS have strange sizes that sometimes deosn't make any sense for a good usage and can't be resized or only in one special direction.

Is there any possibility to force resizing? I have SIP disabled, am able to install kernel extensions and Gatekeeper is also turned off. So I am open for anything.

I would be very happy to find any hack for this. Even if it's not generally working and I have to change something in files of every single app where it is annoying me.
 

zevrix

macrumors 6502
Oct 10, 2012
345
207
Some Windows on macOS have strange sizes that sometimes deosn't make any sense for a good usage and can't be resized or only in one special direction.

Can you please elaborate?

What do you mean by "Windows on macOS"? Are you referring to all windows in all apps or something specific?

Can you describe a specific scenario where windows "can't be resized or only in one special direction"?
 

FreakinEurekan

macrumors 603
Sep 8, 2011
6,134
3,120
I'm not gonna say "There's no way to do it" - but it would not be simple (or reliable, IMO).

I'd suggest apple.com/feedback & in the meantime, adjust your expectations.
 
  • Like
Reactions: Adora

f54da

macrumors 6502
Dec 22, 2021
475
170
MacForge plugin to swizzle nswindow init and add nswindowmask resizable? But non-resizable windows are probably non-resizable for a reason, and have layout constraints that assume the fixed size.
 
  • Like
Reactions: Adora

Adora

macrumors 6502
Original poster
Jun 30, 2024
345
137
Can you please elaborate?

What do you mean by "Windows on macOS"? Are you referring to all windows in all apps or something specific?

Can you describe a specific scenario where windows "can't be resized or only in one special direction"?

I mean things like the System Setting or a settings window inside an app, that is much too small for its purpose and you have to scroll very long to do things in there.

MacForge plugin to swizzle nswindow init and add nswindowmask resizable? But non-resizable windows are probably non-resizable for a reason, and have layout constraints that assume the fixed size.

I remember this from many years ago. Looks like it doesn't work on Apple Silicon and its latest update was 4 years ago.

There also had been a beautiful theme manager for OS X, what didn't get updated anymore after the Yosemite-Version, just because of SIP, what I disabled anyway always.
 

zevrix

macrumors 6502
Oct 10, 2012
345
207
I mean things like the System Setting or a settings window inside an app, that is much too small for its purpose and you have to scroll very long to do things in there.

While the System Settings main window can be resized to its full height, I agree that it's totally idiotic that so many of its sub-windows cannot be resized. It applies to similar situations in many other apps. So I feel your pain.

There's no solution that I'm aware of.
 
  • Love
Reactions: Adora

f54da

macrumors 6502
Dec 22, 2021
475
170
>doesn't support Silicon. It's sad they can't resurrect it.

Says it supports M1 on the changelog. But if you've disabled SIP, there are plenty of ways to do code injection e.g. https://github.com/LIJI32/MIP. I think all of them ultimately just use task_for_pid and manipulate thread state (the same way a debugger might?)
 

zevrix

macrumors 6502
Oct 10, 2012
345
207
Says it supports M1 on the changelog.

It's a myth. I mean I know that some people report that they're able to run it on M1 but these are random exceptions. I tried several times in the last few years and was never able to. And I myself wrote a MacForge plug-in shortly before M1 killed it.

But if you've disabled SIP there are plenty of ways to do code injection e.g. https://github.com/LIJI32/MIP.

Thanks for this link. I need to look into this one when I have time. (Obviously, this github project doesn't help OP that much.)
 

f54da

macrumors 6502
Dec 22, 2021
475
170
>this github project doesn't help OP that much

I mean once you've got code injection working a plugin to add NSWindowMaskResizable to all NSWindows is fairly trivial. I guess a way to see how this would work is to use lldb to manually set setylemask on a non-resizable window you're interested in and see how it behaves with this mask set.
 
  • Like
Reactions: Adora

Adora

macrumors 6502
Original poster
Jun 30, 2024
345
137
>this github project doesn't help OP that much

I mean once you've got code injection working a plugin to add NSWindowMaskResizable to all NSWindows is fairly trivial. I guess a way to see how this would work is to use lldb to manually set setylemask on a non-resizable window you're interested in and see how it behaves with this mask set.

I'll have a look at this MIP and what you wrote here. But I think it's all too complicated for me.
 

thebart

macrumors 6502
Feb 19, 2023
460
427
Unfortunately it means the app was not designed to be resizable. The developer didn't design the app to rearrange its content to fill an arbitrary size.

The system settings app is a culprit here. Notice you can't resize the left navigation pane. It means the layout is fixed. Even if you could force hack the window to resize, you would probably not get the result you want, ie the content to resize and fill up the space
 

zevrix

macrumors 6502
Oct 10, 2012
345
207
I mean once you've got code injection working a plugin to add NSWindowMaskResizable to all NSWindows is fairly trivial. I guess a way to see how this would work is to use lldb to manually set setylemask on a non-resizable window you're interested in and see how it behaves with this mask set.

Yes, you only need two starting conditions: someone has to be an experienced developer AND is willing to dedicate the time and effort to this project free of charge.
 

f54da

macrumors 6502
Dec 22, 2021
475
170
Objective-C:
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>

@interface MyNSWindow : NSWindow
@end

@implementation MyNSWindow
- (id)initWithContentRect:(NSRect)contentRect 
styleMask:(NSWindowStyleMask)style 
backing:(NSBackingStoreType)backingStoreType 
defer:(BOOL)flag {
    style |= NSWindowStyleMaskResizable;
    return [super initWithContentRect:contentRect styleMask:style backing:backingStoreType defer:flag];
}

-(void) setStyleMask:(NSWindowStyleMask)styleMask
{
    styleMask |= NSWindowStyleMaskResizable;
    [super setStyleMask:styleMask];
}
@end

__attribute__((constructor))
static void swizzleMeUp() {
    ZKSwizzle(MyNSWindow, NSWindow);
}

should work, assuming it is injected early enough before NIB creation (MIP does this, SIMBL doesn't).
 

zevrix

macrumors 6502
Oct 10, 2012
345
207
Objective-C:
__attribute__((constructor))
static void swizzleMeUp() {
    ZKSwizzle(MyNSWindow, NSWindow);
}

should work, assuming it is injected early enough before NIB creation (MIP does this, SIMBL doesn't).

That's interesting. Sure looks like it should work.

Only I still don't see the big picture (as I'm not familiar with MIP and can't dedicate any serious time to this yet).

I used ZKSwizzle in my own little plug-in for MacForge.

With MacForge, as you know, there was an app where users could add plug-in bundles.

What's the process with MIP? I know they have lengthy installations instructions on GitHub but it's not something that a regular user would even remotely understand. (I will, eventually, when I have time to read them carefully.)

As far as I understand, one has to build the MIP Xcode project, then run make to install MIP, then also run make to install each plug-in.

Or are there also any UI-based tools available for this process?
 

f54da

macrumors 6502
Dec 22, 2021
475
170
>There was an app where users could add plug-in bundles.

The app is just a GUI thing, really the only thing that mattered with MacForge/SIMBL is putting bundles with the right info.plist in the right directory (e.g. "/Library/Application Support/SIMBL").


>As far as I understand, one has to build the MIP Xcode project, then run make to install MIP,

make && make install is sufficient to install MIP according to them.

Once that's done, bundles are installed just as you would manually install them for MacForge/SIMBL - put them in the right directory (/Library/Apple/System/Library/Frameworks/mip/Bundles it looks like) with the right info.plist structure. Annoyingly they don't re-use the standard SIMBL structure, so you can look at their provided Alt-Zoom bundle for the right info.plist keys.

>then also run make to install each plug-in.

No, the part about running make to install the plugin is just to build the provided sample Alt-Zoom plugin. You would build your own plugins as you did for macforge/simbl, just taking care to use the right info.plist structure.

>UI-based tools available for this process?

Doesn't look like it, but I don't see why it's needed?
 

zevrix

macrumors 6502
Oct 10, 2012
345
207

ok thanks for the explanations. it all looks simpler now. hopefully, i can find time to deal with this in a month or so. maybe I'll be able to revive my MacForge plug-in (which, btw, disabled the annoying expand/collapse animations of NSOutlineView).
 

Adora

macrumors 6502
Original poster
Jun 30, 2024
345
137
Objective-C:
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>

@interface MyNSWindow : NSWindow
@end

@implementation MyNSWindow
- (id)initWithContentRect:(NSRect)contentRect
styleMask:(NSWindowStyleMask)style
backing:(NSBackingStoreType)backingStoreType
defer:(BOOL)flag {
    style |= NSWindowStyleMaskResizable;
    return [super initWithContentRect:contentRect styleMask:style backing:backingStoreType defer:flag];
}

-(void) setStyleMask:(NSWindowStyleMask)styleMask
{
    styleMask |= NSWindowStyleMaskResizable;
    [super setStyleMask:styleMask];
}
@end

__attribute__((constructor))
static void swizzleMeUp() {
    ZKSwizzle(MyNSWindow, NSWindow);
}

should work, assuming it is injected early enough before NIB creation (MIP does this, SIMBL doesn't).

Thank you. At least I got homebrew to run from any directory now and installed gobjcopy (whatever that is).

Now I need a "codesign identity" for the next step. How do I get that or self-sign?

And then I have to go into the MIP folder to install it. How do I get this folder? There is a folder on Github called MIP, can I just download that and put it anywhere?

Sorry, for the stupid questions. But I am really a noob with such things.
 

f54da

macrumors 6502
Dec 22, 2021
475
170
>Now I need a "codesign identity" for the next step. How do I get that or self-sign?

Good questions. I've always used ad-hoc signing (codesign -fs -) to get osx to shut up about code signing but it appears for this a proper self-signed cert is needed, presumably due to restrictions on M1 platforms. You can follow the procedure in https://stackoverflow.com/a/27474942 to create the cert from keychain utility and use the name of the new cert (e.g. "my-new-cert") as the `SIGN_IDENTITY`

>I have to go into the MIP folder to install it. How do I get this folder? There is a folder on Github called MIP, can I just download that and put it anywhere

Yes you would have grab the repo. The folder itself can be anywhere, since `make` just builds the libraries/binaries and places its output in the same folder. `make install` is what copies over the built libs/binaries to the correct destinations.

If you don't already have experience with such things, I would recommend waiting for @zevrix to experiment with it first.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.