[PATCH 5/7] shell: update position of surfaces with type none on map()

Ander Conselvan de Oliveira conselvan2 at gmail.com
Thu Feb 16 06:42:03 PST 2012


On 02/16/2012 09:56 AM, Pekka Paalanen wrote:
>> This changes shell->map interface to take sx and sy parameters and
>> change dekstop shell implementation to update the position of a
>> surface of type none according to those parameters. Since a surface
>> of type none won't actually be mapped, the effect of this change is
>> only visible for surfaces that are made visible by the compositor.
>>
>> Signed-off-by: Ander Conselvan de Oliveira<ander.conselvan.de.oliveira at intel.com>
>> diff --git a/src/shell.c b/src/shell.c
>> index d48633e..d9ba168 100644
>> --- a/src/shell.c
>> +++ b/src/shell.c

[...]

>> @@ -1308,6 +1308,10 @@ map(struct weston_shell *base,
>>   		break;
>>   	case SHELL_SURFACE_POPUP:
>>   		shell_map_popup(shsurf, shsurf->popup.time);
>> +	case SHELL_SURFACE_NONE:
>> +		weston_surface_set_position(surface,
>> +					    surface->geometry.x + sx,
>> +					    surface->geometry.y + sy);
>
> I'd like to have a comment here saying that we are ignoring surface
> transformations on purpose. The pattern "geometry.x + sx" is
> usually a bug, especially without checking surface->transform.enabled,
> because it mixes two different coordinate systems.

I actually had not consider the case where the drag surface is 
transformed. We definitely want to move it according to the 
transformation. For instance, the dnd demo uses the flower being dragged 
as the icon and sets its position so it looks like that it is being 
moved with the cursor.

I cooked the attached patch that I can squash into the series. I tested 
it by adding a rotation to the mouse cursor and checking if the dnd demo 
behavior was still the same.


Thanks,
Ander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: properly-transform-drag-surface.patch
Type: text/x-patch
Size: 2586 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20120216/d6f23ad1/attachment.bin>


More information about the wayland-devel mailing list