Procházet zdrojové kódy

Implement menu entry for forced refresh of screen.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4392 3789f03b-4d11-0410-bbf8-ca57d06f2519
tags/v1.1.90
Pierre Ossman před 13 roky
rodič
revize
d4c61ce93b
3 změnil soubory, kde provedl 30 přidání a 4 odebrání
  1. 19
    3
      vncviewer/CConn.cxx
  2. 4
    0
      vncviewer/CConn.h
  3. 7
    1
      vncviewer/Viewport.cxx

+ 19
- 3
vncviewer/CConn.cxx Zobrazit soubor

: serverHost(0), serverPort(0), sock(NULL), desktop(NULL), : serverHost(0), serverPort(0), sock(NULL), desktop(NULL),
currentEncoding(encodingTight), lastServerEncoding((unsigned int)-1), currentEncoding(encodingTight), lastServerEncoding((unsigned int)-1),
formatChange(false), encodingChange(false), formatChange(false), encodingChange(false),
firstUpdate(true), pendingUpdate(false)
firstUpdate(true), pendingUpdate(false),
forceNonincremental(false)
{ {
setShared(::shared); setShared(::shared);


delete sock; 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 // 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 // whenever it needs to block to wait for more data. Since FLTK is
// monitoring the socket, we just make sure FLTK gets to run. // monitoring the socket, we just make sure FLTK gets to run.
desktop->setServerPF(pf); desktop->setServerPF(pf);
cp.setPF(pf); cp.setPF(pf);
writer()->writeSetPixelFormat(pf); writer()->writeSetPixelFormat(pf);

forceNonincremental = true;

formatChange = false;
} }

checkEncodings(); checkEncodings();

writer()->writeFramebufferUpdateRequest(Rect(0, 0, cp.width, cp.height), writer()->writeFramebufferUpdateRequest(Rect(0, 0, cp.width, cp.height),
!formatChange);
formatChange = false;
!forceNonincremental);
forceNonincremental = false;
} }

+ 4
- 0
vncviewer/CConn.h Zobrazit soubor

CConn(const char* vncServerName); CConn(const char* vncServerName);
~CConn(); ~CConn();


void refreshFramebuffer();

// FdInStreamBlockCallback methods // FdInStreamBlockCallback methods
void blockCallback(); void blockCallback();




bool firstUpdate; bool firstUpdate;
bool pendingUpdate; bool pendingUpdate;

bool forceNonincremental;
}; };


#endif #endif

+ 7
- 1
vncviewer/Viewport.cxx Zobrazit soubor



// Menu constants // 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_) Viewport::Viewport(int w, int h, const rfb::PixelFormat& serverPF, CConn* cc_)
: Fl_Widget(0, 0, w, h), cc(cc_), frameBuffer(NULL), pixelTrans(NULL), : Fl_Widget(0, 0, w, h), cc(cc_), frameBuffer(NULL), pixelTrans(NULL),
contextMenu->add("Secret shortcut menu key", FL_F + 8, NULL, (void*)ID_MENUKEY, FL_MENU_INVISIBLE); // Broken, see STR2613 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(_("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); contextMenu->add(_("Dismiss menu"), 0, NULL, (void*)ID_DISMISS, 0);
} }


cc->writer()->keyEvent(XK_Control_L, false); cc->writer()->keyEvent(XK_Control_L, false);
} }
break; break;
case ID_REFRESH:
cc->refreshFramebuffer();
break;
case ID_DISMISS: case ID_DISMISS:
// Don't need to do anything // Don't need to do anything
break; break;

Načítá se…
Zrušit
Uložit