Bug 45595 - mouse wrapping doesn't work when the window is partially outside of the physical screen
Summary: mouse wrapping doesn't work when the window is partially outside of the physi...
Status: RESOLVED FIXED
Alias: None
Product: Spice
Classification: Unclassified
Component: spice-gtk (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Spice Bug List
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-03 08:05 UTC by Alon Levy
Modified: 2012-02-13 08:13 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
widget: fix mouse wrapping failing when the window is outside (4.59 KB, patch)
2012-02-07 06:43 UTC, Marc-Andre Lureau
Details | Splinter Review

Description Alon Levy 2012-02-03 08:05:50 UTC
If the window of spice-gtk is partially outside of the physical screen, like so:

                                  .----------------------.
                                  |   physical screen    |
                            .-----------------.          |
                            |    spice-gtk    |          |
                            |     widget      |          |
                            |                 |          |
                            |                 |          |
                            |                 |          |
                            |                 |          |
                            '-----------------'          |
                                  |                      |
                                  '----------------------'

This doesn't work for linux and for windows.

For linux, the problem is that the grab area is wrongly set to:

                                  .----------------------.
                                  |                      |
                            .---------------.            |
                            |.-------------.|            |
                            ||  grab area  ||            |
                            ||             ||            |
                            ||             ||            |
                            |'-------------'|            |
                            '---------------'            |
                                  |                      |
                                  |                      |
                                  '----------------------'

and we actually want it to be the whole screen.

For windows we can use WH_MOUSE_LL for SetWindowsHookEx

But there is an even better implementation that we need to copy from spicec.
Comment 1 Marc-Andre Lureau 2012-02-07 06:43:14 UTC
Created attachment 56711 [details] [review]
widget: fix mouse wrapping failing when the window is outside

Use a anchor mouse position after every move, similar to spicec to
avoid reaching transparent border on the screen.

We try to move to the center of the screen, but
gdk_display_warp_pointer () will move the cursor within the grabbed
window (so it still receives mouse events even on Windows)

Tested with Linux and Windows clients.

Fixes bug:
Comment 2 Alon Levy 2012-02-13 07:53:28 UTC
ACK.
Comment 3 Marc-Andre Lureau 2012-02-13 08:13:57 UTC
pushed.

commit fdbd5c1b5eb8596b574ad651afb74a7c59a14484
Author: Marc-André Lureau <marcandre.lureau@redhat.com>
Date:   Tue Feb 7 14:36:14 2012 +0100


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.