• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to avoid deactivation of window below utility window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to avoid deactivation of window below utility window


  • Subject: Re: How to avoid deactivation of window below utility window
  • From: Quincey Morris <email@hidden>
  • Date: Sun, 9 Mar 2008 19:07:09 -0700


On Mar 9, 2008, at 12:09, Peter Hoerster wrote:

I have a background application which displays a floating utility window on request via hotkey. If the user clicks any item in my window, the window of the formerly front application gets deactivated. This is unfortunate because the utility window should do something in the other programs window.
If however the command-key is pressed, then the window below stays in active state, exactly the way I need it.
Under Carbon the behavior of utility windows is different. You can click it and the other programs window never gets activated without the need to hold the command-key.
If I set [self setIgnoresMouseEvents:YES]; in the init method of my window, then I can avoid deactivation, but unfortunately I do not receive the mouseDown events any longer.
Is there a clean way in Cocoa to make a globally floating utility window behaving the same way as a Carbon utility window behaves?

I think there's 2 parts to this. The other app's window may get "deactivated" because the app is deactivated, or because you panel is becoming the key window.


If you want activation of your panel to *not* bring your application in front of the currently active app, you need to make your panel a "non-activating panel". There's a checkbox for this in IB.

If you want want your panel to *not* become the key window when clicked, then send it becomesKeyOnlyIfNeeded:YES. You do that at some convenient time, like in the window controller's windowDidLoad.
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >How to avoid deactivation of window below utility window (From: Peter Hoerster <email@hidden>)

  • Prev by Date: How to avoid deactivation of window below utility window
  • Next by Date: NSLog goes to system.log, and it should not
  • Previous by thread: How to avoid deactivation of window below utility window
  • Next by thread: NSLog goes to system.log, and it should not
  • Index(es):
    • Date
    • Thread