[Spice-devel] Fwd: [vdagent-win PATCH] Use Windows coordinates with primary monitor at (0, 0) when making WinAPI calls.

Sandy Stutsman sstutsma at redhat.com
Mon Mar 23 06:25:55 PDT 2015


Hi.

The handle_mon_config gets called when the client sends the guest a new configuration. It will create a new DisplayMode object for each monitor using the Windows API to enumerate the display devices.  Here is were the position is set to 0 for primary monitors.  This is followed by a call to normalize _display_pos which sets the left-most display to 0. This call is required to keep the mouse coordinates in sync with the client. It is also this call which can cause the primary display to be non zero.
-S

----- Original Message -----
From: "Marc-André Lureau" <marcandre.lureau at gmail.com>
To: "Sandy Stutsman" <sstutsma at redhat.com>
Cc: spice-devel at freedesktop.org
Sent: Monday, March 23, 2015 7:52:22 AM
Subject: Re: [Spice-devel] Fwd: [vdagent-win PATCH] Use Windows coordinates with primary monitor at (0, 0) when making WinAPI calls.

Hi

On Sat, Mar 21, 2015 at 12:06 AM, Sandy Stutsman <sstutsma at redhat.com> wrote:
> +    LONG normal_x = primary ? primary->get_pos_x() : 0;
> +    LONG normal_y = primary ? primary->get_pos_y() : 0;
> +
...

> diff --git a/vdagent/desktop_layout.h b/vdagent/desktop_layout.h
> index c43ff03..3abbe58 100644
> --- a/vdagent/desktop_layout.h
> +++ b/vdagent/desktop_layout.h
> @@ -31,6 +31,7 @@ public:
>          , _depth (depth)
>          , _attached (attached)
>      {
> +        _primary =  (pos_x == 0 && pos_y == 0 && attached);
>      }


Since the display is_primary() when pos_x == 0 && pos_y == 0, when can
you have nomal_x,y != 0 ?

-- 
Marc-André Lureau


More information about the Spice-devel mailing list