Revision: 4925
          http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4925&view=rev
Author:   ossman_
Date:     2012-07-04 11:37:10 +0000 (Wed, 04 Jul 2012)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/vncviewer/Viewport.cxx

Modified: trunk/vncviewer/Viewport.cxx
===================================================================
--- trunk/vncviewer/Viewport.cxx        2012-07-04 11:27:47 UTC (rev 4924)
+++ trunk/vncviewer/Viewport.cxx        2012-07-04 11:37:10 UTC (rev 4925)
@@ -63,7 +63,8 @@
 
 // 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 @@
   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 @@
     }
     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;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Tigervnc-commits mailing list
Tigervnc-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits

Reply via email to