Shell surface positioning
jsynacek at redhat.com
Thu Nov 10 09:46:09 UTC 2016
On Thu, Nov 10, 2016 at 6:20 AM, Jonas Ådahl <jadahl at gmail.com> wrote:
> On Wed, Nov 09, 2016 at 10:30:45AM +0100, Jan Synacek wrote:
>> I'm playing around with libwayland-client, implementing a simple
>> application. I made the middle mouse button move the "window" using
>> wl_shell_surface_move() when the button is pressed, which works. What
>> I don't understand, though, is how do I make the compositor position
>> the "window" when it's created? I would like to position it somewhere
>> else than 0,0 in monitor coordinates.
> There is currently no protocol for hinting about how a surface should be
> positioned. There most likely will not be a protocol that has "place me
> at (x, y)" but rather more like "center me", "restore previous position"
> or something more high level like that.
Out of interest, why is that? It seems to me that it's a rather
trivial and basic operation to support. Maybe it's documented
somewhere and I have missed it?
>> Additionally, are clients expected to draw their decorations? If yes,
>> does that mean creating subsurfaces that respond to pointer events?
> With wl_shell and xdg_shell, then yes. You can do it however you want,
> either like Qt and GTK+ by simply drawing both the frame and the content
> one single surface, or by using multiple surfaces, combining them using
> wl_subcompositor to form a single "window".
Software Engineer, Red Hat
More information about the wayland-devel