Moving a macOS window by clicking anywhere on it
mmazzarolo.com
mmazzarolo.com
It mostly takes care of snapping and resizing windows with hot keys, but has a less obvious feature in preferences to use mouse.
My setup is: CMD+SHIFT will move any window under mouse pointer CMD+SHIFT+CTRL will resize any window under mouse pointer
I bought it in '17 for $1 - possibly the best dollar I've spent. Looks like it's $4 now. Coupled with a QMK keyboard, the modifiers are even easier to use.
It was $1. Now it’s $4! Like half a Starbucks coffee!
How many people would not even see this app because it’s not free?
And how about the one commented below that “looks like it’s no longer maintained?” Sounds like it’s the free choice…
I have been guilty of agonizing over spending $5 on a phone app while drinking a $5 cup of coffee.
Now I’m at the point where I don’t even want to look at free apps. Just tell me how to pay you enough money to make something good, and keep it good over time.
Couple years ago I was working on a side project that touched upon what you said. The core idea was dead simple: you make a list of things you want to buy or do, along with the price. And, every time you feel like spending money on something that's either excessive or not really necessary (like a $5 coffee), you enter how much you saved. The app will then show, for each item in your wishlist, how close you're to it's price. Imagine a progress bar, inching toward the goal. Along with few other stats to encourage saving (but not to a crazy extent; we gotta live a little too).
I still have the codebase with some APIs ready. Wonder if I should just complete it and launch. I called it WIYS (What If You Saved)
Anyway, I think with software, a combination of necessity, choice & culture plays an crucial role in making people pay. For instance, I badly needed a window manager, so I'd have even paid $50 if there were no viable option. These kinda apps are tricky; if it's simple, the market will be flooded with options. If it's niche & the problem domain isn't a showstopper, people may not care. Also, we enjoy the benefits of so many open source s/w, and I think it creates a subconscious expectation to get everything for free - or at least to hunt for free stuff, even via piracy. While I still have traces of that mindset, these days I value my time more than money, especially if the cost isn't too much.
I almost never think about spending those amounts on those things, so for anything that gets potentially more than one use it's a no-brainer.
Of course, im not on a student anymore.
I have paid for dozens of utilities & apps that I now longer use. Why? Because there's no more room in my head? Because even the minimal effort to keep stuff running seems like a poor ROI? Because after a while, every thing looks the same?
I dunno. It's too bad though.
That being said, reading this thread I’m realizing how many great options there are for these kind of scenarios on macOS.
https://appleinsider.com/articles/21/12/04/how-to-speed-up-w...
There aren't built-in keyboard shortcuts, but you can add a keyboard shortcut for any menu item, including these:
https://support.apple.com/guide/mac-help/create-keyboard-sho...
There's a preference to make double-clicking the window titlebar fill the screen instead of minimizing. And you can add a keyboard shortcut for this too:
https://apple.stackexchange.com/questions/372719/maximize-wi...
For ages, I used Amethyst, which is a "tiling window manager" for macOS, but somewhere along the way it got annoying to install/keep working properly due to some of Apples shenanigans.
So I moved to Magnet. I still use it daily, but honestly forget its there because I use it so much! Just feels like native macOS behaviour at this point.
It’s a paid app too, but it was worth every cent. The app was updated for free since my first purchase ten years ago!
Can't really use OSX without it.
I currently use Hyper + Arrow<Direction> for TRBL placement but it doesn't let me configure Hyper + two arrow keys for corner placements. Is that something not possible with the free/OSS version?
That's why tons of people don't realize there was a "Pro" option- because there wasn't one.
The creator (who also made the free open source Spectacle-fork Rectangle app) renamed/rebranded Hookshot into Rectangle Pro sometime about 5 months ago.
I also like Witch for window/app switching. I just wish it was a little less sluggish to activate:
I'm very surprised they don't distribute these tools among Windows, now that they are matured.
PowerToys name also brings a lot of good old memories :)
When plugged into my large monitor, I have hotkeys set up to put a window on the left 1/3, the middle 1/3, and the right 1/3. It is so unbelievably useful.
Also when doing multiple monitors, if you do a Divvy hotkey it will move the current window to the monitor your mouse is in. This makes moving windows so fast.
I use a 55in oled screen as my main monitor and rectangle is fantastic for grid window management. CMD+(1,2,3,F1,F2,F3) to move windows around the grid etc
A few things I've discovered after playing with this for a few minutes:
It works for the corners too - option+drag the corner of a window, and the whole thing resizes symmetrically.
Hold shift and it preserves the aspect ratio of the window
Double click + holding option on an edge will expand both edges to full screen size
You can hold and release option / shift while dragging and it'll work as you'd expect.
Double clicking on an edge will cause it to expand to the edge of the window. The shift + option trick doesn't just expand to the first edge it hits, it looks like both edges expand as much as possible.
So when combined with double clicking on a window corner, that makes all for edges expand to display size (even if the window was partially off the monitor).
BUT, option + double-clicking any window corner will actually make even a Finder window take up the whole visible space of the screen without being "maximized" (without creating a new screen / workspace).
(double-clicking any corner will make the window expand all the way towards the corner you've clicked; if you have a finder window in the middle of the screen and you double-click the NE corner, it'll get bigger in the N and E directions until it hits the menu bar + the right edge of the screen.
similarly, double-clicking any edge will make the window expand all the way to the border of the screen in the direction of the edge you clicked, and option + double-clicking an edge makes it grow both in that direction and the opposite.)
completely undiscoverable, I feel like I'm lost while Maniac Mansion, just trying every possible Verb + Object (+ Indirect Object) combination to try to read the game dev's mind.
I just found out that Apple has a pretty neat guide on all of this [1]. That you can find by googling or searching the builtin system help. I never looked at the system help before, but it looks like Apple did a good job documenting these features. Maybe I should start to RTFM for my OS...
I still agree on the discoverability part but I can't think of a way that would be better. It makes sense that there isn't a button for these commands, but if there isn't you need a manual or a tutorial and who is going to look at these? Maybe someone smarter has a better idea on how to solve this.
[1] https://support.apple.com/guide/mac-help/work-with-app-windo...
> I still agree on the discoverability part but I can't think of a way that would be better.
In Emacs, C-h m runs `describe-mode` which goes through the major mode of the current buffer and all the currently active minor modes, and puts their descriptions and all the mode-specific key/mouse bindings into a new Help buffer.
It would probably be incredible overkill, but I'd adore an overlay view in macos where each screen widget / distinct region had an outline or different shaded color overlaid on it, and when you hover each widget it shows you all the "keymaps" / event bindings for it. Give me all the knowledge; I use Emacs by choice for crying out loud.
OMG THANK YOU
This is amazing. Over a decade using OSX and I never knew this
It's all very clever and elegant and minimal but consumer technology user interfaces seem to be converging on that of a Theremin.
What I really miss is having the time free to peruse a manual like that.
>Touch and hold the Space bar with one finger until the keyboard turns light gray.
>Move the insertion point by dragging around the keyboard.
So the problem is more that OP doesn't read manuals rather than them not being as good as they once were.
At some point you just have to admit that there is realistically nothing more that can be done. Users don't want to read the manual because they can use their phone perfectly fine without it. They might not notice there is a nicer way to move the cursor but it doesn't really matter.
There is a manual and it comes preinstalled as an app out of only around 10 apps on the default screen and yet people still complain about the lack of a manual. I really don't know what they could do other than locking the phone until the user completes a quiz on the manual content.
You can zoom with one finger. Double tap and hold, then move you finger up/down to zoom in/out.
Apparently you've able to do this for 5+ years or something. WTF
My full workflow for using this is triple click power key to bring up accessibility shortcuts, press assistive touch and then tap on the circle icon to bring up the bar. You can drag it around by dragging the middle and if you drag either bar end it does the “pinch”.
I put smart invert for pseudo dark mode and zoom in the other two accessibility shortcuts to round out the accessibility shortcut menu.
It does work on iOS but seems app-dependent. Works in Apple Maps, doesn't work in Photos.
Says something about discoverability when it seems like I need to RTFM for gestures again.
But for the rest of the world, it's not. My mom can't use an iphone or android phone, because they cater too much to... the young? the rich? tech? geeks?
beats me... and I am a dev of > 30 years, that spends more of my time in front of my computer, than almost anyone I know. I love computers and tech, but am amazed that things have not become easier.
They are harder now then they ever were.
But having said that, Macs are all I've used for the last 10 years, because they seem, overall, better than any other OS I've used.
The scroll bar is also sometimes a nice visual cue to the size of a document you've just opened for the first time, again something the wheel/gestures don't necessarily inform.
I have permanent scroll bars enabled in macOS too.
I loathe the modern trend towards hiding all scroll bars everywhere because of this.
1. Choose Apple menu > System Preferences, then click Accessibility. 2. Select Pointer Control in the sidebar. (In earlier versions of macOS, select Mouse & Trackpad.) 3. Click the Trackpad Options button. 4. Select ”Enable dragging,” then choose ”three finger drag” from the menu. 5. Click OK.
I didn't notice moving and resizing background windows is enabled by the OP writeup and am not in a place where I can implement changes.
Does
defaults write -g NSWindowShouldDragOnGesture -bool true
in fact enable manipulation of background windows?http://hea-www.harvard.edu/~fine/OSX/unicode_apple_logo.html
Sadly, it's supported less and less in Apple's own apps:
- if you use the gesture in Finder, it can get confused and mess up all mouse clicks
- it doesn't work at all with the sliders in the new control center menu
Give it a week and you'll never go back.
Even Windows has a hidden "mouse to focus" mode it calls X-Mouse.
...but it is missing a lot of them, which are scattered across the internet. Some others worth checking out are aggregated here:
https://gist.github.com/romanhaa/9804183f242991007b316a59c4b...
alt-left-mouse: grab anywhere in window to move
option-command-left-mouse: resize window from anywhere in window
Hasn't been updated in years but it still works on Monterey though it occasionally requires some kicking. I've looked for alternatives that are more up to date but can never find one that does the above - it's really all I want in a window manager as I don't like automated tiling and other features.
It's quite possible someone is working on making macOS touch-screen capable, even when they don't have concrete plans for releasing a touch screen Mac.
Lots of hints on touch enabled UI in Big Sur. But whatever it was, seems to have been delayed or suspended.
Not a correction, just adding context: Mac OS X always had Intel builds, even before release. It would be surprising to me if they don’t still maintain Intel macOS builds just in case.
...so I would assume there is plenty of maintenance being done on x86 macOS.
(I confess that personally, after a couple years of trying to make an iPad my main mobile device—and getting pretty good at making it do what I want, learning how capable iPadOS/iOS really is—I’ve retreated to my original circa-2011 understanding of “Macs are computers, iPads are appliances.”)
(I add this to all the Macs I touch)
"This project is not being actively maintained... Spectacle users have recommended Rectangle as an open source alternative."
This is actually how I found Rectangle. :P
My issue is that it's not efficient and I need to nudge some windows from accidentally moving them.
Haven't seen this in the thread: You can resize the window by using right-click instead of left.
This works on both i3 and KDE for example.
Mod+Left click = Drag windows around Mod+Right click = Resize window
Keyboard Shortcuts https://support.apple.com/en-us/HT201236
This is a great little tool that shows all of the keyboard shortcuts for an app when you hold down the CMD key.
Cheatsheet https://www.mediaatelier.com/CheatSheet/
That's really not true at all, even for that exact thing. macOS still has very small clickable areas for resizing a window. Unless an app has focus, you don't even get the little two-sided arrows. And apps that are in dark mode basically all blend together because macOS either has no borders or like 1 pixel wide since macOS relies on shadows delineating windows, which only works for windows that are primarily light colors.
But seriously - just make that configurable! Then everybody can be happy with their own settings. But no.... the new hotness is no usability for anybody.
Also I have many friends and family members who use macOS and I think none of them have third-party programs installed to modify the UI. So, you won't see them posting here about the extensions that they use.
And Raycast actually has the Rectangle functionality built in, although I prefer the separate app, there are some ‘defaults write’ values I can change on the command line that I like (to give me a wider bottom margin on my screen - I stick Silicio in the corner of my screen for instance.)
Give them both a go.
Two recent ones I can think of:
Issue 1 is: Shift+click selection doesn't work in Finder's Icon view.
To reproduce: In finder select the "icons" view. Click on the first item, Hold shift, and while holding shit then click on the tenth item.
Expected behavior is to select Items 1-10 including ten.
Workaround: Switch to list view.
Issue 2: Lock screen keyboard shortcut doesn't work when mission control is activated.
To reproduce: Open mission control via app or hot corner. Press Control+Command+Q to lock screen. Screen won't lock.
Workaround: Deactivate mission control view before locking screen.
Yea...it's dumb. But in the words of the late great Steve Jobs, 'don't hold it that way'. I get that apple is different. But sometimes it just seems counterintuitive.
I don't think that's a bug. The icon view does not have an inherent ordering, since you can just drag icons around. What is supposed to be the range to select if you have an unordered view.
Issue 2: Lock screen keyboard shortcut doesn't work when mission control is activated.
That looks like a bug. Interestingly, it does work on the new external Apple keyboards when you press the key that also has Touch ID.
There must be something special about the overview screen that is stopping all default behaviour when in this mode, the cursor keys don’t work here either.
It's been a few years since I've used OSX, but every version I've ever tried has this intentional bug. I say intentional because when I first got a mac in the 10.4 days I noticed that 'cut' was greyed out in the menu so I thoughtfully filed a bug report. To their credit they did answer the bug report several years later but they explained that they would not fix this as it is desired behaviour.
Baffling.
The benefit is that you don't have to decide whether you want to just "copy" or "cut" before you're ready to "paste", which makes a lot of sense if you're not coming from a Windows background. But yes, migrating from Windows to macOS makes this feel confusing.
If you want to copy a file in OSX with your mouse you use the menu bar whereas if you want to cut and paste (move) a file in OSX with your mouse then you use the two open windows method that you describe.
They are both very different and one isn't so discoverable.
What's the worst about this is that it's purely a choice and Apple intentionally greys out the cut option in the menu bar.
Madness.
In addition the UX research on direct manipulation vs select-and-operate seems to have shown that the mac made the right call, but the only work I've read in that area was done long ago.
This BTW is why shift-select doesn't work in icon mode (as a different commenter posted) because it was confusing for some people in a way that just drawing a selection for icons is not.
Its not consistent whatsoever.
OSX is a wonderful operating system - which is to say, it’s Unix but I can print things and use WiFi properly. I can edit a pdf, etc.
OSX is, in many ways, an absurd operating environment.
If you need any proof of this, just click the little green dot in the upper left of an open window…
It goes full-screen - isn't that an expected outcome?
Not exactly ...
First of all, for most of the life of OSX, clicking the green dot caused the window to resize larger, but not occupy full screen, by some measure I could never discern. That was always braindead.
Second of all, while the current behavior that I see (expand to literally full screen) is sort of an improvement (that is, at least it makes some sense) it's still badly behaved because bringing a window to literally full screen blanks out my other monitors (!@#) ... and now we're drifting into OSX treatment of multi-monitors which is another few layers of hell.
FWIW, IMO, the correct behavior is to maximize the window in the workspace - which is almost identical, but not quite, to the literal screen.
Really? That's not what it does for me. Right at this very moment I have a full screen app running on my MacBook Pro screen and a desktop on my monitor. Do you have "Displays have separate Spaces" turned off in Mission Control preferences?
I rather disbelieve in the idea that these things have "correct" semantics; only "what I am used to". At this point, I'm very used to the way macOS works and I find it considerably more pleasant than other windowing environments. Being able to full screen an app and then multi-swipe left or right between spaces or up for App Exposé is natural to me.
I've no doubt I could unlearn this and learn something else though.
I routinely have mail.app or Firefox fullscreen in one, with emacs or another browser window fullscreen in the other.
I found the article to be a little odd… awing at 3rd party apps basically replicating baked in features.
Although to be fair I am super meticulous in going through the accessibility and gesture features to get the UI feel just right for my tastes. MacOS, to me, feels like a clunker out of the box.
The “stoplight buttons” on windows are part of a very opinionated solution to window management that works from some people but is a complete mess if you don’t like full-screen apps. I would prefer if we had the option to convert the full-screen button to a maximize window button. Double-clicking on the window header is close.
The other thing that Windows users complain about it that closing a window doesn’t close the app. That one is just a confusion because they are used to how Windows windows. The Mac OS convention of keeping the app active is not wrong, it’s just a different approach and the kind of conceptual change that users need to make when they switch OSs.
Ctrl + Opt + Return is the only reason I have Rectangle installed.
- Respect for the user: macOS doesn’t show many confirmation messages, notifications, or ad-like things. Apple promotes products in the AppStore or shows you the usual “What’s new” during a new install. But, overall is very respectful, and that includes notifications about OS upgrades. By contrast, Windows is noisy. It asks for confirmation about everything, it has trial crapware in their home editions, and decides to install an OS update without asking in the worst possible moment.
- It just works (at least for the hardware I use). This is my main complain with Linux DEs. I know it improved a lot, but I still have memories of trying to make the Synaptic trackpad driver work or playing with xrandr to use multiple monitors during a presentation.
About the hidden shortcuts… well discoverability should be better. But, is also fun to discover those tricks.
If you ‘need’ a tiling window manager, MacOS is not for you, Apple is never going to add one and is only going to cripple attempts by third parties to do so.
You’re holding it wrong.
' > System Preferences > Accessibility > Pointer Control > Trackpad Options > Enable Dragging. > without drag lock'
It basically allows you to drag everything without 'force clicking' the trackpad. Instead you can now just 'tap twice + hold finger down' and drag.
It's similar but doesn't need a click to start the drag and another to end it. You just grab things with three fingers and move them; lift when done.
It also lets you select multiple whole words with the mouse: single tap quickly followed by holding three fingers and dragging.
Note that you can do this with "dragging > without drag lock" too: when tapping twice, just keep holding your finder down and then drag.
I personally find this much easier to use, compared to the "three finger drag". But to each their own of course.
Also, if i remember correctly, the three finger drag interferes with some other trackpad gesture related to app expose or something like that.
TLDR: use yabai to manage windows and skhd to bind key bindings to yabai commands.
https://www.greghilston.com/post/tiling-window-manager-on-os...
Press CMD-TAB to bring up the list of opened applications and then pressing UP or DOWN over a selected application to show the opened instances. After that use LEFT or RIGHT to select the instance you want to show.
Does anyone know of any Swift APIs for interacting at the level of the OS itself?
I know you asked about Swift, but...
If you're ok with third party software, I would recommend keyboard maestro. In addition to triggers (keyboard-based and others), it offers a pretty high level API over the macOS automation stuff you'd typically hack together with AppleScript, such as "activate app", "bring window at index i to front", "simulate keystroke", "insert text", "move the mouse to x,y relative to Element", "run JS in frontmost browser tab", etc. And that's only roughly 5% of what it can do.
With keyboard maestro I don't see much point in writing one's own native automation apps. The APIs it exposes are just as powerful as what you could write yourself and a heck of a lot easier to use.
Zooom2 allows for moving/resizing of background windows. Last I checked, BetterTouchTool window manipulation required clicking the window which brings it to the front.
Same, but Rosetta 2 won't be around forever. Dreading the day Zooom/2 stops working and I can't find a replacement that lets one move and resize background windows.
I don't want to use some app that could be abandoned and end up like the parent, this kind of configurability should be a core OS feature.
Oddly, on a latop its fine, I somehow have a different set of muscle memories for touchpads.
I acknowledge that I'm still young, but I feel like Apple is introducing changes at a good pace. UI elements and layouts have stayed consistent. [^1] Radical changes are usually confined to single apps, and if there is a f*up like Safari 15, they provide a fallback option and quickly revise their decision.
Providing endless backwards-compatibility only bloats the interface and makes it harder to learn for new users. The goal must be slow but steady progress, so that everyone can adapt.
[^1]: The best example is probably System Preferences: https://www.versionmuseum.com/history-of/mac-os-x
Muscle memory is not to be fucked with. Cmd vs Ctrl still gets me now and then, and even if it's rarer now, I can feel the cognitive context switch in my brain as I switch between devices. Sometimes it's better to play along even if you think you have a better way. Or at least offer the option (there is a time and place for spacebar heating).
On my new M1, I am using Hookshot (which apparently is now Rectangle Pro https://rectangleapp.com/pro ) – it has support for key combos to Move and Resize windows.
The only downside is that Hookshot/Rectangle focuses the window when you do this, which Zooom2 did not.
I am planning on adding some control into the UI for it, but no guarantees on a timeframe.
For example, Spark (email) annoys me cause you can drag the window by dragging the search box, so sometimes clicking that to focus causes the window to shift by a couple pixels
Slightly related, I always use Alt+Space, C to close windows, as I find that easier to press than Alt+F4.
- not obvious
- not discoverable
For example: if you hold option when you click the Wifi button, you actually can view a lot of information about the Wifi networks you are connecting to. This is invaluable when you're dealing with a Wifi issue, and completely undiscoverable!
I think MacOS is a perfectly usable operating system... If you're god and can somehow "just know" all of these hidden secrets.
Why does MacOS hide such a useful feature behind an obscure trick?
CMD + Shift + .
For menus you can even press the button while it's open to see the items that change their behaviour with the option key. And it sometimes extends to keyboard shortcuts. For example, for logging out you can use shift-cmd-q and you will get a window with a choice, holding option along will log you out directly. In the menu this is shown by having '...' or not.
And on the topic of windows, you can cmd-click the titlebar of a window that is not the front most one and move it around whilst keeping it in the background.
What percentage of users can actually make useful decisions based on the advanced WiFi info? Here's a screenshot for example: https://dl.dropboxusercontent.com/s/227iup97ivdaurw/Screen%2...
I suspect it's around 1%, and most of those 1% already know about the hold option trick (which works on many menus). I agree with you it's frustrating how this useful information is obscured, but I also think this is a reasonable compromise for Apple as they try to balance power with usability and simplicity for the sake of the non-technical majority.
In Android, Google often hides advanced functionality under overflow menus. These menus have a 3-dot icon (implying more menu options) or a settings gear, so most users will check them when the visible options aren't satisfactory. In recent Android releases, a lot of settings have clear and concise descriptions so users can understand their impact.
In Windows, Microsoft prefers to use a "properties" or "advanced options" menu, which also works well. If you can't find a desired option in the surface menus, you can dig into those menus.
Both of these approaches do a good job of offering more settings when needed while also warning users that the options can cause undesired effects. Android has clear settings descriptions so it's difficult to make a mistake, and when important settings like a debugging dump are triggered, will also display a clear warning about private information or breaking apps. Windows uses an "advanced" menu that can warn away "mom and pop"/novice users who could dig themselves into a hole. In both cases, there's some precautions to prevent users from mistakenly changing critical settings.
The builtin help and documentation on macOS is surprisingly good. Especially if you compare it to Windows. Today was the first day I looked at it. The last 10 years on Windows taught me that the help outside of technet and Office is useless and I assumed this is also true for macOS. I guess I was wrong and I should have read the manual.
How I know why; it's disabled by default and you also need to hold down `Ctrl`.
Because you can move them by grabbing them by the title bar and dragging them to the spot you want.