Weird window behavior when using LSBackgroundOnly and status bar
Weird window behavior when using LSBackgroundOnly and status bar
- Subject: Weird window behavior when using LSBackgroundOnly and status bar
- From: Steve Moon <email@hidden>
- Date: Wed, 14 Nov 2001 07:13:23 -0800
Hi
can someone help me with this problem : my application is configured
with the LSBackgroundOnly option, and I noticed a weird behavior with
all the windows of my app. One menu of the the status item is configured
to show up the preferences window (not a panel in case it make a
difference) and the code to show up the pref window is :
-(void) displayPreferenceWindow:(id)sender
{
// Step 1. activate the app
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
// Step 2. show the pref window
[preferenceWindow makeKeyAndOrderFront:self];
}
I noticed that when this code is executed the pref window show up but
sometimes instead of becoming the top visible window, it show up behind
the main window of the previous active application (for example if I was
using Terminal and choose to show up the pref window, it will end up
appearing behind the terminal window)... And another thing I noticed :
sometimes the window appears correctly as the top visible window but as
soon the 1st click occurs in the title bar then the window resign to be
the key window. I can see that by implementing :
- (void)windowDidResignKey:(NSNotification *)notification;
Is it a known problem inside AppKit ?? Is it due to the fact that my app
is configured with LSBackgroundOnly (when I remove this feature the app
work as expected) ?? Any easy workaround ?
Steve