What API can be used to hide OSX Dock when you drag a window towards it

喜夏-厌秋 提交于 2019-12-14 04:18:53

问题


Idea is simple(stolen from Ubuntu): autohide Dock when you drag window toward it and begin to overlap it. Turn autohiding off and show Dock when window is moved out of area when Dock is located.
What API can be used to achieve that ?

update:
managing autohide possible from command line this way but it's horrible

defaults write com.apple.dock autohide -bool true
killall Dock

回答1:


Well, when the Dock is configured to (always) stay visible, the Window Manager will simply refuse to position the window directly under the Dock. It prevents users from putting stuff to where they can't reach. (Not every user is a power user; not every user knows the Dock can be hidden and since the Dock has no click-throughs...)

The system will hide the Dock when the app goes fullscreen. But, again, the system takes care of it.

Aside from directly mucking around with the user's Dock preferences (never change a user's preference for a third-party app behind their back!) like you mentionned; it can't be done legitematly.

There's is no API to control the Dock... at best, you can only suggest a tile to represent your app when present on the Dock.



来源:https://stackoverflow.com/questions/17131380/what-api-can-be-used-to-hide-osx-dock-when-you-drag-a-window-towards-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!