I'm making an app that covers the screen, so I have a window covering the screen completely, with its level higher than the main menu.
So I draw over the main menu, but I want the main menu to be accessible, still.
How would I do so?
IMHO it is probably best (and also MAS acceptable) to force your app to run in full-screen mode. That way the menubar will still display if the user hovers in its area but you get the benefit of using the entire screen.
Related
I want to achieve a certain window behavior for a macOS app. I subclassed NSWindow to be able to add additional properties. So far, it works well with almost all requirements (dragging it, clicking buttons) while preserving the core requirement of not making the currently active app losing focus. What does not work is making the window's UI elements react to mouse-hover events.
Requirements:
☑️ Don't activate the app when showing the window → _setPreventsActivation:true
☑️ Prevent activation of the app when interacting with the window (click/drag) → _setPreventsActivation:true
﹖Make the window react to mouse hover events over interactive UI elements without activating the app
An example of an application that does very much what I intend to do (UX-wise) is 1Password. Here is a short clip: An animated GIF showing 1Password UX
Can someone explain what they likely do to make their window behave this way?
I'm usually working with IntelliJ IDEA on MacOS in fullscreen mode. When I try to access something in the toolbar, I often overshoot the target a little, and the main menu bar opens instead, hiding the toolbar. So I have to move the mouse a little lower, wait and move carefully into the toolbar again. This is quite annoying. Are there any tips to avoid this? Is it possible to move the toolbar, say, to the bottom of the screen?
It doesn't seem to be possible at the moment, but there are 2 open requests you can vote for:
IDEA-119950 A setting in the settings area to stop 'show on hover' menu in fullscreen
IDEA-117034 Fullscreen menu bar is too eager to show
I have an application for Windows which is basically a toolbar on top of all windows.
Unfortunately, our users ask why does it overlap a fullscreen video playing in Google Chrome. Since the application works with no issues along with other fullscreen applications (such as games), it seems to be a pseudo fullscreen mode. How do we hide the toolbar in such cases?
Right now there is only one idea: keep an eye on MoveWindow, compare window class name against a predefined list and rectangle against screen size then deduce whether it is the 'pseuso fullscreen' mode. Any better ideas?
My Cocoa app displays a transparent window on the screen, but when the user tries to take a screenshot using Mac OS X's built-in screen capture key with the option of selecting full windows (Command-Shift-4, then Space Bar), my window gets highlighted as part of the possible windows to capture.
How can I tell my Window or App not to allow this? My Window already refuses to be the Main Window or Key Window through -canBecomeKeyWindow and -canBecomeMainWindow both returning NO, but this still happens.
The Window is also at the NSModalPanelWindowLevel and NSScreenSaverWindowLevel does the same thing.
Notice that every window is eligible for screenshots, even the desktop, dock and menu bar, which are special windows. You can even take a screenshot of the Exposé overlay window itself. This leads me to believe that there is no way to do this.
I suppose you could hook the Command+Shift+4 key event and hide the window, but that key combo is user-definable, so it is subject to change.
I would like to show the user a splash screen (a picture) while my Cocoa-based application launches. How would this be possible?
First thanks a lot. because my app running for a while time , so I want to show a splash before app running . Now if I show a window inside with a image , after that how to run the app? How to make sure that the app running after the splash showing ? How to do to get the sequence ?
First Thank you very much. And I show the window in applicationWillFinishLaunching method use orderFront,then hide it in applicationDidFinishLaunching: use orderOut,Now I found that the mainWindow not to show and the app terminate ,why ? How to do to resolute this question? Thanks!
Although Peter's answer is ultimately correct (you should rewrite your app to launch faster), sometimes that's not a practical option. For example loading code later in the application may take too long (e.g. a data acquisition application), forcing it to be loaded at startup. If you decide that you want to show a splash screen, the easiest way is to show it in the application delegate's applicationWillFinishLaunching: method. Create a splash window in your applications MainMenu.nib and add an outlet to your app delegate referencing that window. You can then put the window onscreen in applicationWillFinishLaunching: and hide it in applicationDidFinishLaunching:. Note that the main thread's NSRunLoop is not iterating during this time, so if you want to update the splash screen (with status, a progress bar, or such), you'll need to manage those redraw events yourself.
Again, think very hard about whether the long startup is necessary. If it is, showing a splash screen with a progess indicator is the minimum that you owe your users.
Why do you hate your users?
Seriously, don't do this. Don't make your users wait to use your app. Make your app launch quickly instead.
(And just in case you insist on an answer: Show a window with the image in it, then hide the window when you feel the user has waited long enough.)
Just put up a window with the image and close it when you are done with your launch initialization.
Barry's answer above does not seem to work for document-based apps. Showing a splash window within applicationWillFinishLaunching: interferes with the startup sequence of the app such that the document window isn't created. I've uploaded an example project here. In applicationWillFinishLaunching:, comment out [_splashWindow orderFront:self ] and the document window will come up.