discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is IO locked while pressing the menu?


From: Richard Frith-Macdonald
Subject: Re: Is IO locked while pressing the menu?
Date: Fri, 22 Feb 2002 13:12:58 +0000

On Friday, February 22, 2002, at 09:20 AM, ]d wrote:

Someone here is re-writing a WM using AppKit and she has a problem.
During the NSApplicationMain loop, the WM created the menu
and the first menu is popped up (not yet incorrectly) but when press on an
entry which should invoke a submenu (that suppose to open a submenu)
there is no event arrive at the ConnectionNumber(display) which has been
set to waitForDataInBackgroundAndNotify.

Suddenly after release the button pressing, some events arrived and
the WM pop up the second menu. So, my question is, why there's no
data after the mouse pressing? Testing on another WM, MapRequest
arrived at the moment the mouse is down. Writing a test code on a file
descriptor not the ConnectionNumber(display) cause the same problem,
that the notification stop working while pressing the menu.
Is this a bug or feature in GNUstep? Did we use wrong way of notification?

My guess is simply that your code is not waiting for events in the right
runloop mode.

When you press the mouse button over a menu, the menu tries to grab all
events by running the loop in NSEventTrackingRunLoopMode ... which means
that the runloop won't be watching for events in other modes.

Try using waitForDataInBackgroundAndNotifyForModes: with the mode array
set to include NSEventTrackingRunLoopMode as well as NSDefaultRunLoopMode.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]