From 79055f7ba6655efa87a119659ddb290b6d85c9ab Mon Sep 17 00:00:00 2001 From: Brian Hinz Date: Fri, 10 Jan 2014 04:08:20 +0000 Subject: [PATCH] Fixes for modality issues & dialog behavior in embedded mode. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5154 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- java/com/tigervnc/vncviewer/CConn.java | 2 ++ java/com/tigervnc/vncviewer/Dialog.java | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/java/com/tigervnc/vncviewer/CConn.java b/java/com/tigervnc/vncviewer/CConn.java index b876751c..93420512 100644 --- a/java/com/tigervnc/vncviewer/CConn.java +++ b/java/com/tigervnc/vncviewer/CConn.java @@ -794,6 +794,7 @@ public class CConn extends CConnection implements JOptionPane.DEFAULT_OPTION, VncViewer.logoIcon); JDialog dlg = op.createDialog(desktop, "About TigerVNC Viewer for Java"); dlg.setIconImage(VncViewer.frameIcon); + dlg.setAlwaysOnTop(true); dlg.setVisible(true); if (fullScreenWindow != null) Viewport.setFullScreenWindow(fullScreenWindow); @@ -829,6 +830,7 @@ public class CConn extends CConnection implements JOptionPane.DEFAULT_OPTION); JDialog dlg = op.createDialog(desktop, "VNC connection info"); dlg.setIconImage(VncViewer.frameIcon); + dlg.setAlwaysOnTop(true); dlg.setVisible(true); if (fullScreenWindow != null) Viewport.setFullScreenWindow(fullScreenWindow); diff --git a/java/com/tigervnc/vncviewer/Dialog.java b/java/com/tigervnc/vncviewer/Dialog.java index 41301232..4b82eb93 100644 --- a/java/com/tigervnc/vncviewer/Dialog.java +++ b/java/com/tigervnc/vncviewer/Dialog.java @@ -1,5 +1,5 @@ /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - * Copyright (C) 2011-2013 Brian P. Hinz + * Copyright (C) 2011-2014 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 @@ -58,9 +58,9 @@ class Dialog extends JDialog { if (fullScreenWindow != null) Viewport.setFullScreenWindow(null); + if (getModalityType() == ModalityType.APPLICATION_MODAL) + setAlwaysOnTop(true); setVisible(true); - setFocusable(true); - setAlwaysOnTop(true); return ret; } @@ -70,7 +70,6 @@ class Dialog extends JDialog { public void endDialog() { setVisible(false); - setFocusable(false); setAlwaysOnTop(false); fullScreenWindow = Viewport.getFullScreenWindow(); if (fullScreenWindow != null) -- 2.39.5