[Spice-devel] [PATCH spice-gtk] widget: Fix mouse position reporting for multiple monitors on 1 display channel

Hans de Goede hdegoede at redhat.com
Mon Feb 4 06:02:32 PST 2013


Hi,

On 02/04/2013 02:52 PM, Uri Lublin wrote:
> [CC'ing Arnon]
>
> On 02/02/2013 05:30 PM, Hans de Goede wrote:
>> VDAgentMouseState contains a display_id and expects coordinates in multi-mon
>> mode to be relative to the origin of the monitor specified by the display_id.
>>
>> The agent will then adjust the mouse coordinates for the position of the
>> monitor as configured in the guest.
>>
>> In multiple monitors on 1 display channel spice-gtk is wrongly setting
>> display_id to the channel_id (which is 0 for all monitors), and is working
>
> I think the channel_id is not always 0 for Windows guests.

Note: "In multiple monitors on 1 display channel spice-gtk" so we're talking the
new multiple heads an a single qxl-dev case here! And since there is only 1
channel in that case channel_id will be 0 for all monitors.

>> around the problems this causes by doing the adjustment of the mouse position
>> itself.
>>
>> But the agent is still applying the correction for the monitor position to
>> all VDAgentMouseState messages it gets, and since for all monitors a display_id
>> of 0 is reported it always uses the position of display 0 for the correction.
>>
>> Since the position of display 0 is usally +0+0 this usually works, but as soon
>> as the position of display 0 is not +0+0, the correction will get done twice
>> for display 0, and the display 0 position will wrongly get added the mouse
>> position for other displays.
>>
>> This patch fixes this by properly setting display_id, and removing the
>> modification of the mouse coordinates as that is already done in the agent.
>
> Is that also holds for the Windows agent ?

I did not check, but yes it should also hold for the windows agent, otherwise
the mouse will be broken in the good-old multi-monitor through multiple cards
mode.

Regards,

Hans


More information about the Spice-devel mailing list