Diffusion KWin f0dc01b3521e

[wayland] Ensure that pointer enter event carries the correct coordinates

Authored by graesslin on Aug 4 2016, 8:39 AM.

Description

[wayland] Ensure that pointer enter event carries the correct coordinates

So far KWin's pointer surface enter handling was:

  1. update fouced surface
  2. update the global position

On client side this resulted in:

  1. Enter with incorrect coordinates
  2. move event to correct coordinate

With QtWayland this results in the case of multiple surfaces in one
application that Qt doesn't properly process the enter event and the
Window never getting pointer focus and not reacting on any pointer
input events.

The root problem is that the KWayland server API is not ideal for
supporting this situation. There is an API call for setting the global
position (which causes a pointer motion for the focused surface) and
an API call to update the focused surface. But a combination for both
is (still) missing.

This change addresses the problem by first unsetting the entered surface,
then updating the global position and afterwards setting the new surface.
Thus the position is correct. While this needs to be made better in
KWayland, this is an urgency bug fix to get the behavior correct and thus
first working around the API deficit and not first extending in KWayland.

Reviewed-By: bshah

Details