[PATCH weston 1/2] Clip pointer input to menu surface.

Pekka Paalanen ppaalanen at gmail.com
Mon Oct 8 02:19:56 PDT 2012


On Sun, 7 Oct 2012 15:53:44 -0600
Scott Moreau <oreaus at gmail.com> wrote:

> On Sun, Oct 7, 2012 at 3:46 PM, Pekka Vuorela <pvuorela at iki.fi> wrote:
> 
> > On su, 2012-10-07 at 15:12 -0600, Scott Moreau wrote:
> > >
> > >
> > > On Sun, Oct 7, 2012 at 12:21 PM, Pekka Vuorela <pvuorela at iki.fi>
> > > wrote:
> > >         On su, 2012-10-07 at 04:28 -0600, Scott Moreau wrote:
> > >         > Don't send motion events to the surface when the pointer is
> > >         not over the menu.
> > >         > This was also causing items to be selected when clicking
> > >         outside of the menu.
> > >
> > >
> > >         Wouldn't it be quite a lousy grab if only events on top of the
> > >         grabbing
> > >         window would be delivered?
> > >
> > >
> > > Is there another way to determine this information from client side?
> > >
> > >
> > Client knows the width of the menu and can ignore events based on that.
> >
> > I was actually checking out why menu handling doesn't work properly a
> > week ago and came across few other issues. First, it's not doing a real
> > grab even though wl_shell_surface::set_popup defines one. Events only
> > passed on top of client's surfaces. Second, mouse on top of main window
> > passes events with coordinates relative to that.
> 
> 
> The x/y we get when outside of the menu surface are relative to the parent.
> So
> there's no way currently to tell from client side whether or not the motion
> event
> is on the parent or child. I'm not sure why you'd need a grab here, unless
> you
> wanted to be able to drag a menu for some reason.

The grab is needed, so that the menu will be dismissed, when you click
anywhere, even on another client's surface. This dismissing click needs
to go to the menu surface if anywhere.

You're right in your patch description, that coordinates during the menu
grab should always be relative to the menu surface, I believe.

> > Created a bug report
> > for those https://bugs.freedesktop.org/show_bug.cgi?id=55325


Thanks,
pq


More information about the wayland-devel mailing list