Hi Doug,

> The change made by Eric in r31206 to call [NSApp deactivate] when a 
> WM_ACTIVEAPP message is received reporting that the app lost focus causes 
> trouble. I'll describe what I know about the issue.
> 
> In our application, if we have two editor windows open (call them A and B) 
> and minimize the one that has focus (say, B) then Windows apparently sends 
> this message even though the focus switches to window A (within the same 
> instance of the app). Window A then becomes the key window, but when we 
> restore window B by clicking on its tile in the task bar, it now becomes the 
> key window but leaves window A in a broken state such that after clicking in 
> window A you can make text selections there, but all keystrokes in window A 
> are now sent to window B!! Closing window A and reopening that document is 
> the only way to restore it to normal functioning.
> 
> I added an NSLog at the point where the new code calls [NSApp deactivate] and 
> found that it was called more than 20 times when I minimized a window. A 
> comment I read online suggests that WM_ACTIVEAPP is sent for every window in 
> the application. Perhaps that includes offscreen windows, because I only had 
> 3 or 4 windows open at the time. Since these messages are also being sent on 
> minimizing a window even when the app remains the active app it seems like 
> this isn't really working the way it should.
> 
> On restoring window B, I get the message "Bogus attempt to set key window" 
> (from line 3897 of NSApplication.m) so clearly the application's notion of 
> the key window is getting confused.
> 
> I'd like to request that this change be reverted until a better 
> implementation can be found that doesn't have these issues.

Sure, I  reverted the change for now.

I'll see if I can work out a proper fix some time soon.

The WM_ACTIVATEAPP documentation says it is sent when focus switches to or from 
another application.. but it sounds like minimizing a window causes it to be 
sent as well. Perhaps we have to add an extra check that the active window 
actually belongs to another application before sending the [NSApplication 
deactivate].

> Thanks!
> 
> Doug
> 
> P. S. Eric -- THANK YOU, THANK YOU, THANK YOU for fixing the problem with 
> reverse ordering of windows while in gdb under Windows! Debugging is so much 
> more tolerable now!

Glad to hear :-) 

--Eric
_______________________________________________
Gnustep-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to