summaryrefslogtreecommitdiffstats
path: root/common/rfb/VNCServerST.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2009-03-20 21:46:12 +0000
committerPierre Ossman <ossman@cendio.se>2009-03-20 21:46:12 +0000
commit34e62f347fa5352d704f864baa0639f94e674516 (patch)
tree937ae797591e16e014c71c8202fea59e6d876526 /common/rfb/VNCServerST.cxx
parentc5415d0e7f76d4bdfc0d35b9e8fdf79870e9f5f5 (diff)
downloadtigervnc-34e62f347fa5352d704f864baa0639f94e674516.tar.gz
tigervnc-34e62f347fa5352d704f864baa0639f94e674516.zip
Basic book keeping of screen layout on server.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3706 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/rfb/VNCServerST.cxx')
-rw-r--r--common/rfb/VNCServerST.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx
index 5da6e713..edd5fc37 100644
--- a/common/rfb/VNCServerST.cxx
+++ b/common/rfb/VNCServerST.cxx
@@ -263,6 +263,31 @@ void VNCServerST::setPixelBuffer(PixelBuffer* pb_)
cursor.setPF(pb->getPF());
renderedCursor.setPF(pb->getPF());
+ 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;
for (ci=clients.begin();ci!=clients.end();ci=ci_next) {
ci_next = ci; ci_next++;