Compare commits
6 Commits
bugfix/KAS
...
toggle-gam
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
617210e063 | ||
|
|
aaef2012bd | ||
|
|
551164b425 | ||
|
|
1518575982 | ||
|
|
fda877dd72 | ||
|
|
c0f107a83e |
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -1,4 +1,4 @@
|
|||||||
[submodule "kasmweb"]
|
[submodule "kasmweb"]
|
||||||
path = kasmweb
|
path = kasmweb
|
||||||
url = https://github.com/kasmtech/noVNC.git
|
url = https://github.com/kasmtech/noVNC.git
|
||||||
branch = master
|
branch = toggle-game-mode
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ namespace rfb {
|
|||||||
rdr::U32 __unused_attr keycode,
|
rdr::U32 __unused_attr keycode,
|
||||||
bool __unused_attr down) { }
|
bool __unused_attr down) { }
|
||||||
virtual void pointerEvent(const Point& __unused_attr pos,
|
virtual void pointerEvent(const Point& __unused_attr pos,
|
||||||
|
const Point& __unused_attr abspos,
|
||||||
int __unused_attr buttonMask,
|
int __unused_attr buttonMask,
|
||||||
const bool __unused_attr skipClick,
|
const bool __unused_attr skipClick,
|
||||||
const bool __unused_attr skipRelease) { }
|
const bool __unused_attr skipRelease) { }
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ void SMsgReader::readPointerEvent()
|
|||||||
int mask = is->readU8();
|
int mask = is->readU8();
|
||||||
int x = is->readU16();
|
int x = is->readU16();
|
||||||
int y = is->readU16();
|
int y = is->readU16();
|
||||||
handler->pointerEvent(Point(x, y), mask, false, false);
|
handler->pointerEvent(Point(x, y), Point(0, 0), mask, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -681,14 +681,52 @@ void VNCSConnectionST::setPixelFormat(const PixelFormat& pf)
|
|||||||
setCursor();
|
setCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VNCSConnectionST::pointerEvent(const Point& pos, int buttonMask, const bool skipClick, const bool skipRelease)
|
void VNCSConnectionST::pointerEvent(const Point& pos, const Point& abspos, int buttonMask, const bool skipClick, const bool skipRelease)
|
||||||
{
|
{
|
||||||
pointerEventTime = lastEventTime = time(0);
|
pointerEventTime = lastEventTime = time(0);
|
||||||
server->lastUserInputTime = lastEventTime;
|
server->lastUserInputTime = lastEventTime;
|
||||||
if (!(accessRights & AccessPtrEvents)) return;
|
if (!(accessRights & AccessPtrEvents)) return;
|
||||||
if (!rfb::Server::acceptPointerEvents) return;
|
if (!rfb::Server::acceptPointerEvents) return;
|
||||||
if (!server->pointerClient || server->pointerClient == this) {
|
if (!server->pointerClient || server->pointerClient == this) {
|
||||||
|
Point newpos = pos;
|
||||||
|
if (pos.x & 0x4000) {
|
||||||
|
newpos.x &= ~0x4000;
|
||||||
|
newpos.y &= ~0x4000;
|
||||||
|
|
||||||
|
if (newpos.x & 0x8000) {
|
||||||
|
newpos.x &= ~0x8000;
|
||||||
|
newpos.x = -newpos.x;
|
||||||
|
}
|
||||||
|
if (newpos.y & 0x8000) {
|
||||||
|
newpos.y &= ~0x8000;
|
||||||
|
newpos.y = -newpos.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newpos.x < 0) {
|
||||||
|
if (pointerEventPos.x + newpos.x >= 0)
|
||||||
|
pointerEventPos.x += newpos.x;
|
||||||
|
else
|
||||||
|
pointerEventPos.x = 0;
|
||||||
|
} else {
|
||||||
|
pointerEventPos.x += newpos.x;
|
||||||
|
if (pointerEventPos.x >= cp.width)
|
||||||
|
pointerEventPos.x = cp.width;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newpos.y < 0) {
|
||||||
|
if (pointerEventPos.y + newpos.y >= 0)
|
||||||
|
pointerEventPos.y += newpos.y;
|
||||||
|
else
|
||||||
|
pointerEventPos.y = 0;
|
||||||
|
} else {
|
||||||
|
pointerEventPos.y += newpos.y;
|
||||||
|
if (pointerEventPos.y >= cp.height)
|
||||||
|
pointerEventPos.y = cp.height;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
pointerEventPos = pos;
|
pointerEventPos = pos;
|
||||||
|
}
|
||||||
|
|
||||||
if (buttonMask)
|
if (buttonMask)
|
||||||
server->pointerClient = this;
|
server->pointerClient = this;
|
||||||
else
|
else
|
||||||
@@ -709,7 +747,7 @@ void VNCSConnectionST::pointerEvent(const Point& pos, int buttonMask, const bool
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
server->desktop->pointerEvent(pointerEventPos, buttonMask, skipclick, skiprelease);
|
server->desktop->pointerEvent(newpos, pointerEventPos, buttonMask, skipclick, skiprelease);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ namespace rfb {
|
|||||||
virtual void queryConnection(const char* userName);
|
virtual void queryConnection(const char* userName);
|
||||||
virtual void clientInit(bool shared);
|
virtual void clientInit(bool shared);
|
||||||
virtual void setPixelFormat(const PixelFormat& pf);
|
virtual void setPixelFormat(const PixelFormat& pf);
|
||||||
virtual void pointerEvent(const Point& pos, int buttonMask, const bool skipClick, const bool skipRelease);
|
virtual void pointerEvent(const Point& pos, const Point& abspos, int buttonMask, const bool skipClick, const bool skipRelease);
|
||||||
virtual void keyEvent(rdr::U32 keysym, rdr::U32 keycode, bool down);
|
virtual void keyEvent(rdr::U32 keysym, rdr::U32 keycode, bool down);
|
||||||
virtual void framebufferUpdateRequest(const Rect& r, bool incremental);
|
virtual void framebufferUpdateRequest(const Rect& r, bool incremental);
|
||||||
virtual void setDesktopSize(int fb_width, int fb_height,
|
virtual void setDesktopSize(int fb_width, int fb_height,
|
||||||
|
|||||||
2
kasmweb
2
kasmweb
Submodule kasmweb updated: 67466077c0...33066b89b3
@@ -234,6 +234,40 @@ void vncPointerMove(int x, int y)
|
|||||||
cursorPosY = y;
|
cursorPosY = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void vncPointerMoveRelative(int x, int y, int absx, int absy)
|
||||||
|
{
|
||||||
|
int valuators[2];
|
||||||
|
#if XORG < 111
|
||||||
|
int n;
|
||||||
|
#endif
|
||||||
|
#if XORG >= 110
|
||||||
|
ValuatorMask mask;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// if (cursorPosX == absx && cursorPosY == absy)
|
||||||
|
// return;
|
||||||
|
|
||||||
|
valuators[0] = x;
|
||||||
|
valuators[1] = y;
|
||||||
|
#if XORG < 110
|
||||||
|
n = GetPointerEvents(eventq, vncPointerDev, MotionNotify, 0,
|
||||||
|
POINTER_RELATIVE, 0, 2, valuators);
|
||||||
|
enqueueEvents(vncPointerDev, n);
|
||||||
|
#elif XORG < 111
|
||||||
|
valuator_mask_set_range(&mask, 0, 2, valuators);
|
||||||
|
n = GetPointerEvents(eventq, vncPointerDev, MotionNotify, 0,
|
||||||
|
POINTER_RELATIVE, &mask);
|
||||||
|
enqueueEvents(vncPointerDev, n);
|
||||||
|
#else
|
||||||
|
valuator_mask_set_range(&mask, 0, 2, valuators);
|
||||||
|
QueuePointerEvents(vncPointerDev, MotionNotify, 0,
|
||||||
|
POINTER_RELATIVE, &mask);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
cursorPosX = absx;
|
||||||
|
cursorPosY = absy;
|
||||||
|
}
|
||||||
|
|
||||||
void vncGetPointerPos(int *x, int *y)
|
void vncGetPointerPos(int *x, int *y)
|
||||||
{
|
{
|
||||||
if (vncPointerDev != NULL) {
|
if (vncPointerDev != NULL) {
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ void vncInitInputDevice(void);
|
|||||||
void vncPointerButtonAction(int buttonMask, const unsigned char skipclick,
|
void vncPointerButtonAction(int buttonMask, const unsigned char skipclick,
|
||||||
const unsigned char skiprelease);
|
const unsigned char skiprelease);
|
||||||
void vncPointerMove(int x, int y);
|
void vncPointerMove(int x, int y);
|
||||||
|
void vncPointerMoveRelative(int x, int y, int absx, int absy);
|
||||||
void vncGetPointerPos(int *x, int *y);
|
void vncGetPointerPos(int *x, int *y);
|
||||||
|
|
||||||
void vncKeyboardEvent(KeySym keysym, unsigned xtcode, int down);
|
void vncKeyboardEvent(KeySym keysym, unsigned xtcode, int down);
|
||||||
|
|||||||
@@ -445,11 +445,17 @@ void XserverDesktop::approveConnection(uint32_t opaqueId, bool accept,
|
|||||||
// SDesktop callbacks
|
// SDesktop callbacks
|
||||||
|
|
||||||
|
|
||||||
void XserverDesktop::pointerEvent(const Point& pos, int buttonMask,
|
void XserverDesktop::pointerEvent(const Point& pos, const Point& abspos, int buttonMask,
|
||||||
const bool skipClick, const bool skipRelease)
|
const bool skipClick, const bool skipRelease)
|
||||||
{
|
{
|
||||||
|
if (pos.equals(abspos)) {
|
||||||
vncPointerMove(pos.x + vncGetScreenX(screenIndex),
|
vncPointerMove(pos.x + vncGetScreenX(screenIndex),
|
||||||
pos.y + vncGetScreenY(screenIndex));
|
pos.y + vncGetScreenY(screenIndex));
|
||||||
|
} else {
|
||||||
|
vncPointerMoveRelative(pos.x, pos.y,
|
||||||
|
abspos.x + vncGetScreenX(screenIndex),
|
||||||
|
abspos.y + vncGetScreenY(screenIndex));
|
||||||
|
}
|
||||||
vncPointerButtonAction(buttonMask, skipClick, skipRelease);
|
vncPointerButtonAction(buttonMask, skipClick, skipRelease);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public:
|
|||||||
const char* rejectMsg=0);
|
const char* rejectMsg=0);
|
||||||
|
|
||||||
// rfb::SDesktop callbacks
|
// rfb::SDesktop callbacks
|
||||||
virtual void pointerEvent(const rfb::Point& pos, int buttonMask,
|
virtual void pointerEvent(const rfb::Point& pos, const rfb::Point& abspos, int buttonMask,
|
||||||
const bool skipClick, const bool skipRelease);
|
const bool skipClick, const bool skipRelease);
|
||||||
virtual void keyEvent(rdr::U32 keysym, rdr::U32 keycode, bool down);
|
virtual void keyEvent(rdr::U32 keysym, rdr::U32 keycode, bool down);
|
||||||
virtual unsigned int setScreenLayout(int fb_width, int fb_height,
|
virtual unsigned int setScreenLayout(int fb_width, int fb_height,
|
||||||
|
|||||||
Reference in New Issue
Block a user