[PATCH] xdg-shell: update shsurf->output when maximizing

Bill Spitzak spitzak at gmail.com
Tue Sep 9 11:54:56 PDT 2014

On 09/08/2014 11:15 PM, Marek Chalupa wrote:

> Each surface has assigned output it is currently mapped on (so it can be
> NULL). This surface->output is set by weston_surface_assign_output which
> is called by weston_view_assign_output (and that by
> weston_surface_update_transform) or by surface_unmap. Atm,
> weston_surface_assign_output assigns the output on which the surface
> covers the biggest area + it sets a  bitfield with all the outputs the
> surface is (at least partially) mapped on. This setting is done by
> Weston core (in src/compositor.c).
> I don't think it should use the same algorithm, because then we can just
> use surface->output instead of shsurf->output, right? If I understand it
> correctly, the shsurf->output should be kind of 'chosen' by user (like
> in xdg_surface_set_fullscreen request or so) - it is just the output the
> user expects the surface is on.

Okay I think my question is why not use surface->output, and initialize 
that value to the value you calculate above? Then get rid of 
shsurf->output since it is redundant.

Even if there is a good reason for two different fields, it seems like 
some very similar algorithm must be used to decide the position for new 
non-maximized surfaces. Your patch adds a new function but does not add 
any calls other than from set-maximized, therefore there must be some 
redundant function somewhere choosing the initial position of 
non-maximized surfaces. It really seems like there should be some 
merging of these.

More information about the wayland-devel mailing list