mvadkert / rpms / tigervnc

Forked from rpms/tigervnc 6 years ago
Clone
Blob Blame History Raw
Index: unix/vncviewer/DesktopWindow.h
===================================================================
--- unix/vncviewer/DesktopWindow.h	(revision 3903)
+++ unix/vncviewer/DesktopWindow.h	(working copy)
@@ -29,6 +29,7 @@
 #include "TXWindow.h"
 #include "TXViewport.h"
 #include "TXImage.h"
+#include "parameters.h"
 
 class CConn;
 
@@ -54,6 +55,12 @@
   // resetLocalCursor() stops the rendering of the local cursor
   void resetLocalCursor();
 
+  // setNoCursor() sets what to display when no cursor is defined - if dot or
+  // nothing.
+  inline void setNoCursor() {
+    XDefineCursor(dpy, win(), dotWhenNoCursor ? dotCursor : noCursor);
+  }
+
   // Methods forwarded from CConn
   void setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs);
   void serverCutText(const char* str, rdr::U32 len);
Index: unix/vncviewer/CConn.cxx
===================================================================
--- unix/vncviewer/CConn.cxx	(revision 3903)
+++ unix/vncviewer/CConn.cxx	(working copy)
@@ -684,6 +684,7 @@
       desktop->resetLocalCursor();
   }
   dotWhenNoCursor.setParam(options.dotWhenNoCursor.checked());
+  desktop->setNoCursor();
   checkEncodings();
 }
 
Index: unix/vncviewer/DesktopWindow.cxx
===================================================================
--- unix/vncviewer/DesktopWindow.cxx	(revision 3903)
+++ unix/vncviewer/DesktopWindow.cxx	(working copy)
@@ -79,7 +79,7 @@
                PointerMotionMask | KeyPressMask | KeyReleaseMask |
                EnterWindowMask | LeaveWindowMask);
   createXCursors();
-  XDefineCursor(dpy, win(), dotCursor);
+  setNoCursor();
   im = new TXImage(dpy, width(), height());
   if (!serverPF.trueColour)
     im->setPF(serverPF);
@@ -139,12 +139,9 @@
     if (((rdr::U8*)mask)[i]) break;
 
   if (i == mask_len) {
-    if (dotWhenNoCursor) {
+    if (dotWhenNoCursor)
       vlog.debug("cursor is empty - using dot");
-      XDefineCursor(dpy, win(), dotCursor);
-    } else {
-      XDefineCursor(dpy, win(), noCursor);
-    }
+    setNoCursor();
     cursorAvailable = false;
     return;
   }
@@ -206,7 +203,7 @@
 void DesktopWindow::resetLocalCursor()
 {
   hideLocalCursor();
-  XDefineCursor(dpy, win(), dotCursor);
+  setNoCursor();
   cursorAvailable = false;
 }
 
@@ -226,7 +223,7 @@
     if (!getPF().equal(cursor.getPF()) ||
         cursor.getRect().is_empty()) {
       vlog.error("attempting to render invalid local cursor");
-      XDefineCursor(dpy, win(), dotCursor);
+      setNoCursor();
       cursorAvailable = false;
       return;
     }