diff options
author | Pierre Ossman <ossman@cendio.se> | 2012-08-23 14:40:52 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2012-08-23 14:40:52 +0000 |
commit | 9f32e3ca67365ccf9d28bd6e17bb3260cc9f9107 (patch) | |
tree | 0e2cc6dfaae6c30d09f1248eaab5766d97133bda /vncviewer/DesktopWindow.cxx | |
parent | cb9eefabc58f276a17ffc96b755a7ef0f4b44433 (diff) | |
download | tigervnc-9f32e3ca67365ccf9d28bd6e17bb3260cc9f9107.tar.gz tigervnc-9f32e3ca67365ccf9d28bd6e17bb3260cc9f9107.zip |
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
Diffstat (limited to 'vncviewer/DesktopWindow.cxx')
-rw-r--r-- | vncviewer/DesktopWindow.cxx | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index 89398ba9..0894275a 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -210,24 +210,33 @@ void DesktopWindow::setCursor(int width, int height, const Point& hotspot, 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(); + } } |