Revision: 4392
http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4392&view=rev
Author: ossman_
Date: 2011-04-29 11:18:12 +0000 (Fri, 29 Apr 2011)
Log Message:
-----------
Implement menu entry for forced refresh of screen.
Modified Paths:
--------------
trunk/vncviewer/CConn.cxx
trunk/vncviewer/CConn.h
trunk/vncviewer/Viewport.cxx
Modified: trunk/vncviewer/CConn.cxx
===================================================================
--- trunk/vncviewer/CConn.cxx 2011-04-29 11:12:02 UTC (rev 4391)
+++ trunk/vncviewer/CConn.cxx 2011-04-29 11:18:12 UTC (rev 4392)
@@ -48,7 +48,8 @@
: serverHost(0), serverPort(0), sock(NULL), desktop(NULL),
currentEncoding(encodingTight), lastServerEncoding((unsigned int)-1),
formatChange(false), encodingChange(false),
- firstUpdate(true), pendingUpdate(false)
+ firstUpdate(true), pendingUpdate(false),
+ forceNonincremental(false)
{
setShared(::shared);
@@ -98,6 +99,14 @@
delete sock;
}
+void CConn::refreshFramebuffer()
+{
+ // FIXME: We cannot safely trigger an update request directly but must
+ // wait for the next update to arrive.
+ if (!formatChange)
+ forceNonincremental = true;
+}
+
// The RFB core is not properly asynchronous, so it calls this callback
// whenever it needs to block to wait for more data. Since FLTK is
// monitoring the socket, we just make sure FLTK gets to run.
@@ -442,9 +451,16 @@
desktop->setServerPF(pf);
cp.setPF(pf);
writer()->writeSetPixelFormat(pf);
+
+ forceNonincremental = true;
+
+ formatChange = false;
}
+
checkEncodings();
+
writer()->writeFramebufferUpdateRequest(Rect(0, 0, cp.width, cp.height),
- !formatChange);
- formatChange = false;
+ !forceNonincremental);
+
+ forceNonincremental = false;
}
Modified: trunk/vncviewer/CConn.h
===================================================================
--- trunk/vncviewer/CConn.h 2011-04-29 11:12:02 UTC (rev 4391)
+++ trunk/vncviewer/CConn.h 2011-04-29 11:18:12 UTC (rev 4392)
@@ -32,6 +32,8 @@
CConn(const char* vncServerName);
~CConn();
+ void refreshFramebuffer();
+
// FdInStreamBlockCallback methods
void blockCallback();
@@ -91,6 +93,8 @@
bool firstUpdate;
bool pendingUpdate;
+
+ bool forceNonincremental;
};
#endif
Modified: trunk/vncviewer/Viewport.cxx
===================================================================
--- trunk/vncviewer/Viewport.cxx 2011-04-29 11:12:02 UTC (rev 4391)
+++ trunk/vncviewer/Viewport.cxx 2011-04-29 11:18:12 UTC (rev 4392)
@@ -56,7 +56,8 @@
// Menu constants
-enum { ID_EXIT, ID_CTRL, ID_ALT, ID_MENUKEY, ID_CTRLALTDEL, ID_DISMISS };
+enum { ID_EXIT, ID_CTRL, ID_ALT, ID_MENUKEY, ID_CTRLALTDEL,
+ ID_REFRESH, ID_DISMISS };
Viewport::Viewport(int w, int h, const rfb::PixelFormat& serverPF, CConn* cc_)
: Fl_Widget(0, 0, w, h), cc(cc_), frameBuffer(NULL), pixelTrans(NULL),
@@ -520,6 +521,8 @@
contextMenu->add("Secret shortcut menu key", FL_F + 8, NULL,
(void*)ID_MENUKEY, FL_MENU_INVISIBLE); // Broken, see STR2613
contextMenu->add(_("Send Ctrl-Alt-Del"), 0, NULL, (void*)ID_CTRLALTDEL,
FL_MENU_DIVIDER);
+ contextMenu->add(_("Refresh screen"), 0, NULL, (void*)ID_REFRESH,
FL_MENU_DIVIDER);
+
contextMenu->add(_("Dismiss menu"), 0, NULL, (void*)ID_DISMISS, 0);
}
@@ -563,6 +566,9 @@
cc->writer()->keyEvent(XK_Control_L, false);
}
break;
+ case ID_REFRESH:
+ cc->refreshFramebuffer();
+ break;
case ID_DISMISS:
// Don't need to do anything
break;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Tigervnc-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits