mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-18 10:32:38 +00:00
Don't capture the cursor on a touch event
This commit is contained in:
parent
8cf7f3ac08
commit
0892f0b0bb
@ -612,25 +612,23 @@ void SdlInputHandler::handleMouseButtonEvent(SDL_MouseButtonEvent* event)
|
|||||||
{
|
{
|
||||||
int button;
|
int button;
|
||||||
|
|
||||||
|
if (event->which == SDL_TOUCH_MOUSEID) {
|
||||||
|
// Ignore synthetic mouse events
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (!isCaptureActive()) {
|
||||||
|
if (event->button == SDL_BUTTON_LEFT && event->state == SDL_RELEASED) {
|
||||||
// Capture the mouse again if clicked when unbound.
|
// Capture the mouse again if clicked when unbound.
|
||||||
// We start capture on left button released instead of
|
// We start capture on left button released instead of
|
||||||
// pressed to avoid sending an errant mouse button released
|
// pressed to avoid sending an errant mouse button released
|
||||||
// event to the host when clicking into our window (since
|
// event to the host when clicking into our window (since
|
||||||
// the pressed event was consumed by this code).
|
// the pressed event was consumed by this code).
|
||||||
if (event->button == SDL_BUTTON_LEFT &&
|
|
||||||
event->state == SDL_RELEASED &&
|
|
||||||
!isCaptureActive()) {
|
|
||||||
setCaptureActive(true);
|
setCaptureActive(true);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else if (!isCaptureActive()) {
|
|
||||||
// Not capturing
|
// Not capturing
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (event->which == SDL_TOUCH_MOUSEID) {
|
|
||||||
// Ignore synthetic mouse events
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (event->button)
|
switch (event->button)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user