]> source.dussan.org Git - tigervnc.git/commitdiff
Implement full screen support in new vncviewer.
authorPierre Ossman <ossman@cendio.se>
Thu, 26 May 2011 14:14:06 +0000 (14:14 +0000)
committerPierre Ossman <ossman@cendio.se>
Thu, 26 May 2011 14:14:06 +0000 (14:14 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4447 3789f03b-4d11-0410-bbf8-ca57d06f2519

CMakeLists.txt
config.h.cmake.in
vncviewer/Viewport.cxx

index b696e70a178dc3f9d0b9ffa02d15b903a75ca774..f3cb208cdbf00a81957f2d9adb379b41bba6125a 100644 (file)
@@ -200,6 +200,9 @@ if(BUILD_NEW_VNCVIEWER)
   # FLTK STR #2638
   check_cxx_source_compiles("#include <FL/Enumerations.H>\nint main(int c, char** v) { return FL_Volume_Down; }" HAVE_FLTK_MEDIAKEYS)
 
+  # FLTK STR #2641
+  check_cxx_source_compiles("#include <FL/Enumerations.H>\nint main(int c, char** v) { return FL_FULLSCREEN; }" HAVE_FLTK_FULLSCREEN)
+
   set(CMAKE_REQUIRED_INCLUDES)
   set(CMAKE_REQUIRED_LIBRARIES)
 endif()
index a1654245c72120c1016f48ee8b3792fb228ebeed..91dff67c75a9eaa93f24f79e03ab8f3deb2e122a 100644 (file)
@@ -14,6 +14,7 @@
 #cmakedefine HAVE_FLTK_DEAD_KEYS
 #cmakedefine HAVE_FLTK_CLIPBOARD
 #cmakedefine HAVE_FLTK_MEDIAKEYS
+#cmakedefine HAVE_FLTK_FULLSCREEN
 #cmakedefine ENABLE_NLS 1
 
 /* MS Visual Studio 2008 and newer doesn't know ssize_t */
index 4470a31e0475ab9f428ef803b0a3ff2e4e9378e8..1dff1021178d1cdbc006a1234538e36be477f5f2 100644 (file)
@@ -55,7 +55,7 @@ static rfb::LogWriter vlog("Viewport");
 
 // Menu constants
 
-enum { ID_EXIT, ID_CTRL, ID_ALT, ID_MENUKEY, ID_CTRLALTDEL,
+enum { ID_EXIT, ID_FULLSCREEN, 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_)
@@ -570,6 +570,10 @@ void Viewport::initContextMenu()
 
   contextMenu->add(_("Exit viewer"), 0, NULL, (void*)ID_EXIT, FL_MENU_DIVIDER);
 
+#ifdef HAVE_FLTK_FULLSCREEN
+  contextMenu->add(_("Full screen"), 0, NULL, (void*)ID_FULLSCREEN, FL_MENU_DIVIDER);
+#endif
+
   contextMenu->add(_("Ctrl"), 0, NULL, (void*)ID_CTRL, FL_MENU_TOGGLE);
   contextMenu->add(_("Alt"), 0, NULL, (void*)ID_ALT, FL_MENU_TOGGLE);
 
@@ -607,6 +611,14 @@ void Viewport::popupContextMenu()
   case ID_EXIT:
     exit_vncviewer();
     break;
+#ifdef HAVE_FLTK_FULLSCREEN
+  case ID_FULLSCREEN:
+    if (window()->fullscreen_active())
+      window()->fullscreen_off();
+    else
+      window()->fullscreen();
+    break;
+#endif
   case ID_CTRL:
     if (!viewOnly)
       cc->writer()->keyEvent(XK_Control_L, m->value());