45 ms·
Moving a macOS window by clicking anywhere on it
- markstos 4y agoI use the feature with the Sway window manager for Linux. With Sway, you can move floating windows like this, and you can also resize or move tiled windows by clicking anywhere in the window while holding down a key.
- Jiocus 4y agoYes, and i3wm from which sway was modelled from. KDE Plasma also has the same functionality from the default keybindings (mod+lclick to move, mod+rclick resize)
- idle_zealot 4y agoSway and i3 stand out to me as “correct” window managers. You get the upsides of tiling (windows don’t occlude one another, no fiddling with exact window placement) but without the typical cost of memorizing loads of keyboard shortcuts (though key combos are still an option). It’s so intuitive to drag around and resize windows with the little preview outlines showing where the window will end up when you release it. I wish the paradigm were more popular; once you’ve tried it going back to floating windows on macOS or the like feels laborious, even with 3rd party tools. I even feel like some simplified version would work great on touch devices like iPads. It wouldn’t be that different from SplitView, other than supporting more than two windows.
- throwaways85989 4y agoCan we talk for a moment about how horribly well hidden these shortkeys are for normal users? Why not blend in a shortkey-tooltip when dragging a window around normally using the title bar? Make stuff discoverable again?
- aequitas 4y agoThis would just be annoying when you reinstall or use a new machine, like going through a tutorial section when playing a game for the second time. Or you would end up with Clippy.
- throwaways85989 4y agoIt would be just text, and you could deactivate it on pro-user behaviour detection.
- Tagbert 4y agoI don’t know where “clicks” like this are documented, but keyboard shortcuts are well documented. (If you know where to look or search.) Keyboard Shortcuts https://support.apple.com/en-us/HT201236 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/ https://www.mediaatelier.com/CheatSheet/
- nikolay 4y agoLike moving it accidentally clicking on the chome was not enough! This is the worst feature of macOS - a windows should be moved only by dragging on an obvious area like the title bar. Sometimes I just want to switch the focus and click on a window and it accidentally moves in a random direction by a few pixels!
- WhyNotHugo 4y agoI never figured out how to easily move windows on macOS. How I know why; it's disabled by default and you also need to hold down `Ctrl`.
- lwkl 4y agoAre you sure you are talking about moving them? Because you can move them by grabbing them by the title bar and dragging them to the spot you want.
- yebyen 4y agoThe title bar is small and it gets smaller every time our resolution gets higher. In Linux window managers, alt+click anywhere in the window and drag has been a standard way to move windows with or without handles since probably two decades, I know it doesn't seem like much but this is a major "creature comfort" thing for me, a Linux expat now using mostly MacOS.
- Etheryte 4y agoPersonally I use Spectacle [0] and a few handy shortcuts to move and resize windows. For me, it's just enough customization without going over the board with scripting a window manager from scratch. As I just discovered, Spectacle is no longer actively maintained, but it still works just fine. The recommended alternative from their readme is Rectangle [1]. [0] https://github.com/eczarny/spectacle https://github.com/eczarny/spectacle [1] https://github.com/rxhanson/Rectangle https://github.com/rxhanson/Rectangle
- gkkirilov 4y agoIs there similar for windows? I know there was 3rd party solutions with alt+ click
- layer8 4y agoNot exactly the same, but Alt+Space, M (selecting Move from the system menu) also moves the mouse pointer to the title bar so that you can immediately use the mouse to drag from there (or alternatively move the window using the arrow keys, of course). Slightly related, I always use Alt+Space, C to close windows, as I find that easier to press than Alt+F4.
- artificialLimbs 4y agoAltdrag https://stefansundin.github.io/altdrag/ https://stefansundin.github.io/altdrag/
- FranklinMaillot 4y agoInteresting, but the latest release dates back to 2015!
- deleted 4y ago[deleted]
- RobertRoberts 4y agoMy mac users feel the exhaustion of micro managing windows but don't know what causes the drain until I show them a better way [1]. [1] https://rectangleapp.com/ https://rectangleapp.com/ (I add this to all the Macs I touch)
- deleted 4y ago[deleted]
- mckjns 4y agoI highly recommend Swish as an alternative to Rectangle. Recently discovered it and wouldn't go back. The main thing that sold me is the ability to resize two windows by dragging the divider between them (similar to how Windows works). https://highlyopinionated.co/swish/ https://highlyopinionated.co/swish/
- RobertRoberts 4y agoThis looks neat, but it only seems to be useful for touchpads, which is the vast minority of users. And while it's not expensive, it's also not free. Any software I have to manage with an extra license is an added time burden. (even if minimal, it adds up)
- ubercow13 4y agoDoesn't seem very useful if you use your Mac with a normal mouse though.
- mckjns 4y agoI don't utilize the touchpad gestures at all. It provides a full set of keyboard shortcuts.
- spike021 4y agoI use Magnet [1]. Works really well, hot keys mostly make sense for various settings. [1] https://magnet.crowdcafe.com/ https://magnet.crowdcafe.com/
- 4y ago
- tambourine_man 4y agoThis looks to me like some experiment with touch enabled UI on the Mac by Apple.
- unicornfinder 4y agoI suspect as of Big Sur that Apple were intending to release touchscreen Macs, but the changes to the OS in future versions makes me suspect that they then changed their mind.
- newaccount74 4y agoI think Apple prepares for a lot of eventualities internally and only some things end up being released. Eg. they built macOS X on Intel years before they announced the switch. 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.
- hirvi74 4y agoI've read articles about Apple patenting various technologies that would facilitate such a device, but obviously past patents != future plans.
- tambourine_man 4y agoThat’s my guess as well. Lots of hints on touch enabled UI in Big Sur. But whatever it was, seems to have been delayed or suspended.
- eyelidlessness 4y ago> they built macOS X on Intel years before they announced the switch. 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.
- memetomancer 4y ago
- iwebdevfromhome 4y agoI use the kinda hidden three finger dragging gesture that you can activate like 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.
- nicwolff 4y agoThat's not the same at all, you can still only drag the move bar – and it focuses the window, bringing it to the front. Moving and resizing background windows can very handy.
- incanus77 4y agoI always turn this on as well, but yes, it doesn't allow different moving of windows.
- mistersquid 4y ago> Moving and resizing background windows can very handy. 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?
- toomim 4y agoYou can move (or do anything to) a background window without focusing it by holding `cmd` while clicking or dragging.
- eevilspock 4y agoTHANK YOU!
- ugh123 4y agoI just tried this and it should be warned that this resets existing "three finger drag" (for mission control and switching desktops) to "four finger drag". This took me a while to figure out after thinking something was seriously broken, even after going back and disabling the new setting you mentioned.
- nicwolff 4y agoWish you could change the key combo for this, I've been using a long-abandoned tool called Zooom2 to do this with `fn` (and `fn` + `control` to resize`) and fear losing it on my next Mac if it's an M1.
- brandonhorst 4y agoYou can do exactly this with BetterTouchTool. You can also set it up with Hammerspoon.
- mistersquid 4y ago> You can do exactly this with BetterTouchTool. Zooom2 allows for moving/resizing of background windows. Last I checked, BetterTouchTool window manipulation required clicking the window which brings it to the front.
- dbalatero 4y agoThis free Hammerspoon plugin will also resize background windows: https://github.com/dbalatero/SkyRocket.spoon/ https://github.com/dbalatero/SkyRocket.spoon/
- evan_ 4y agoIt's actually configurable in BTT whether you bring the window to the front. You don't need to click, just hold down modifier keys.
- urbandw311er 4y agoI do this all the time via BetterTouchTool. Don’t know where I would be without it.
- nico_h 4y agoUsing an M1 right now and Zooom/2 still works.
- mistersquid 4y ago
- cheerycar 4y agoHyperdock is one of the best purchases I've ever made. It allows you to assign hot keys to window management - e.g. 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. https://apps.apple.com/us/app/hyperdock/id449830122?mt=12 https://apps.apple.com/us/app/hyperdock/id449830122?mt=12
- david-cako 4y agoYou can also move macOS windows by dragging the border along the opposite axis, with no configuration.
- copperx 4y agoAlong the opposite axis? Can you elaborate?
- aeyes 4y agoDrag the left or right border of a window up or down.
- Etheryte 4y agoIf you grab the right-hand edge of a window, you can drag it left or right to resize the window. However, if you instead drag it up or down, you can move the whole window.
- adamomada 4y agoAnd if you hold option (alt) when dragging left or right, it will mirror the drag on the opposite side, so you can quickly expand or contract the window size
- dymk 4y agoThis is incredible, thank you for posting this. 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.
- oneeyedpigeon 4y agoWait... you can actually maximise without going full screen? I thought Apple would never back down on that - I use a third-party app to do this usually. If there's a similar thing to let me make a window full height and half width, and to center a window, I can get rid of that app altogether...
- tgbugs 4y agoI've had `OnWindow Mod1 Mouse1 :MacroCmd {Raise} {Focus} {StartMoving}` in my fluxbox keys config for a decade or so? My brain will automatically issue and alt-click on a window in some other OS and I'm always jolted back to the reality that I'm not in my usual window manager. Now if only I could rebind that cmd ctrl on macos to alt.
- spurgu 4y agoI've used Easy Move+Resize[0] for this and configured it to Alt+drag windows (like most Linux window managers). [0] https://github.com/dmarcotte/easy-move-resize https://github.com/dmarcotte/easy-move-resize
- blueberrychpstx 4y agoAnother question - I've looked before for any documentation on building tools for Mac, and can't really figure out anything besides "run this xyz app to trigger an AppleScript and do magic". Does anyone know of any Swift APIs for interacting at the level of the OS itself?
- lelandfe 4y agoscriptingosx[0] is a great resource, here's a simple Swift command line tool they wrote that might be a good reference: https://github.com/scriptingosx/desktoppr https://github.com/scriptingosx/desktoppr [0] https://scriptingosx.com/ https://scriptingosx.com/
- philsnow 4y agoWould Hammerspoon fit your use case? It lets you write lua to interact with all kinds of system APIs. It's roughly the first thing I install on a new mac.
- bobbylarrybobby 4y agoIf you want to put together keyboard-shortcut-triggered automations on a Mac without any third party software, I think you have to create an automator service and then assign it a shortcut in System Preferences > Keyboard > Services. 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.
- FranklinMaillot 4y agoI don't understand how MacOS is constently praised for its UI while half the comments here mention a third party app just to make it usable. Maybe it's just me, but I owned a Mac for over 5 years and I could never wrap my head around how MacOS handles windows and open apps.
- throwk8s 4y agoAll depends on what one is used to. On Linux I've had to fight with window borders so narrow by default (on whatever Ubuntu Studio uses) that they practically couldn't be resized. You had to aim at like one pixel. I read somewhere that a window could be resized by holding Alt and clicking with the middle mouse button... but on a Mac you never need to hold down keys and have a three-button mouse to do something that basic.
- bmitc 4y ago> but on a Mac you never need to hold down keys and have a three-button mouse to do something that basic 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.
- david422 4y agoUgg, I hate that. On Mac OS as well. Windows 8 had something like a 10px border that looked great. Tried to do the same on linux - modify some defaults - and it worked for a while until... it stopped working and I haven't been able to fix it. 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.
- cuddlybacon 4y agoBecause those like me who don't install any of those apps don't have anything to share on HN. Showing that you have a nearly default desktop isn't interesting except when people are claiming that no one does that.
- whydoyoucare 4y agoI don't need dragging as all my windows are full screen. :-) That said, this is a pretty neat trick.
- WaltPurvis 4y agoIs this the default on Monterey? This behavior is enabled on my system, but I'm 100% sure I've never executed the terminal command from the linked article.
- adamomada 4y agoI just tried it on a stock machine and it is not. Do you have any third party system utilities on yours? Or are you clicking near the (larger) title bar area?
- daenz 4y agoI've enabled this "grab" feature on every Linux window manager that has supported it. Hold alt or the windows key, click, move. Simple usability improvements make a world of difference, but for some reason, they are uncommon.
- black_puppydog 4y agoJup, and Alt+Rightclick for resizing.
- vlunkr 4y agoI just discovered recently that you can do this in i3, it's a game changer. It's much better than trying to click on tiny borders.
- millzlane 4y agoThe fact that Alt+right click context menu works anywhere in any window was a godsend. Next best thing to close a program without moving your mouse anywhere.
- neotod 4y ago
- itomato 4y agoIIRC, this is standard xlib behavior since the 80’s.
- HeckFeck 4y agoThis + mouse to focus. Give it a week and you'll never go back. Even Windows has a hidden "mouse to focus" mode it calls X-Mouse.
- tedunangst 4y agoNone of window manager behavior is implemented in xlib.
- 4y ago
- tokumei 4y agoAwesome! Really missed this behavior when Linux and tiling window managers were my daily driver.
- michaelsalim 4y agoOn linux, this is something I use every single day. It's awesome! 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
- jakswa 4y agoon gnome 42 it is middle click! you drove me to experiment, thanks
- calvinmorrison 4y agoanyone not using focus follows mouse is living in the past!
- rzzzt 4y agoAlwaysMouseWheel supports Alt+dragging in Windows (I initally used it for its primary feature on 8.1, which is sending scroll events to the window under the mouse pointer): https://www.softwareok.com/?seite=Microsoft/AlwaysMouseWheel https://www.softwareok.com/?seite=Microsoft/AlwaysMouseWheel
- wnolens 4y agoI use https://rectangleapp.com/pro https://rectangleapp.com/pro and really enjoy this app (I paid for it, it gets a lot of updates/fixes). 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
- grn 4y agoI didn’t realize there’s a pro version so thank you for posting this. I’m going to give it a try and will pay happily if it improves my workflow.
- eligro91 4y agoI'm using Spectacle for 5-6 years.. I see now that it's no longer maintained, and Rectangle was developed based on Spectacle.
- iNerdier 4y agoNews to me. I’m still happily using it and haven’t really seen any reason to stop.
- chadparker 4y agoHummingbird is another tool that does this. https://github.com/finestructure/Hummingbird https://github.com/finestructure/Hummingbird
- maxwelldone 4y agoI'll throw another option: https://magnet.crowdcafe.com/index.html https://magnet.crowdcafe.com/index.html 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.
- mdavis6890 4y agoI find it so strange how resistant people (not you!) are to paying trivial sums of money for things that contribute so much value. 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.
- lesgobrandon 4y ago
- Bondi_Blue 4y agoI thought this was fairly well known with respect to the defaults customizations. There is a repo here: https://macos-defaults.com/#-what-s-a-defaults-command https://macos-defaults.com/#-what-s-a-defaults-command ...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/9804183f242991007b316a59c4ba5e5a https://gist.github.com/romanhaa/9804183f242991007b316a59c4b...
- qiller 4y agoI wish there was a feature or an app that would prevent moving and lock windows in place instead of this. 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
- amelius 4y agoTitle should say "by cmd+ctrl+clicking anywhere on it"
- rland 4y agoMacOS is full of these UI "tricks" that remain undiscovered by 99% of users because they are: - 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.
- ihuman 4y agoThat Wi-Fi button truck also works with the volume and Bluetooth buttons. You can also quickly toggle focus mode by option clicking on the time (or the Notification Center button)
- leipert 4y agoOption clicking the menu in some Apps like Mail or Safari brings up „secret“ menu items as well. (mainly for debugging)
- mrguyorama 4y agoMeanwhile on Windows, the same functionality for choosing which output you want to use is accessible by just clicking the dang volume icon Why does MacOS hide such a useful feature behind an obscure trick?
- zuhsetaqi 4y agoIt’s also a normal click in macOS to change the output device. Option + Click is only needed when you want to change the input device without changing the output device
- robertoandred 4y agoWhat? Just clicking on macOS's volume icon lets you change the output.
- 4y ago
- stdohm 4y agoSomething I use all the time to handle applications which might have multiple instances opened at once. For example, web browsers. 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.
- robertoandred 4y agoOpened windows, not instances. There's only one instance of the application running.
- aequitas 4y agoYou can also use cmd-` (the `/~ button between shift and z on my keyboard, left of 1 on others) to switch between windows of the currently activated application.
- randomluck040 4y agoThere is an open source application called „AltTab“ that basically brings the behaviour of Windows‘ app switcher to macOS
- herunan 4y agoFinally some hacker news.
- edgyquant 4y agoMy biggest complaint about MacOS is that I use multiple screens. When I swipe from one window to another on a single screen it focuses on the other screen which caused a lot of frustration.
- deleted 4y ago[deleted]
- soheil 4y agoI wonder how interactive elements inside the window that respond to drag events are affected.
- abotsis 4y agoI’ve used apps for years to get this functionality. Great to know. Between this and enabling more emacs-ey keybindings has made life so much better.
- egypturnash 4y agoI shudder to imagine how badly this would interact with most art apps.
- nebben64 4y agoCan you enable this but instead of the CMD+CTRL+Click, make it so it does this on force click ?
- AprilArcus 4y agoBy default, command-click enables "focus follows mouse"-like behavior, allowing you to manipulate the widgets of background windows without bringing them to the foreground.
- throwanem 4y agoTIL. Thanks!
- asn0 4y agoTIL about Alt-dragging windows in Linux!
- LoveGracePeace 4y agoSame here, this is actually cool!
- halayli 4y agoI use zooom2 which is no longer maintained but it allows me to drag/resize windows while holding cmd+shift, option+shift. A feature that existed in windowmaker since the 90s.
- mzmzmzm 4y agoThis really should be a standard feature, everyone seems to have their own window manager for Mac desktops. I use an app called Window Mover that's so old the developer and dmg can't be found anywhere online, but it still works flawlessly on Monterey! Much more minimal than some of the populat apps so I keep the package handy. Using other Macs I'm struck by how clumsy it is not to have global window drag to move or resize. Fn is my favorite modifier since it so rarely interacts with the cursor (unlike other mod keys when using eg Photoshop).
- bezospen15 4y agoWindows has had this for 2 decades
- deleted 4y ago[deleted]
- gmas 4y agoso brave
- sandebert 4y ago(I posted about the same for Windows a day or so ago: https://news.ycombinator.com/item?id=31257779 https://news.ycombinator.com/item?id=31257779)
- leobg 4y agoAnyone know a tool it will automatically arrange all open windows of an application so that they are all of the same size? I often have many open Finder windows, and then arrange them manually on my screen to fill the available space.
- jmole 4y agothis would go great with the otherwise useless force-touch (or hard-press?) gesture
- DavideNL 4y agoOn my Macbook/Trackpad I use 'Enable dragging > without drag lock'. The best setting i've ever found in macOS, it takes a little getting used to but it's so much better; ' > 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.
- ivanmaeder 4y agoI use the same setting but with the "three finger drag" option. 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.
- DavideNL 4y ago> It also lets you select multiple whole words 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.
- farmin 4y agoI am windows user since windows 95. But it has slowly become a mess since it's peak at Windows 2000. I am currently testing macos. I bought a Mac mini. First thing I learned is that my existing monitor just won't work perfectly cause it is not retina and second there is not easy way to click windows in place!! So now I need to buy very expensive monitor or just get an imac and install a 3rd party app to manage windows. Hmm. I will still do these things. The rest of experience has been good.
- jondlm 4y agoI'm surprised no one has mentioned https://github.com/koekeishiya/yabai https://github.com/koekeishiya/yabai -- it takes a little work to setup but it's well worth the effort. It's keyboard centric and auto lays out windows nicely.
- ghilston 4y agoI'm not a big OS X user, and I'm unsure if sharing my own blog post is allowed, but combing skhd with yabai changed my entire workflow on osx. 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-x/ https://www.greghilston.com/post/tiling-window-manager-on-os...
- president 4y agoThis method doesn't allow customizing the keys. Best app for this is https://github.com/finestructure/Hummingbird https://github.com/finestructure/Hummingbird.