]> source.dussan.org Git - tigervnc.git/commitdiff
Always send current screen layout to client
authorPierre Ossman <ossman@cendio.se>
Mon, 10 Dec 2018 19:16:12 +0000 (20:16 +0100)
committerPierre Ossman <ossman@cendio.se>
Mon, 10 Dec 2018 19:16:12 +0000 (20:16 +0100)
This is what the protocol requires, rather than sending what the
client specified in the request. This should be the same in practice
except for failures and possibly some races.

common/rfb/SMsgWriter.cxx
common/rfb/SMsgWriter.h
common/rfb/VNCSConnectionST.cxx

index 766b0cb307e03a3db317e7067532bef56480cf90..0ca198123a8883e83ee974ffc062bde5f26832d4 100644 (file)
@@ -138,9 +138,7 @@ bool SMsgWriter::writeExtendedDesktopSize() {
   return true;
 }
 
-bool SMsgWriter::writeExtendedDesktopSize(rdr::U16 reason, rdr::U16 result,
-                                          int fb_width, int fb_height,
-                                          const ScreenSet& layout) {
+bool SMsgWriter::writeExtendedDesktopSize(rdr::U16 reason, rdr::U16 result) {
   ExtendedDesktopSizeMsg msg;
 
   if (!client->supportsEncoding(pseudoEncodingExtendedDesktopSize))
@@ -148,9 +146,6 @@ bool SMsgWriter::writeExtendedDesktopSize(rdr::U16 reason, rdr::U16 result,
 
   msg.reason = reason;
   msg.result = result;
-  msg.fb_width = fb_width;
-  msg.fb_height = fb_height;
-  msg.layout = layout;
 
   extendedDesktopSizeMsgs.push_back(msg);
 
@@ -415,7 +410,8 @@ void SMsgWriter::writeNoDataRects()
 
     for (ri = extendedDesktopSizeMsgs.begin();ri != extendedDesktopSizeMsgs.end();++ri) {
       writeExtendedDesktopSizeRect(ri->reason, ri->result,
-                                   ri->fb_width, ri->fb_height, ri->layout);
+                                   client->width(), client->height(),
+                                   client->screenLayout());
     }
 
     extendedDesktopSizeMsgs.clear();
index ddddb0952932188e04c866f13f4704fbd09a20f5..1fe50434e3b89a535cf5803c43a3dca0fbc18452 100644 (file)
@@ -72,9 +72,7 @@ namespace rfb {
     // generic update of the current server state, but the second queues a
     // specific message.
     bool writeExtendedDesktopSize();
-    bool writeExtendedDesktopSize(rdr::U16 reason, rdr::U16 result,
-                                  int fb_width, int fb_height,
-                                  const ScreenSet& layout);
+    bool writeExtendedDesktopSize(rdr::U16 reason, rdr::U16 result);
 
     bool writeSetDesktopName();
 
@@ -159,8 +157,6 @@ namespace rfb {
 
     typedef struct {
       rdr::U16 reason, result;
-      int fb_width, fb_height;
-      ScreenSet layout;
     } ExtendedDesktopSizeMsg;
 
     std::list<ExtendedDesktopSizeMsg> extendedDesktopSizeMsgs;
index 15b2f9ad871f9870d7bd5bd2fc7f87f5ebdcef8c..e4e5ab3e604686a22fb344d7f74d3966b921c5e5 100644 (file)
@@ -716,8 +716,7 @@ void VNCSConnectionST::setDesktopSize(int fb_width, int fb_height,
 
   // Don't bother the desktop with an invalid configuration
   if (!layout.validate(fb_width, fb_height)) {
-    writer()->writeExtendedDesktopSize(reasonClient, resultInvalid,
-                                       fb_width, fb_height, layout);
+    writer()->writeExtendedDesktopSize(reasonClient, resultInvalid);
     return;
   }
 
@@ -726,8 +725,7 @@ void VNCSConnectionST::setDesktopSize(int fb_width, int fb_height,
   // protocol-wise, but unnecessary.
   result = server->desktop->setScreenLayout(fb_width, fb_height, layout);
 
-  writer()->writeExtendedDesktopSize(reasonClient, result,
-                                     fb_width, fb_height, layout);
+  writer()->writeExtendedDesktopSize(reasonClient, result);
 
   // Only notify other clients on success
   if (result == resultSuccess) {
@@ -1127,9 +1125,7 @@ void VNCSConnectionST::screenLayoutChange(rdr::U16 reason)
   if (state() != RFBSTATE_NORMAL)
     return;
 
-  writer()->writeExtendedDesktopSize(reason, 0,
-                                     client.width(), client.height(),
-                                     client.screenLayout());
+  writer()->writeExtendedDesktopSize(reason, 0);
 }