[Spice-devel] [PATCH spice-gtk v2 3/4] Remove warning about unused variable when building on macOS

Christophe de Dinechin cdupontd at redhat.com
Tue May 16 13:48:46 UTC 2017


> On 16 May 2017, at 15:15, Frediano Ziglio <fziglio at redhat.com> wrote:
> 
>> 
>> On Thu, May 11, 2017 at 12:47:07PM +0200, Christophe de Dinechin wrote:
>>> From: Christophe de Dinechin <dinechin at redhat.com>
>>> 
>>> On macOS, neither of the two cases implemented in set_mouse_accel applies.
>>> We get the following eror message:
>>> 
>>>  CC       spice-widget.lo
>>> spice-widget.c:944:26: error: unused variable 'd'
>>> [-Werror,-Wunused-variable]
>>>    SpiceDisplayPrivate *d = display->priv;
>> 
>> This is a warning triggering an error because of -Werror. In a way it's
>> a good warning, because it's pointing out an area which needs work when
>> porting spice-gtk to osx. Removing the warning without providing a
>> working implementation is a bit suboptimal imo.
>> 
>> Christophe
>> 
> 
> Can this feature be implemented in Mac OS X?

Unclear. See http://dae.me/blog/2144/on-macos-sierra-support-and-the-future-of-smoothmouse/

I’m not positive what should happen with enabled / disabled. Is the idea to transfer acceleration control to the guest? Does that work only for relative movement, or is there some heuristic for absolute coordinates too?

> Maybe a TODO comment may help?

Good idea.

> 
> Frediano
> 
>>> 
>>> Signed-off-by: Christophe de Dinechin <dinechin at redhat.com>
>>> ---
>>> src/spice-widget.c | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/src/spice-widget.c b/src/spice-widget.c
>>> index 8203d55..5542e85 100644
>>> --- a/src/spice-widget.c
>>> +++ b/src/spice-widget.c
>>> @@ -941,9 +941,8 @@ static void update_keyboard_grab(SpiceDisplay *display)
>>> 
>>> static void set_mouse_accel(SpiceDisplay *display, gboolean enabled)
>>> {
>>> -    SpiceDisplayPrivate *d = display->priv;
>>> -
>>> #if defined GDK_WINDOWING_X11
>>> +    SpiceDisplayPrivate *d = display->priv;
>>>     GdkWindow *w = GDK_WINDOW(gtk_widget_get_window(GTK_WIDGET(display)));
>>> 
>>>     if (!GDK_IS_X11_DISPLAY(gdk_window_get_display(w))) {
>>> @@ -965,6 +964,7 @@ static void set_mouse_accel(SpiceDisplay *display,
>>> gboolean enabled)
>>>                       d->x11_accel_numerator, d->x11_accel_denominator,
>>>                       d->x11_threshold);
>>>     }
>>> #elif defined GDK_WINDOWING_WIN32
>>> +    SpiceDisplayPrivate *d = display->priv;
>>>     if (enabled) {
>>>         g_return_if_fail(SystemParametersInfo(SPI_SETMOUSE, 0,
>>>         &d->win_mouse, 0));
>>>         g_return_if_fail(SystemParametersInfo(SPI_SETMOUSESPEED, 0,
>>>         (PVOID)(INT_PTR)d->win_mouse_speed, 0));
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170516/8d2166e1/attachment-0001.html>


More information about the Spice-devel mailing list