Absolute coordinates using "wl_shell_surface_set_transient"

Tarnyko tarnyko at tarnyko.net
Tue Sep 17 01:44:47 PDT 2013


Hi Pekka, 

I'm taking that as a compliment :-). Thanks !
So we won't rely on that code in the future. 

If you're curious about why we tried to do that, please look at my answer to 
Bill and Giulio. 

Regards,
Tarnyko 

Pekka Paalanen writes: 

> On Mon, 16 Sep 2013 11:41:50 +0200
> Tarnyko <tarnyko at tarnyko.net> wrote: 
> 
>> Hi folks,  
>> 
>> Wayland/Weston 1.2 here ; I recently needed to display a surface using 
>> absolute coordinates. Let's say, 100x100 starting from the upper left corner 
>> of the compositor.  
>> 
>> So here is the (working) approach I used :  
>> 
>> window->surface = wl_compositor_create_surface (display->compositor);
>> window->shell_surface = wl_shell_get_shell_surface (display->shell, 
>> window->surface);
>> wl_shell_surface_set_transient (window->shell_surface, window->surface, 100, 
>> 100, 0);  
>> 
>> 
>> It works this way, surface always displays at 100x100.
>> But my question is : is it supposed to work in the first place ? And will it 
>> still be working in future releases ? 
> 
> Yeah, that behaviour is a bug. A surface cannot be its own parent, so
> the position you get is just luck. Actually, your client should get
> killed by a protocol error, but it seems we miss that check in weston. 
> 
> Actually you're double lucky, because if transient surfaces were
> implemented properly with transformation inheritance, weston would
> probably hang, and this bug would be more obvious. 
> 
> Also I'm not sure if mapping a transient for an unmapped parent is
> supposed to work... that's a nice can of worms you found there ;-) 
> 
> 
> Thanks,
> pq


More information about the wayland-devel mailing list