ptsochantaris / trailer

Managing Pull Requests and Issues For GitHub & GitHub Enterprise
https://github.com/ptsochantaris/trailer
Other
1.16k stars 67 forks source link

Position of trailer when menubar is set to autohide #320

Closed tomsturge closed 5 years ago

tomsturge commented 7 years ago

There is an issue with the position of the trailer menu when the menubar autohides.

This can be solved by moving the mouse away from the menubar but it would be nice if the trailer menu started in the correct position when it opens.

ptsochantaris commented 7 years ago

Hi @mrmohtas - this is a bit related to this issue which I created a while back: https://github.com/ptsochantaris/trailer/issues/228

The issue here is that macOS decides that, if you auto-hide your menubar, your usable screen height extends all the way to the top of the screen. Trailer just follows what macOS tell it (this also includes screen dimensions if the dock is at the bottom and hidden (or not))

This in a way makes sense, as I tried adding special compensation for showing the Trailer menu with an offset when the menubar is set to auto-hide, and while experimenting I realised that Trailer looks really bad after you move your mouse from the menubar and it just stands there like a detached rectangle with a space between its top and the top of the screen (i.e. where the menubar would have been had it now auto-hid)

I realise that some usage patterns may mean that the mouse will stay over the menubar and hence this weird effect won't occur. It may also be that in the future I may look into adding "tracking" to Trailer so that if the usable area of the screen changes because of menu or dock hiding/unhiding, Trailer can respond dynamically to it and not ending up in "limbo", but it's not on the immediate radar.

Instead could I tempt you to use a global hotkey? No need for slow mousing over menubars :) You can set it up from Preferences -> Keyboard, but be sure to give Trailer permission for it in System Preferences -> Security & Privacy -> Privacy tab -> Accessibility

tomsturge commented 7 years ago

I've seen different implementations of what you are talking about with Trailer standing out oddly once the menubar autohides.

Some menu apps I use either offset from the menubar with the space reminding when the menubar autohides (Fantastical, Droplr, Cloak), while other apps force the menubar to stay visible (flux, setapp, textexpander, all the native mac apps etc)

I do indeed have a shortcut setup for Trailer and many other app related things 👍

ptsochantaris commented 7 years ago

I suspect the apps that seem to force the menubar to be visible really aren't - they're just implementing their view as a menu rather than a window, so they're actually part of macOS's menubar UX - but happy to be proven wrong there if you have some API docs or a PR for this, I'm admittedly not an expert on menubar handling and I could be wrong about this :)

The other option, like you mention, is to introduce a fake offset on the screen space reported by macOS - I'm wondering if there is API to detect if the menubar is set to autohide. I'm guessing yes since I DID try this out a while back, but will look into this again in case there are better APIs around for Sierra.

tomsturge commented 7 years ago

I don't know swift but I might use this issue as a springboard into the language and try to dig in and try out a solution myself

ptsochantaris commented 7 years ago

👍 Although there's no need for a PR, I'm happy to look into it too if you can find any API-related pointers, whichever works best for you. That said, writing a little Swift is always fun :)