[RFC] [PATCH 0/5] Update drag surface only in output repaint

Ander Conselvan de Oliveira ander.conselvan.de.oliveira at intel.com
Tue Mar 13 08:23:54 PDT 2012


Kristian mentioned that he would like to have drag surfaces updated
only during output repaint. There were some issues that made this a
bit complicated and here is one possible solution.

One of the issues is that the compositor would not know when a new drag
icon was setup since the drag code in libwayland-server. To make sure
we setup the drag surface as soon as possible, it was necessary to
check if there is a new surface in a few different places.

Another issue is that a client may want to update the position of the
drag surface during the first attach. The previous solution for this
was passing sx and sy from surface_attach() to shell->map().

To solve the first issue, I added a listener that tells the compositor
of the new drag icon.

For the seconf one, I implemented a surface attach listener. That way
the weston_input_device can be updated on every attach and we can store
the relative position between the drag surface and the cursor hotspot
so that we don't need to update on motion notify.

I'm not really sure about this suface attach listener interface, but I
believe it might be useful when implementing cursor surfaces.

These changes are also available on the branch dnd-sprite-update on my
wayland and weston repositories in github.com/anderco .

Ander Conselvan de Oliveira (4):
  compositor: only update cursor sprite position on output repaint
  compositor: use new drag icon listener for setting up drag surfaces
  compositor: create an attach listener for weston_surfaces
  compositor: only update drag surfaces during output repaint

 src/compositor.c |  100 +++++++++++++++++++++++++++++++++++++++++-------------
 src/compositor.h |   16 ++++++++-
 src/shell.c      |    2 -
 3 files changed, 91 insertions(+), 27 deletions(-)


More information about the wayland-devel mailing list