Avoid doing a lot of resize related things if we're not actually resizing.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4957 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx
index 89398ba..0894275 100644
--- a/vncviewer/DesktopWindow.cxx
+++ b/vncviewer/DesktopWindow.cxx
@@ -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();
+ }
}