diff options
author | Brian Hinz <bphinz@users.sourceforge.net> | 2013-01-23 23:12:32 +0000 |
---|---|---|
committer | Brian Hinz <bphinz@users.sourceforge.net> | 2013-01-23 23:12:32 +0000 |
commit | d2dd53f5b6d71bee2fa322499dea0fb4ea0735d7 (patch) | |
tree | 33758034ec8c7d7ff898cce593ca6714d3afc04a /java/com/tigervnc/vncviewer | |
parent | d39531edfe58343cefc29ab495462f1005edf2c5 (diff) | |
download | tigervnc-d2dd53f5b6d71bee2fa322499dea0fb4ea0735d7.tar.gz tigervnc-d2dd53f5b6d71bee2fa322499dea0fb4ea0735d7.zip |
When the desktop size is less than the viewport size, ignore mouse events that occur in the interstitial area
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5035 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'java/com/tigervnc/vncviewer')
-rw-r--r-- | java/com/tigervnc/vncviewer/DesktopWindow.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/java/com/tigervnc/vncviewer/DesktopWindow.java b/java/com/tigervnc/vncviewer/DesktopWindow.java index 7254a0b8..0fcfcb11 100644 --- a/java/com/tigervnc/vncviewer/DesktopWindow.java +++ b/java/com/tigervnc/vncviewer/DesktopWindow.java @@ -390,11 +390,10 @@ class DesktopWindow extends JPanel implements /** Mouse-Motion callback function */ private void mouseMotionCB(MouseEvent e) { - if (!cc.viewer.viewOnly.getValue()) { + if (!cc.viewer.viewOnly.getValue() && + e.getX() >= 0 && e.getX() <= scaledWidth && + e.getY() >= 0 && e.getY() <= scaledHeight) cc.writePointerEvent(e); - lastX = e.getX(); - lastY = e.getY(); - } // - If local cursor rendering is enabled then use it if (cursorAvailable) { // - Render the cursor! @@ -408,13 +407,17 @@ class DesktopWindow extends JPanel implements } } } + lastX = e.getX(); + lastY = e.getY(); } public void mouseDragged(MouseEvent e) { mouseMotionCB(e);} public void mouseMoved(MouseEvent e) { mouseMotionCB(e);} /** Mouse callback function */ private void mouseCB(MouseEvent e) { - if (!cc.viewer.viewOnly.getValue()) + if (!cc.viewer.viewOnly.getValue() && + e.getX() >= 0 && e.getX() <= scaledWidth && + e.getY() >= 0 && e.getY() <= scaledHeight) cc.writePointerEvent(e); lastX = e.getX(); lastY = e.getY(); |