summaryrefslogtreecommitdiffstats
path: root/java/com
diff options
context:
space:
mode:
authorBrian Hinz <bphinz@users.sourceforge.net>2012-08-26 21:17:00 +0000
committerBrian Hinz <bphinz@users.sourceforge.net>2012-08-26 21:17:00 +0000
commit244cab2172821d2081016a8cfdfba2059ee9b4e5 (patch)
treea8e37b0d1c5066edbf7605b37e7174a0da9f2427 /java/com
parent9fa671aca7fd3d0e14a0ccede24f1303e20f0ad2 (diff)
downloadtigervnc-244cab2172821d2081016a8cfdfba2059ee9b4e5.tar.gz
tigervnc-244cab2172821d2081016a8cfdfba2059ee9b4e5.zip
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.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4970 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'java/com')
-rw-r--r--java/com/tigervnc/vncviewer/CConn.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/java/com/tigervnc/vncviewer/CConn.java b/java/com/tigervnc/vncviewer/CConn.java
index cd547aba..abe10dd5 100644
--- a/java/com/tigervnc/vncviewer/CConn.java
+++ b/java/com/tigervnc/vncviewer/CConn.java
@@ -522,9 +522,14 @@ public class CConn extends CConnection
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 @@ public class CConn extends CConnection
viewport.setExtendedState(JFrame.NORMAL);
viewport.setGeometry(x, y, w, h, pack);
}
+ if (gd.isFullScreenSupported())
+ gd.setFullScreenWindow(null);
}
}
@@ -958,13 +965,13 @@ public class CConn extends CConnection
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 @@ public class CConn extends CConnection
viewer.scalingFactor.setParam(scaleString);
if ((desktop != null) && (!oldScaleFactor.equalsIgnoreCase("Auto") ||
!oldScaleFactor.equalsIgnoreCase("FixedRatio"))) {
- reconfigureViewport();
+ if (!(options.fullScreen.isSelected() && fullScreen))
+ reconfigureViewport();
}
}
}
@@ -1104,12 +1112,15 @@ public class CConn extends CConnection
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