[PATCH v2] shell: moving drag surface refine

Kristian Høgsberg hoegsberg at gmail.com
Fri Aug 3 09:56:43 PDT 2012


On Fri, Aug 03, 2012 at 09:58:27AM +0800, Juan Zhao wrote:
> Thanks for your reply, I will refine it, I still have some questions. :)
> 
> On Thu, 2012-08-02 at 12:01 -0400, Kristian Høgsberg wrote:
> > > @@ -1669,7 +1669,10 @@ update_outputs(struct drm_compositor *ec,
> > struct udev_device *drm_device)
> > >               }
> > >       }
> > >  
> > > -     /* FIXME: handle zero outputs, without terminating */   
> > > +     ec->base.shell_interface.reconf_active_regions(
> > >
> > +                                     ec->base.shell_interface.shell);
> > > +
> > 
> > Let's use a wl_signal for this.  Outputs changing is an event
> > generated by the core compositor, and there may many places that want
> > to do something when that happens.  Put a struct wl_signal
> > outputs_signal in weston_compositor and emit it whenever the list of
> > outputs, their resolution or position changes.  Let's also add an
> > output_region region in weston_compositor.h that we keep up to date
> > with then union of all output->regions.  Rebuild it before emitting
> > the outputs_signal.
> > 
> My first question is about how to grap "Output changing", currently, in
> drm backend, we listen to udev events and grab the changing, how would
> it work in X11, android backend, and generalize one interface in
> compositor.c.
> 
> Generate a new file, providing APIs and handling all the "Output
> changing" issues?

We don't have any hotplug functionality in the other backends, so
that's not a problem.  We don't need any new files, just use wl_signal
like described above.  Look for wl_signal_emit and wl_signal_add for
examples of how the mechanism work.

Kristian

> Thanks,
> Juan
> 
> > 
> 


More information about the wayland-devel mailing list