nanogui: Thread: why have two buttondown events


[<<] [<] Page 1 of 1 [>] [>>]
Subject: why have two buttondown events
From: ####@####.####
Date: 26 Sep 2001 09:54:10 -0000
Message-Id: <003601c14672$01d69260$2b64a8c0@rdcenter.com>

Hi,I create two windows, and one is the other's parent.
I find if I click the mouse on the region of child window, the parent windown and the child windown both
gain the buttondonw event.Who can tell me why?
   Thanks a lot! 

Subject: Re: [nanogui] why have two buttondown events
From: "Greg Haerr" ####@####.####
Date: 26 Sep 2001 17:22:52 -0000
Message-Id: <025a01c146af$60476f80$3aba46a6@xmission.com>

: Hi,I create two windows, and one is the other's parent.
: I find if I click the mouse on the region of child window, the parent windown
and the child windown both
: gain the buttondonw event.Who can tell me why?

This is the way Nano-X (and X11) works.  Instead of
giving the event to the topmost window, like win32
does, X and Nano-X give the event to all windows that
have selected for it and intersect the point.

Regards,

Greg

Subject: Re: [nanogui] why have two buttondown events
From: "Greg Haerr" ####@####.####
Date: 4 Oct 2001 19:04:21 -0000
Message-Id: <048e01c14d09$1928c030$6817dbd0@censoft.com>

: : Hi,I create two windows, and one is the other's parent.
: : I find if I click the mouse on the region of child window, the parent
windown
: and the child windown both
: : gain the buttondonw event.Who can tell me why?
:
: [Greg wrote]
: This is the way Nano-X (and X11) works.  Instead of
: giving the event to the topmost window, like win32
: does, X and Nano-X give the event to all windows that
: have selected for it and intersect the point.

I was not quite correct in this response.
The exact behaviour of mouse-down events
with Nano-X has to do with something called
"implicit button grab."

When a button-down event occurs, Nano-X
will send the event to the topmost window
containing the current mouse point.  However,
if that window has selected for BOTH button
down AND button up events, then the server
will perform an implicit button grab, and
not send the button down event to any other windows.
If the window has NOT selected for BOTH
up and down button events, then Nano-X will
continue searching the window list and send the
button down event to windows underneath the
current one, repeating the above process.
[It sounds like your window has not selected for
both up and down events.]

An implicit button grab causes the server to
send the subsequence button-up event to the
original window, even if the mouse location has
moved outside it when the button-up occurs.

Clear as mud?

Regards,

Greg


[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.