diff options
author | Pierre Ossman <ossman@cendio.se> | 2009-03-20 22:05:08 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2009-03-20 22:05:08 +0000 |
commit | d85ea3e1992b4415eab63c343a892b0f7dd50db4 (patch) | |
tree | c17f9e47f4ce246bd1d7cefcf794923dd921bd86 /common/rfb | |
parent | 34e62f347fa5352d704f864baa0639f94e674516 (diff) | |
download | tigervnc-d85ea3e1992b4415eab63c343a892b0f7dd50db4.tar.gz tigervnc-d85ea3e1992b4415eab63c343a892b0f7dd50db4.zip |
Move screen layout bootstraping around so that it can handle if all screens
are purged on framebuffer resize.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3707 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/rfb')
-rw-r--r-- | common/rfb/VNCServerST.cxx | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx index edd5fc37..7edac56b 100644 --- a/common/rfb/VNCServerST.cxx +++ b/common/rfb/VNCServerST.cxx @@ -263,29 +263,29 @@ void VNCServerST::setPixelBuffer(PixelBuffer* pb_) cursor.setPF(pb->getPF()); renderedCursor.setPF(pb->getPF()); + // Check that the screen layout is still valid + if (!screenLayout.validate(pb->width(), pb->height())) { + Rect fbRect; + ScreenSet::iterator iter, iter_next; + + fbRect.setXYWH(0, 0, pb->width(), pb->height()); + + for (iter = screenLayout.begin();iter != screenLayout.end();iter = iter_next) { + iter_next = iter; ++iter_next; + if (iter->dimensions.enclosed_by(fbRect)) + continue; + iter->dimensions = iter->dimensions.intersect(fbRect); + if (iter->dimensions.is_empty()) { + slog.info("Removing screen %d (%x) as it is completely outside the new framebuffer", + (int)iter->id, (unsigned)iter->id); + screenLayout.remove_screen(iter->id); + } + } + } + if (screenLayout.num_screens() == 0) { // Boot strap the screen layout screenLayout.add_screen(Screen(0, 0, 0, pb->width(), pb->height(), 0)); - } else { - // Check that the screen layout is still valid - if (!screenLayout.validate(pb->width(), pb->height())) { - Rect fbRect; - ScreenSet::iterator iter, iter_next; - - fbRect.setXYWH(0, 0, pb->width(), pb->height()); - - for (iter = screenLayout.begin();iter != screenLayout.end();iter = iter_next) { - iter_next = iter; ++iter_next; - if (iter->dimensions.enclosed_by(fbRect)) - continue; - iter->dimensions = iter->dimensions.intersect(fbRect); - if (iter->dimensions.is_empty()) { - slog.info("Removing screen %d (%x) as it is completely outside the new framebuffer", - (int)iter->id, (unsigned)iter->id); - screenLayout.remove_screen(iter->id); - } - } - } } std::list<VNCSConnectionST*>::iterator ci, ci_next; |