aboutsummaryrefslogtreecommitdiffstats
path: root/java/com/tigervnc/vncviewer/CConn.java
diff options
context:
space:
mode:
authorBrian Hinz <bphinz@users.sourceforge.net>2013-12-01 23:07:07 +0000
committerBrian Hinz <bphinz@users.sourceforge.net>2013-12-01 23:07:07 +0000
commit48ce3621d181e74855f9aacc99dc5726752ab7ff (patch)
treeee9fc9246a94499a1e044fa723960cb99dc7cf57 /java/com/tigervnc/vncviewer/CConn.java
parent0a281c8d280793344484b8508b49added6127f0a (diff)
downloadtigervnc-48ce3621d181e74855f9aacc99dc5726752ab7ff.tar.gz
tigervnc-48ce3621d181e74855f9aacc99dc5726752ab7ff.zip
Copied Lion fullScreen code from TurboVNC viewer. This is a more robust implementation and does not suffer from Java bugs 8009911 or 4783448 like the existing code did. CMakeLists file was also updated to be more similar to the TurboVNC cmake file. This wasn't strictly necessary but it simplifies things a bit.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5142 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'java/com/tigervnc/vncviewer/CConn.java')
-rw-r--r--java/com/tigervnc/vncviewer/CConn.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/java/com/tigervnc/vncviewer/CConn.java b/java/com/tigervnc/vncviewer/CConn.java
index 15521aa5..805d8328 100644
--- a/java/com/tigervnc/vncviewer/CConn.java
+++ b/java/com/tigervnc/vncviewer/CConn.java
@@ -513,14 +513,10 @@ 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);
+ Viewport.setFullScreenWindow(viewport);
} else {
int wmDecorationWidth = viewport.getInsets().left + viewport.getInsets().right;
int wmDecorationHeight = viewport.getInsets().top + viewport.getInsets().bottom;
@@ -545,8 +541,7 @@ public class CConn extends CConnection
viewport.setExtendedState(JFrame.NORMAL);
viewport.setGeometry(x, y, w, h, pack);
}
- if (gd.isFullScreenSupported())
- gd.setFullScreenWindow(null);
+ Viewport.setFullScreenWindow(null);
}
}
@@ -1140,8 +1135,13 @@ public class CConn extends CConnection
public void toggleFullScreen() {
fullScreen = !fullScreen;
menu.fullScreen.setSelected(fullScreen);
- if (viewport != null)
- recreateViewport();
+ if (viewport != null) {
+ if (!viewport.lionFSSupported()) {
+ recreateViewport();
+ } else {
+ viewport.toggleLionFS();
+ }
+ }
}
// writeClientCutText() is called from the clipboard dialog