Re: client-side-windows vs metacity



On Fri, 2009-01-30 at 14:48 -0500, Owen Taylor wrote:
> On Fri, 2009-01-30 at 20:38 +0100, Alexander Larsson wrote:
> > I'm running a full gnome session with the client-side-windows branch
> > here. There are a few minor issues I'm working on, but overall it just
> > works(tm). I'll send a new status report soon.
> > 
> > However, there is a specific issue with metacity that I'd like some
> > feedback on. Metacity uses gdk to handle the frame window for managed
> > children. This window will get the clients window reparented into it,
> > however metacity never accesses that window as a gdk window (i.e. it
> > doesn't call gdk_window_foreign_new on the xid) , so gdk doesn't know
> > about it.
> > 
> > This means that as gdk knows there are no children of the frame, and
> > thus the event emulation code won't send a leave for inferior event to
> > the frame when the mouse moves from the frame to the client window. This
> > means metacity won't reset the cursor on the frame, thus affecting the
> > default cursor in the client window. (In X the default cursor is
> > inherited from the parent.)
> >
> > Now, how do we solve this? There are two possibilities. Either we add
> > special code to metacity so that it creates the child window as a gdk
> > object and keeps it updated as to the size when the frame is resized.
> > 
> > Or, we add some hacks to gdk to track this case and make it work. One
> > way is to detect native Inferior Leave events on windows with no
> > children and use XQueryTree to find the windows. Resizes can be tracked
> > with ConfigureEvents. I'm attaching a patch that implements this.
> 
> Although I believe there is a problem, It's not clear from the above
> what it is. Is there problem that Metacity isn't it getting a GDK leave
> event? If that's the problem, why can't you just convert the native
> event to a GDK event and send that along?
> 
> And how are ConfigureEvents related?

Yes, metacity is not getting a gdk leave event on the frame when the
cursor moves from the frame to the client area. This happens because the
event emulation code gets a "native" leave event on the frame to some
position inside the frame, but the frame GdkWindow->children list is
empty, so it doesn't generate a leave event for a child. 

We filter out the native events that we get on the toplevel, because
they don't necessary match whats gonna be right when taking the client
side windows into account. 

The solution is to create a GdkWindow object for the client window so
that the event emulation machinery is aware of the child and everything
works. The configure event is required to update the size of the foreign
child when the frame changes.



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