mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 14:57:20 +00:00
[host] nvfbc: update cursor position on shape change
This is because we keep track of the top-left corner of the cursor, not the location of the hotspot. When the cursor shape changes, the hotspot location may also change. When it does, the position of the top-left corner changes and requires an update. In the case that we do not have the current cursor position, which happens on startup, we do not generate this update.
This commit is contained in:
parent
908aa84599
commit
d610aaf2cf
@ -60,7 +60,7 @@ struct iface
|
|||||||
LGEvent * cursorEvents[2];
|
LGEvent * cursorEvents[2];
|
||||||
|
|
||||||
int mouseX, mouseY, mouseHotX, mouseHotY;
|
int mouseX, mouseY, mouseHotX, mouseHotY;
|
||||||
bool mouseVisible;
|
bool mouseVisible, hasMousePosition;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct iface * this = NULL;
|
static struct iface * this = NULL;
|
||||||
@ -84,6 +84,7 @@ static void getDesktopSize(unsigned int * width, unsigned int * height, unsigned
|
|||||||
|
|
||||||
static void on_mouseMove(int x, int y)
|
static void on_mouseMove(int x, int y)
|
||||||
{
|
{
|
||||||
|
this->hasMousePosition = true;
|
||||||
this->mouseX = x;
|
this->mouseX = x;
|
||||||
this->mouseY = y;
|
this->mouseY = y;
|
||||||
lgSignalEvent(this->cursorEvents[0]);
|
lgSignalEvent(this->cursorEvents[0]);
|
||||||
@ -362,6 +363,7 @@ static int pointerThread(void * unused)
|
|||||||
|
|
||||||
CaptureResult result;
|
CaptureResult result;
|
||||||
CapturePointer pointer = { 0 };
|
CapturePointer pointer = { 0 };
|
||||||
|
bool hotspotUpdated = false;
|
||||||
|
|
||||||
if (this->seperateCursor && events[1])
|
if (this->seperateCursor && events[1])
|
||||||
{
|
{
|
||||||
@ -383,9 +385,10 @@ static int pointerThread(void * unused)
|
|||||||
this->mouseVisible = pointer.visible;
|
this->mouseVisible = pointer.visible;
|
||||||
this->mouseHotX = pointer.hx;
|
this->mouseHotX = pointer.hx;
|
||||||
this->mouseHotY = pointer.hy;
|
this->mouseHotY = pointer.hy;
|
||||||
|
hotspotUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (events[0])
|
if (events[0] || (hotspotUpdated && this->hasMousePosition))
|
||||||
{
|
{
|
||||||
pointer.positionUpdate = true;
|
pointer.positionUpdate = true;
|
||||||
pointer.visible = this->mouseVisible;
|
pointer.visible = this->mouseVisible;
|
||||||
|
Loading…
Reference in New Issue
Block a user