diff options
author | Pierre Ossman <ossman@cendio.se> | 2012-07-04 11:37:10 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2012-07-04 11:37:10 +0000 |
commit | 8dc8bca97465f752e3f008b1ee38ff0dae1bfab5 (patch) | |
tree | b94777fc8f20cde941706d18f6f1754268354f7f | |
parent | ff473402c15c45e3a501508d65dcb781d9aa8f44 (diff) | |
download | tigervnc-8dc8bca97465f752e3f008b1ee38ff0dae1bfab5.tar.gz tigervnc-8dc8bca97465f752e3f008b1ee38ff0dae1bfab5.zip |
Add menu entry to have the local window match the size of the remote desktop.
This is useful now that we no longer have size restrictions on the window.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4925 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | vncviewer/Viewport.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index 0cfeeda1..1e4468b5 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -63,7 +63,8 @@ static rfb::LogWriter vlog("Viewport"); // Menu constants -enum { ID_EXIT, ID_FULLSCREEN, ID_CTRL, ID_ALT, ID_MENUKEY, ID_CTRLALTDEL, +enum { ID_EXIT, ID_FULLSCREEN, ID_RESIZE, + ID_CTRL, ID_ALT, ID_MENUKEY, ID_CTRLALTDEL, ID_REFRESH, ID_OPTIONS, ID_INFO, ID_ABOUT, ID_DISMISS }; Viewport::Viewport(int w, int h, const rfb::PixelFormat& serverPF, CConn* cc_) @@ -850,6 +851,11 @@ void Viewport::initContextMenu() contextMenu->add(_("Full screen"), 0, NULL, (void*)ID_FULLSCREEN, FL_MENU_TOGGLE | (window()->fullscreen_active()?FL_MENU_VALUE:0)); #endif + contextMenu->add(_("Resize window to session"), 0, NULL, (void*)ID_RESIZE, +#ifdef HAVE_FLTK_FULLSCREEN + (window()->fullscreen_active()?FL_MENU_INACTIVE:0) | +#endif + FL_MENU_DIVIDER); contextMenu->add(_("Ctrl"), 0, NULL, (void*)ID_CTRL, FL_MENU_TOGGLE | (menuCtrlKey?FL_MENU_VALUE:0)); @@ -920,6 +926,13 @@ void Viewport::popupContextMenu() } break; #endif + case ID_RESIZE: +#ifdef HAVE_FLTK_FULLSCREEN + if (window()->fullscreen_active()) + break; +#endif + window()->size(w(), h()); + break; case ID_CTRL: handleKeyEvent(FL_Control_L, FL_Control_L, "", m->value()); menuCtrlKey = !menuCtrlKey; |