/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
* Copyright 2009-2013 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2011-2013 D. R. Commander. All Rights Reserved.
- * Copyright (C) 2011-2014 Brian P. Hinz
+ * Copyright (C) 2011-2015 Brian P. Hinz
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
menu.fullScreen.setEnabled(s);
menu.newConn.setEnabled(s);
options.fullScreen.setEnabled(s);
+ options.fullScreenAllMonitors.setEnabled(s);
options.scalingFactor.setEnabled(s);
}
}
private void reconfigureViewport() {
- //viewport.setMaxSize(cp.width, cp.height);
boolean pack = true;
- Dimension dpySize = viewport.getToolkit().getScreenSize();
+ Dimension dpySize = viewport.getScreenSize();
desktop.setScaledSize();
int w = desktop.scaledWidth;
int h = desktop.scaledHeight;
if (fullScreen) {
- viewport.setExtendedState(JFrame.MAXIMIZED_BOTH);
- viewport.setGeometry(0, 0, dpySize.width, dpySize.height, false);
- Viewport.setFullScreenWindow(viewport);
+ if (!viewer.fullScreenAllMonitors.getValue())
+ viewport.setExtendedState(JFrame.MAXIMIZED_BOTH);
+ viewport.setBounds(viewport.getScreenBounds());
+ if (!viewer.fullScreenAllMonitors.getValue())
+ Viewport.setFullScreenWindow(viewport);
} else {
int wmDecorationWidth = viewport.getInsets().left + viewport.getInsets().right;
int wmDecorationHeight = viewport.getInsets().top + viewport.getInsets().bottom;
}
options.fullScreen.setSelected(fullScreen);
+ options.fullScreenAllMonitors.setSelected(viewer.fullScreenAllMonitors.getValue());
options.useLocalCursor.setSelected(viewer.useLocalCursor.getValue());
options.acceptBell.setSelected(viewer.acceptBell.getValue());
String scaleString = viewer.scalingFactor.getValue();
String desktopSize = (options.desktopSize.isSelected()) ?
options.desktopWidth.getText() + "x" + options.desktopHeight.getText() : "";
viewer.desktopSize.setParam(desktopSize);
- if (options.fullScreen.isSelected() ^ fullScreen)
+ if (options.fullScreen.isSelected() ^ fullScreen) {
+ viewer.fullScreenAllMonitors.setParam(options.fullScreenAllMonitors.isSelected());
toggleFullScreen();
+ } else {
+ if (viewer.fullScreenAllMonitors.getValue() !=
+ options.fullScreenAllMonitors.isSelected()) {
+ viewer.fullScreenAllMonitors.setParam(options.fullScreenAllMonitors.isSelected());
+ if (desktop != null)
+ recreateViewport();
+ } else {
+ viewer.fullScreenAllMonitors.setParam(options.fullScreenAllMonitors.isSelected());
+ }
+ }
}
public void toggleFullScreen() {
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
- * Copyright (C) 2011-2014 Brian P. Hinz
+ * Copyright (C) 2011-2015 Brian P. Hinz
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
JRadioButton zrle, hextile, tight, raw;
JRadioButton fullColour, mediumColour, lowColour, veryLowColour;
JCheckBox viewOnly, acceptClipboard, sendClipboard, acceptBell;
- JCheckBox desktopSize, fullScreen, shared, useLocalCursor;
+ JCheckBox desktopSize, fullScreen, fullScreenAllMonitors, shared, useLocalCursor;
JCheckBox secVeNCrypt, encNone, encTLS, encX509;
JCheckBox secNone, secVnc, secPlain, secIdent, sendLocalUsername;
JButton okButton, cancelButton;
fullScreen = new JCheckBox("Full-screen mode");
fullScreen.addItemListener(this);
fullScreen.setEnabled(!cc.viewer.embed.getValue());
+ fullScreenAllMonitors = new JCheckBox("Enable full-screen mode over all monitors");
+ fullScreenAllMonitors.addItemListener(this);
+ fullScreenAllMonitors.setEnabled(!cc.viewer.embed.getValue());
JLabel scalingFactorLabel = new JLabel("Scaling Factor");
Object[] scalingFactors = {
"Auto", "Fixed Aspect Ratio", "50%", "75%", "95%", "100%", "105%",
addGBComponent(desktopSize,ScreenPanel, 0, 0, 2, 1, 2, 2, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.LINE_START, new Insets(4,5,0,5));
addGBComponent(desktopSizePanel,ScreenPanel, 0, 1, 2, 1, 2, 2, 1, 0, GridBagConstraints.REMAINDER, GridBagConstraints.LINE_START, new Insets(0,20,0,0));
addGBComponent(fullScreen,ScreenPanel, 0, 2, 2, 1, 2, 2, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.LINE_START, new Insets(0,5,0,5));
+ addGBComponent(fullScreenAllMonitors,ScreenPanel, 0, 3, 4, 1, 2, 2, 1, 0, GridBagConstraints.REMAINDER, GridBagConstraints.LINE_START, new Insets(4,25,0,5));
addGBComponent(scalingFactorLabel,ScreenPanel, 0, 4, 1, GridBagConstraints.REMAINDER, 2, 2, 1, 1, GridBagConstraints.NONE, GridBagConstraints.FIRST_LINE_START, new Insets(8,8,0,5));
addGBComponent(scalingFactor,ScreenPanel, 1, 4, 1, GridBagConstraints.REMAINDER, 2, 2, 25, 1, GridBagConstraints.NONE, GridBagConstraints.FIRST_LINE_START, new Insets(4,5,0,5));
veryLowColour.setEnabled(!autoSelect.isSelected());
compressLevel.setEnabled(customCompressLevel.isSelected());
qualityLevel.setEnabled(noJpeg.isSelected());
+ fullScreenAllMonitors.setEnabled(fullScreen.isSelected());
sendLocalUsername.setEnabled(secVeNCrypt.isEnabled()&&
(secPlain.isSelected()||secIdent.isSelected()));
}
desktopSize.isSelected() ? desktopWidth.getText() + "x" + desktopHeight.getText() : "";
UserPreferences.set("global", "DesktopSize", desktopSizeString);
UserPreferences.set("global", "FullScreen", fullScreen.isSelected());
+ UserPreferences.set("global", "FullScreenAllMonitors", fullScreenAllMonitors.isSelected());
UserPreferences.set("global", "Shared", shared.isSelected());
UserPreferences.set("global", "UseLocalCursor", useLocalCursor.isSelected());
UserPreferences.set("global", "AcceptBell", acceptBell.isSelected());
desktopHeight.setText(desktopSizeString.split("x")[1]);
}
fullScreen.setSelected(UserPreferences.getBool("global", "FullScreen"));
+ fullScreenAllMonitors.setSelected(UserPreferences.getBool("global", "FullScreenAllMonitors"));
if (shared.isEnabled())
shared.setSelected(UserPreferences.getBool("global", "Shared"));
useLocalCursor.setSelected(UserPreferences.getBool("global", "UseLocalCursor"));
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
- * Copyright (C) 2011-2014 Brian P. Hinz
+ * Copyright (C) 2011-2015 Brian P. Hinz
* Copyright (C) 2012-2013 D. R. Commander. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Image;
+import java.awt.Insets;
import java.awt.Window;
import java.lang.reflect.*;
import javax.swing.*;
import com.tigervnc.rfb.*;
import java.lang.Exception;
+import java.awt.Rectangle;
public class Viewport extends JFrame
{
setLocation(x, y);
}
+ public Dimension getScreenSize() {
+ return getScreenBounds().getSize();
+ }
+
+ public Rectangle getScreenBounds() {
+ GraphicsEnvironment ge =
+ GraphicsEnvironment.getLocalGraphicsEnvironment();
+ Rectangle r = new Rectangle();
+ setMaximizedBounds(null);
+ if (cc.viewer.fullScreenAllMonitors.getValue()) {
+ for (GraphicsDevice gd : ge.getScreenDevices())
+ for (GraphicsConfiguration gc : gd.getConfigurations())
+ r = r.union(gc.getBounds());
+ if (!cc.fullScreen)
+ pack();
+ Rectangle mb = new Rectangle(r);
+ mb.grow(getInsets().left, getInsets().bottom);
+ setMaximizedBounds(mb);
+ } else {
+ GraphicsDevice gd = ge.getDefaultScreenDevice();
+ GraphicsConfiguration gc = gd.getDefaultConfiguration();
+ r = gc.getBounds();
+ }
+ return r;
+ }
+
public static Window getFullScreenWindow() {
GraphicsEnvironment ge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
* Copyright 2011 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2011-2013 D. R. Commander. All Rights Reserved.
- * Copyright (C) 2011-2014 Brian P. Hinz
+ * Copyright (C) 2011-2015 Brian P. Hinz
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
public static final String aboutText = new String("TigerVNC Java Viewer v%s (%s)%n"+
"Built on %s at %s%n"+
- "Copyright (C) 1999-2013 TigerVNC Team and many others (see README.txt)%n"+
+ "Copyright (C) 1999-2015 TigerVNC Team and many others (see README.txt)%n"+
"See http://www.tigervnc.org for information on TigerVNC.");
public static String version = null;
= new BoolParameter("FullScreen",
"Full Screen Mode",
false);
+ BoolParameter fullScreenAllMonitors
+ = new BoolParameter("FullScreenAllMonitors",
+ "Enable full screen over all monitors",
+ true);
BoolParameter acceptClipboard
= new BoolParameter("AcceptClipboard",
"Accept clipboard changes from the server",