Revision: 4957
          http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4957&view=rev
Author:   ossman_
Date:     2012-08-23 14:40:52 +0000 (Thu, 23 Aug 2012)
Log Message:
-----------
Avoid doing a lot of resize related things if we're not actually resizing.

Modified Paths:
--------------
    trunk/vncviewer/DesktopWindow.cxx

Modified: trunk/vncviewer/DesktopWindow.cxx
===================================================================
--- trunk/vncviewer/DesktopWindow.cxx   2012-08-17 13:37:42 UTC (rev 4956)
+++ trunk/vncviewer/DesktopWindow.cxx   2012-08-23 14:40:52 UTC (rev 4957)
@@ -210,24 +210,33 @@
 
 void DesktopWindow::resize(int x, int y, int w, int h)
 {
+  bool resizing;
+
+  if ((this->w() != w) || (this->h() != h))
+    resizing = true;
+  else
+    resizing = false;
+
   Fl_Window::resize(x, y, w, h);
 
-  // Try to get the remote size to match our window size, provided
-  // the following conditions are true:
-  //
-  // a) The user has this feature turned on
-  // b) The server supports it
-  // c) We're not still waiting for a chance to handle DesktopSize
-  //
-  if (not firstUpdate and ::remoteResize and cc->cp.supportsSetDesktopSize) {
-    // We delay updating the remote desktop as we tend to get a flood
-    // of resize events as the user is dragging the window.
-    Fl::remove_timeout(handleResizeTimeout, this);
-    Fl::add_timeout(0.5, handleResizeTimeout, this);
+  if (resizing) {
+    // Try to get the remote size to match our window size, provided
+    // the following conditions are true:
+    //
+    // a) The user has this feature turned on
+    // b) The server supports it
+    // c) We're not still waiting for a chance to handle DesktopSize
+    //
+    if (not firstUpdate and ::remoteResize and cc->cp.supportsSetDesktopSize) {
+      // We delay updating the remote desktop as we tend to get a flood
+      // of resize events as the user is dragging the window.
+      Fl::remove_timeout(handleResizeTimeout, this);
+      Fl::add_timeout(0.5, handleResizeTimeout, this);
+    }
+
+    // Deal with some scrolling corner cases
+    repositionViewport();
   }
-
-  // Deal with some scrolling corner cases
-  repositionViewport();
 }
 
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Tigervnc-commits mailing list
Tigervnc-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits

Reply via email to