Revision: 4970
          http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4970&view=rev
Author:   bphinz
Date:     2012-08-26 21:17:00 +0000 (Sun, 26 Aug 2012)
Log Message:
-----------
Make the window actually occupy the full screen in full-screen mode (without 
this, other windows, such as the taskbar on Linux, will display in front of 
it.). Additional fixes for various full-screen mode issues (Setting FullScreen 
checkbox in options menu had no effect,  null pointer, etc.  When fullScreen 
and scaling options are changed simultaneously in the dialog, collapse the 
viewport changes into a single operation.  There is still a modality issue on 
OS-X that will be addressed in a later patch.

Modified Paths:
--------------
    trunk/java/com/tigervnc/vncviewer/CConn.java

Modified: trunk/java/com/tigervnc/vncviewer/CConn.java
===================================================================
--- trunk/java/com/tigervnc/vncviewer/CConn.java        2012-08-26 21:04:39 UTC 
(rev 4969)
+++ trunk/java/com/tigervnc/vncviewer/CConn.java        2012-08-26 21:17:00 UTC 
(rev 4970)
@@ -522,9 +522,14 @@
     desktop.setScaledSize();
     int w = desktop.scaledWidth;
     int h = desktop.scaledHeight;
+    GraphicsEnvironment ge =
+      GraphicsEnvironment.getLocalGraphicsEnvironment();
+    GraphicsDevice gd = ge.getDefaultScreenDevice();
     if (fullScreen) {
       viewport.setExtendedState(JFrame.MAXIMIZED_BOTH);
       viewport.setGeometry(0, 0, dpySize.width, dpySize.height, false);
+      if (gd.isFullScreenSupported())
+        gd.setFullScreenWindow(viewport);
     } else {
       int wmDecorationWidth = viewport.getInsets().left + 
viewport.getInsets().right;
       int wmDecorationHeight = viewport.getInsets().top + 
viewport.getInsets().bottom;
@@ -549,6 +554,8 @@
         viewport.setExtendedState(JFrame.NORMAL);
         viewport.setGeometry(x, y, w, h, pack);
       }
+      if (gd.isFullScreenSupported())
+        gd.setFullScreenWindow(null);
     }
   }
 
@@ -958,13 +965,13 @@
     if (scaleString.equalsIgnoreCase("Auto")) {
       if (!oldScaleFactor.equals(scaleString)) {
       viewer.scalingFactor.setParam("Auto");
-        if (desktop != null)
+        if (desktop != null && !(options.fullScreen.isSelected() && 
fullScreen))
           reconfigureViewport();
       }
     } else if(scaleString.equalsIgnoreCase("Fixed Aspect Ratio")) {
       if (!oldScaleFactor.equalsIgnoreCase("FixedRatio")) {
         viewer.scalingFactor.setParam("FixedRatio");
-        if (desktop != null)
+        if (desktop != null && !(options.fullScreen.isSelected() && 
fullScreen))
           reconfigureViewport();
       }
     } else { 
@@ -973,7 +980,8 @@
         viewer.scalingFactor.setParam(scaleString);
         if ((desktop != null) && (!oldScaleFactor.equalsIgnoreCase("Auto") ||
             !oldScaleFactor.equalsIgnoreCase("FixedRatio"))) {
-          reconfigureViewport();
+          if (!(options.fullScreen.isSelected() && fullScreen))
+            reconfigureViewport();
         }
       }
     }
@@ -1104,12 +1112,15 @@
       CSecurityTLS.x509ca.setParam(options.ca.getText());
       CSecurityTLS.x509crl.setParam(options.crl.getText());
     }
+    if (options.fullScreen.isSelected() ^ fullScreen)
+      toggleFullScreen();
   }
 
   public void toggleFullScreen() {
     fullScreen = !fullScreen;
     if (!fullScreen) menu.fullScreen.setSelected(false);
-    recreateViewport();
+    if (viewport != null)
+      recreateViewport();
   }
 
   // writeClientCutText() is called from the clipboard dialog

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