From 0f458e2c3eb93641864085d18e49daf640cb3858 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Thu, 21 Nov 2024 21:24:46 +0000 Subject: [PATCH] 8342903: Deprecate for removal java.awt.Window.getWarningString() Reviewed-by: kizune, erikj, azvegint --- make/modules/java.desktop/Java.gmk | 12 - .../java.desktop/gensrc/GensrcIcons.gmk | 17 - src/demo/share/jfc/Font2DTest/FontPanel.java | 8 +- .../sun/lwawt/LWKeyboardFocusManagerPeer.java | 7 - .../macosx/classes/sun/lwawt/LWToolkit.java | 3 - .../classes/sun/lwawt/LWWindowPeer.java | 68 -- .../sun/lwawt/SecurityWarningWindow.java | 35 - .../classes/sun/lwawt/macosx/CFileDialog.java | 4 - .../sun/lwawt/macosx/CPlatformWindow.java | 2 +- .../sun/lwawt/macosx/CWarningWindow.java | 475 ------------- .../classes/sun/lwawt/macosx/LWCToolkit.java | 7 - .../share/classes/java/awt/Desktop.java | 23 - .../share/classes/java/awt/Window.java | 94 +-- .../classes/java/awt/peer/WindowPeer.java | 5 - .../classes/javax/swing/JInternalFrame.java | 8 +- .../share/classes/sun/awt/AWTAccessor.java | 11 - .../share/classes/sun/awt/AWTPermissions.java | 3 - .../share/classes/sun/awt/EmbeddedFrame.java | 3 - .../sun/awt/resources/security-icon-bw16.png | Bin 463 -> 0 bytes .../sun/awt/resources/security-icon-bw24.png | Bin 682 -> 0 bytes .../sun/awt/resources/security-icon-bw32.png | Bin 795 -> 0 bytes .../sun/awt/resources/security-icon-bw48.png | Bin 1137 -> 0 bytes .../awt/resources/security-icon-interim16.png | Bin 489 -> 0 bytes .../awt/resources/security-icon-interim24.png | Bin 741 -> 0 bytes .../awt/resources/security-icon-interim32.png | Bin 871 -> 0 bytes .../awt/resources/security-icon-interim48.png | Bin 1387 -> 0 bytes .../awt/resources/security-icon-yellow16.png | Bin 477 -> 0 bytes .../awt/resources/security-icon-yellow24.png | Bin 749 -> 0 bytes .../awt/resources/security-icon-yellow32.png | Bin 866 -> 0 bytes .../awt/resources/security-icon-yellow48.png | Bin 1323 -> 0 bytes .../unix/classes/sun/awt/X11/XBaseWindow.java | 7 - .../classes/sun/awt/X11/XDecoratedPeer.java | 4 - .../classes/sun/awt/X11/XEmbedHelper.java | 1 - .../awt/X11/XKeyboardFocusManagerPeer.java | 7 - .../classes/sun/awt/X11/XScrollPanePeer.java | 1 - .../unix/classes/sun/awt/X11/XToolkit.java | 12 - .../classes/sun/awt/X11/XWarningWindow.java | 416 ------------ .../unix/classes/sun/awt/X11/XWindow.java | 4 +- .../unix/classes/sun/awt/X11/XWindowPeer.java | 82 --- .../classes/sun/awt/windows/WWindowPeer.java | 7 - .../windows/native/libawt/windows/awt.rc | 7 - .../native/libawt/windows/awt_Component.cpp | 3 - .../native/libawt/windows/awt_Frame.cpp | 3 - .../native/libawt/windows/awt_Toolkit.cpp | 60 -- .../native/libawt/windows/awt_Toolkit.h | 2 - .../native/libawt/windows/awt_Window.cpp | 635 +----------------- .../native/libawt/windows/awt_Window.h | 57 -- .../libawt/windows/security_warning.ico | Bin 17542 -> 0 bytes .../libawt/windows/security_warning_bw.ico | Bin 17542 -> 0 bytes .../libawt/windows/security_warning_int.ico | Bin 17542 -> 0 bytes test/jdk/ProblemList.txt | 1 - 51 files changed, 16 insertions(+), 2078 deletions(-) delete mode 100644 src/java.desktop/macosx/classes/sun/lwawt/SecurityWarningWindow.java delete mode 100644 src/java.desktop/macosx/classes/sun/lwawt/macosx/CWarningWindow.java delete mode 100644 src/java.desktop/share/classes/sun/awt/resources/security-icon-bw16.png delete mode 100644 src/java.desktop/share/classes/sun/awt/resources/security-icon-bw24.png delete mode 100644 src/java.desktop/share/classes/sun/awt/resources/security-icon-bw32.png delete mode 100644 src/java.desktop/share/classes/sun/awt/resources/security-icon-bw48.png delete mode 100644 src/java.desktop/share/classes/sun/awt/resources/security-icon-interim16.png delete mode 100644 src/java.desktop/share/classes/sun/awt/resources/security-icon-interim24.png delete mode 100644 src/java.desktop/share/classes/sun/awt/resources/security-icon-interim32.png delete mode 100644 src/java.desktop/share/classes/sun/awt/resources/security-icon-interim48.png delete mode 100644 src/java.desktop/share/classes/sun/awt/resources/security-icon-yellow16.png delete mode 100644 src/java.desktop/share/classes/sun/awt/resources/security-icon-yellow24.png delete mode 100644 src/java.desktop/share/classes/sun/awt/resources/security-icon-yellow32.png delete mode 100644 src/java.desktop/share/classes/sun/awt/resources/security-icon-yellow48.png delete mode 100644 src/java.desktop/unix/classes/sun/awt/X11/XWarningWindow.java delete mode 100644 src/java.desktop/windows/native/libawt/windows/security_warning.ico delete mode 100644 src/java.desktop/windows/native/libawt/windows/security_warning_bw.ico delete mode 100644 src/java.desktop/windows/native/libawt/windows/security_warning_int.ico diff --git a/make/modules/java.desktop/Java.gmk b/make/modules/java.desktop/Java.gmk index 7cc9cf47034..a13b4b1ba35 100644 --- a/make/modules/java.desktop/Java.gmk +++ b/make/modules/java.desktop/Java.gmk @@ -46,18 +46,6 @@ EXCLUDE_FILES += \ javax/swing/plaf/nimbus/SpinnerPainter.java \ javax/swing/plaf/nimbus/SplitPanePainter.java \ javax/swing/plaf/nimbus/TabbedPanePainter.java \ - sun/awt/resources/security-icon-bw16.png \ - sun/awt/resources/security-icon-bw24.png \ - sun/awt/resources/security-icon-bw32.png \ - sun/awt/resources/security-icon-bw48.png \ - sun/awt/resources/security-icon-interim16.png \ - sun/awt/resources/security-icon-interim24.png \ - sun/awt/resources/security-icon-interim32.png \ - sun/awt/resources/security-icon-interim48.png \ - sun/awt/resources/security-icon-yellow16.png \ - sun/awt/resources/security-icon-yellow24.png \ - sun/awt/resources/security-icon-yellow32.png \ - sun/awt/resources/security-icon-yellow48.png \ sun/awt/X11/java-icon16.png \ sun/awt/X11/java-icon24.png \ sun/awt/X11/java-icon32.png \ diff --git a/make/modules/java.desktop/gensrc/GensrcIcons.gmk b/make/modules/java.desktop/gensrc/GensrcIcons.gmk index 28434d3f4c1..dc1c1794e63 100644 --- a/make/modules/java.desktop/gensrc/GensrcIcons.gmk +++ b/make/modules/java.desktop/gensrc/GensrcIcons.gmk @@ -37,23 +37,6 @@ GENSRC_AWT_ICONS_SRC += \ $(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \ $(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png - -AWT_ICONPATH := $(MODULE_SRC)/share/classes/sun/awt/resources - -GENSRC_AWT_ICONS_SRC += \ - $(AWT_ICONPATH)/security-icon-bw16.png \ - $(AWT_ICONPATH)/security-icon-interim16.png \ - $(AWT_ICONPATH)/security-icon-yellow16.png \ - $(AWT_ICONPATH)/security-icon-bw24.png \ - $(AWT_ICONPATH)/security-icon-interim24.png \ - $(AWT_ICONPATH)/security-icon-yellow24.png \ - $(AWT_ICONPATH)/security-icon-bw32.png \ - $(AWT_ICONPATH)/security-icon-interim32.png \ - $(AWT_ICONPATH)/security-icon-yellow32.png \ - $(AWT_ICONPATH)/security-icon-bw48.png \ - $(AWT_ICONPATH)/security-icon-interim48.png \ - $(AWT_ICONPATH)/security-icon-yellow48.png - GENSRC_AWT_ICONS_FILES := $(notdir $(GENSRC_AWT_ICONS_SRC)) GENSRC_AWT_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1))) diff --git a/src/demo/share/jfc/Font2DTest/FontPanel.java b/src/demo/share/jfc/Font2DTest/FontPanel.java index 70b1390fd76..559dccedc77 100644 --- a/src/demo/share/jfc/Font2DTest/FontPanel.java +++ b/src/demo/share/jfc/Font2DTest/FontPanel.java @@ -1114,13 +1114,7 @@ public final class FontPanel extends JPanel implements AdjustmentListener { /// Position and set size of zoom window as needed zoomWindow.setLocation( canvasLoc.x + zoomAreaX, canvasLoc.y + zoomAreaY ); if ( !nowZooming ) { - if ( zoomWindow.getWarningString() != null ) - /// If this is not opened as a "secure" window, - /// it has a banner below the zoom dialog which makes it look really BAD - /// So enlarge it by a bit - zoomWindow.setSize( zoomAreaWidth + 1, zoomAreaHeight + 20 ); - else - zoomWindow.setSize( zoomAreaWidth + 1, zoomAreaHeight + 1 ); + zoomWindow.setSize( zoomAreaWidth + 1, zoomAreaHeight + 1 ); } /// Prepare zoomed image diff --git a/src/java.desktop/macosx/classes/sun/lwawt/LWKeyboardFocusManagerPeer.java b/src/java.desktop/macosx/classes/sun/lwawt/LWKeyboardFocusManagerPeer.java index 5cecb6040fb..f8f3d70dd4b 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/LWKeyboardFocusManagerPeer.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/LWKeyboardFocusManagerPeer.java @@ -57,13 +57,6 @@ public class LWKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl { focusedWindow = win; } - if (from != null) { - from.updateSecurityWarningVisibility(); - } - - if (to != null) { - to.updateSecurityWarningVisibility(); - } } @Override diff --git a/src/java.desktop/macosx/classes/sun/lwawt/LWToolkit.java b/src/java.desktop/macosx/classes/sun/lwawt/LWToolkit.java index 9a08fae9f4e..0de6b213299 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/LWToolkit.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/LWToolkit.java @@ -421,9 +421,6 @@ public abstract class LWToolkit extends SunToolkit implements Runnable { return clipboard; } - protected abstract SecurityWarningWindow createSecurityWarning( - Window ownerWindow, LWWindowPeer ownerPeer); - // ---- DELEGATES ---- // public abstract Clipboard createPlatformClipboard(); diff --git a/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java b/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java index 13b6372a3c8..054e74dcef2 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java @@ -146,8 +146,6 @@ public class LWWindowPeer private final PeerType peerType; - private final SecurityWarningWindow warningWindow; - private volatile boolean targetFocusable; /** @@ -197,18 +195,6 @@ public class LWWindowPeer } platformWindow.initialize(target, this, ownerDelegate); - // Init warning window(for applets) - SecurityWarningWindow warn = null; - if (target.getWarningString() != null) { - // accessSystemTray permission allows to display TrayIcon, TrayIcon tooltip - // and TrayIcon balloon windows without a warning window. - if (!AWTAccessor.getWindowAccessor().isTrayIconWindow(target)) { - LWToolkit toolkit = (LWToolkit)Toolkit.getDefaultToolkit(); - warn = toolkit.createSecurityWarning(target, this); - } - } - - warningWindow = warn; } @Override @@ -274,9 +260,6 @@ public class LWWindowPeer if (isGrabbing()) { ungrab(); } - if (warningWindow != null) { - warningWindow.dispose(); - } platformWindow.dispose(); super.disposeImpl(); @@ -294,9 +277,6 @@ public class LWWindowPeer @Override protected void setVisibleImpl(final boolean visible) { - if (!visible && warningWindow != null) { - warningWindow.setVisible(false, false); - } updateFocusableWindowState(); super.setVisibleImpl(visible); // TODO: update graphicsConfig, see 4868278 @@ -555,19 +535,6 @@ public class LWWindowPeer updateOpaque(); } - @Override - public void repositionSecurityWarning() { - if (warningWindow != null) { - ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); - Window target = getTarget(); - int x = compAccessor.getX(target); - int y = compAccessor.getY(target); - int width = compAccessor.getWidth(target); - int height = compAccessor.getHeight(target); - warningWindow.reposition(x, y, width, height); - } - } - // ---- FRAME PEER METHODS ---- // @Override // FramePeer and DialogPeer @@ -753,7 +720,6 @@ public class LWWindowPeer repaintPeer(); } - repositionSecurityWarning(); } private void clearBackground(final int w, final int h) { @@ -991,8 +957,6 @@ public class LWWindowPeer Point loc, int xAbs, int yAbs, int clickCount, boolean popupTrigger, int button) { - updateSecurityWarningVisibility(); - postEvent(new MouseEvent(target, MouseEvent.MOUSE_ENTERED, when, modifiers, @@ -1004,8 +968,6 @@ public class LWWindowPeer Point loc, int xAbs, int yAbs, int clickCount, boolean popupTrigger, int button) { - updateSecurityWarningVisibility(); - postEvent(new MouseEvent(target, MouseEvent.MOUSE_EXITED, when, modifiers, @@ -1094,7 +1056,6 @@ public class LWWindowPeer postEvent(stateChangedEvent); windowState = newWindowState; - updateSecurityWarningVisibility(); } private static int getGraphicsConfigScreen(GraphicsConfiguration gc) { @@ -1454,13 +1415,11 @@ public class LWWindowPeer @Override public void enterFullScreenMode() { platformWindow.enterFullScreenMode(); - updateSecurityWarningVisibility(); } @Override public void exitFullScreenMode() { platformWindow.exitFullScreenMode(); - updateSecurityWarningVisibility(); } public long getLayerPtr() { @@ -1495,33 +1454,6 @@ public class LWWindowPeer return peerType; } - public void updateSecurityWarningVisibility() { - if (warningWindow == null) { - return; - } - - if (!isVisible()) { - return; // The warning window should already be hidden. - } - - boolean show = false; - - if (!platformWindow.isFullScreenMode()) { - if (isVisible()) { - if (LWKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow() == - getTarget()) { - show = true; - } - - if (platformWindow.isUnderMouse() || warningWindow.isUnderMouse()) { - show = true; - } - } - } - - warningWindow.setVisible(show, true); - } - @Override public String toString() { return super.toString() + " [target is " + getTarget() + "]"; diff --git a/src/java.desktop/macosx/classes/sun/lwawt/SecurityWarningWindow.java b/src/java.desktop/macosx/classes/sun/lwawt/SecurityWarningWindow.java deleted file mode 100644 index b701ac8b3e6..00000000000 --- a/src/java.desktop/macosx/classes/sun/lwawt/SecurityWarningWindow.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.lwawt; - -public interface SecurityWarningWindow extends PlatformWindow { - /** - * @param x,y,w,h coordinates of the untrusted window - */ - public void reposition(int x, int y, int w, int h); - - public void setVisible(boolean visible, boolean doSchedule); -} diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CFileDialog.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CFileDialog.java index 090a90554f0..37ff19c8455 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CFileDialog.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CFileDialog.java @@ -189,10 +189,6 @@ class CFileDialog implements FileDialogPeer { public void setTitle(String title) { } - @Override - public void repositionSecurityWarning() { - } - @Override public GraphicsConfiguration getAppropriateGraphicsConfiguration( GraphicsConfiguration gc) { diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java index 0596ad2379e..615fcec9a77 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java @@ -360,7 +360,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo } }); setPtr(ref.get()); - if (peer != null) { // Not applicable to CWarningWindow + if (peer != null) { peer.setTextured(IS(TEXTURED, styleBits)); } if (target instanceof javax.swing.RootPaneContainer) { diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CWarningWindow.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CWarningWindow.java deleted file mode 100644 index bcb18c76ae1..00000000000 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CWarningWindow.java +++ /dev/null @@ -1,475 +0,0 @@ -/* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.lwawt.macosx; - -import sun.awt.AWTAccessor; -import sun.awt.IconInfo; -import sun.java2d.SunGraphics2D; -import sun.java2d.SurfaceData; -import sun.java2d.metal.MTLLayer; -import sun.java2d.opengl.CGLLayer; -import sun.lwawt.LWWindowPeer; -import sun.lwawt.PlatformEventNotifier; -import sun.lwawt.SecurityWarningWindow; - -import java.awt.*; -import java.awt.event.MouseEvent; -import java.awt.geom.Point2D; -import java.lang.ref.WeakReference; - -public final class CWarningWindow extends CPlatformWindow - implements SecurityWarningWindow, PlatformEventNotifier { - - private static class Lock {} - private final Lock lock = new Lock(); - - private static final int SHOWING_DELAY = 300; - private static final int HIDING_DELAY = 2000; - - private Rectangle bounds = new Rectangle(); - private final WeakReference ownerPeer; - private final Window ownerWindow; - - /** - * Animation stage. - */ - private volatile int currentIcon; - - /* -1 - uninitialized. - * 0 - 16x16 - * 1 - 24x24 - * 2 - 32x32 - * 3 - 48x48 - */ - private int currentSize = -1; - private static IconInfo[][] icons; - private static IconInfo getSecurityIconInfo(int size, int num) { - synchronized (CWarningWindow.class) { - if (icons == null) { - icons = new IconInfo[4][3]; - icons[0][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw16_png.security_icon_bw16_png); - icons[0][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim16_png.security_icon_interim16_png); - icons[0][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow16_png.security_icon_yellow16_png); - icons[1][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw24_png.security_icon_bw24_png); - icons[1][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim24_png.security_icon_interim24_png); - icons[1][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow24_png.security_icon_yellow24_png); - icons[2][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw32_png.security_icon_bw32_png); - icons[2][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim32_png.security_icon_interim32_png); - icons[2][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow32_png.security_icon_yellow32_png); - icons[3][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw48_png.security_icon_bw48_png); - icons[3][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim48_png.security_icon_interim48_png); - icons[3][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow48_png.security_icon_yellow48_png); - } - } - final int sizeIndex = size % icons.length; - return icons[sizeIndex][num % icons[sizeIndex].length]; - } - - public CWarningWindow(final Window _ownerWindow, final LWWindowPeer _ownerPeer) { - super(); - - this.ownerPeer = new WeakReference<>(_ownerPeer); - this.ownerWindow = _ownerWindow; - - initialize(null, null, _ownerPeer.getPlatformWindow()); - - setOpaque(false); - - String warningString = ownerWindow.getWarningString(); - if (warningString != null) { - contentView.setToolTip(ownerWindow.getWarningString()); - } - - updateIconSize(); - } - - /** - * @param x,y,w,h coordinates of the untrusted window - */ - public void reposition(int x, int y, int w, int h) { - final Point2D point = AWTAccessor.getWindowAccessor(). - calculateSecurityWarningPosition(ownerWindow, x, y, w, h); - setBounds((int)point.getX(), (int)point.getY(), getWidth(), getHeight()); - } - - public void setVisible(boolean visible, boolean doSchedule) { - synchronized (taskLock) { - cancelTasks(); - - if (visible) { - if (isVisible()) { - currentIcon = 0; - } else { - currentIcon = 2; - } - - showHideTask = new ShowingTask(); - LWCToolkit.performOnMainThreadAfterDelay(showHideTask, 50); - } else { - if (!isVisible()) { - return; - } - - showHideTask = new HidingTask(); - if (doSchedule) { - LWCToolkit.performOnMainThreadAfterDelay(showHideTask, HIDING_DELAY); - } else { - LWCToolkit.performOnMainThreadAfterDelay(showHideTask, 50); - } - } - } - } - - @Override - public void notifyIconify(boolean iconify) { - } - - @Override - public void notifyZoom(boolean isZoomed) { - } - - @Override - public void notifyExpose(final Rectangle r) { - repaint(); - } - - @Override - public void notifyReshape(int x, int y, int w, int h) { - } - - @Override - public void notifyUpdateCursor() { - } - - @Override - public void notifyActivation(boolean activation, LWWindowPeer opposite) { - } - - @Override - public void notifyNCMouseDown() { - } - - @Override - public void notifyMouseEvent(int id, long when, int button, int x, int y, - int absX, int absY, int modifiers, - int clickCount, boolean popupTrigger, - byte[] bdata) { - LWWindowPeer peer = ownerPeer.get(); - if (id == MouseEvent.MOUSE_EXITED) { - if (peer != null) { - peer.updateSecurityWarningVisibility(); - } - } else if(id == MouseEvent.MOUSE_ENTERED) { - if (peer != null) { - peer.updateSecurityWarningVisibility(); - } - } - } - - public Rectangle getBounds() { - synchronized (lock) { - return bounds.getBounds(); - } - } - - @Override - public boolean isVisible() { - synchronized (lock) { - return visible; - } - } - - @Override - public void setVisible(boolean visible) { - synchronized (lock) { - execute(ptr -> { - // Actually show or hide the window - if (visible) { - CWrapper.NSWindow.orderFront(ptr); - } else { - CWrapper.NSWindow.orderOut(ptr); - } - }); - - this.visible = visible; - - // Manage parent-child relationship when showing - if (visible) { - // Order myself above my parent - if (owner != null && owner.isVisible()) { - owner.execute(ownerPtr -> { - execute(ptr -> { - CWrapper.NSWindow.orderWindow(ptr, - CWrapper.NSWindow.NSWindowAbove, - ownerPtr); - }); - }); - - // do not allow security warning to be obscured by other windows - applyWindowLevel(ownerWindow); - } - } - } - } - - @Override - public void notifyMouseWheelEvent(long when, int x, int y, int absX, - int absY, int modifiers, int scrollType, - int scrollAmount, int wheelRotation, - double preciseWheelRotation, - byte[] bdata) { - } - - @Override - public void notifyKeyEvent(int id, long when, int modifiers, int keyCode, - char keyChar, int keyLocation, int jextendedkeyCode) { - } - - protected int getInitialStyleBits() { - int styleBits = 0; - CPlatformWindow.SET(styleBits, CPlatformWindow.UTILITY, true); - return styleBits; - } - - protected void deliverMoveResizeEvent(int x, int y, int width, int height, - boolean byUser) { - - boolean isResize; - synchronized (lock) { - isResize = (bounds.width != width || bounds.height != height); - bounds = new Rectangle(x, y, width, height); - } - - if (isResize) { - replaceSurface(); - } - - super.deliverMoveResizeEvent(x, y, width, height, byUser); - } - - protected CPlatformResponder createPlatformResponder() { - return new CPlatformResponder(this, false); - } - - CPlatformView createContentView() { - return new CPlatformView() { - public GraphicsConfiguration getGraphicsConfiguration() { - LWWindowPeer peer = ownerPeer.get(); - return peer.getGraphicsConfiguration(); - } - - public Rectangle getBounds() { - return CWarningWindow.this.getBounds(); - } - - public CGLLayer createCGLayer() { - return new CGLLayer(null) { - public Rectangle getBounds() { - return CWarningWindow.this.getBounds(); - } - - public GraphicsConfiguration getGraphicsConfiguration() { - LWWindowPeer peer = ownerPeer.get(); - return peer.getGraphicsConfiguration(); - } - - public boolean isOpaque() { - return false; - } - }; - } - public MTLLayer createMTLLayer() { - return new MTLLayer(null) { - public Rectangle getBounds() { - return CWarningWindow.this.getBounds(); - } - - public GraphicsConfiguration getGraphicsConfiguration() { - LWWindowPeer peer = ownerPeer.get(); - return peer.getGraphicsConfiguration(); - } - - public boolean isOpaque() { - return false; - } - }; - } - - }; - } - - @Override - public void dispose() { - cancelTasks(); - SurfaceData surfaceData = contentView.getSurfaceData(); - if (surfaceData != null) { - surfaceData.invalidate(); - } - super.dispose(); - } - - private void cancelTasks() { - synchronized (taskLock) { - if (showHideTask != null) { - showHideTask.cancel(); - showHideTask = null; - } - } - } - - private void updateIconSize() { - int newSize = -1; - - if (ownerWindow != null) { - Insets insets = ownerWindow.getInsets(); - int max = Math.max(insets.top, Math.max(insets.bottom, - Math.max(insets.left, insets.right))); - if (max < 24) { - newSize = 0; - } else if (max < 32) { - newSize = 1; - } else if (max < 48) { - newSize = 2; - } else { - newSize = 3; - } - } - // Make sure we have a valid size - if (newSize == -1) { - newSize = 0; - } - - synchronized (lock) { - if (newSize != currentSize) { - currentSize = newSize; - IconInfo ico = getSecurityIconInfo(currentSize, 0); - AWTAccessor.getWindowAccessor().setSecurityWarningSize( - ownerWindow, ico.getWidth(), ico.getHeight()); - } - } - } - - private Graphics getGraphics() { - SurfaceData sd = contentView.getSurfaceData(); - if (ownerWindow == null || sd == null) { - return null; - } - - return new SunGraphics2D(sd, SystemColor.windowText, SystemColor.window, - ownerWindow.getFont()); - } - - - private void repaint() { - final Graphics g = getGraphics(); - if (g != null) { - try { - ((Graphics2D) g).setComposite(AlphaComposite.Src); - g.drawImage(getSecurityIconInfo().getImage(), 0, 0, null); - } finally { - g.dispose(); - } - } - } - - private void replaceSurface() { - SurfaceData oldData = contentView.getSurfaceData(); - - replaceSurfaceData(); - - if (oldData != null && oldData != contentView.getSurfaceData()) { - oldData.flush(); - } - } - - private int getWidth() { - return getSecurityIconInfo().getWidth(); - } - - private int getHeight() { - return getSecurityIconInfo().getHeight(); - } - - private IconInfo getSecurityIconInfo() { - return getSecurityIconInfo(currentSize, currentIcon); - } - - private final Lock taskLock = new Lock(); - private CancelableRunnable showHideTask; - - private abstract static class CancelableRunnable implements Runnable { - private volatile boolean perform = true; - - public final void cancel() { - perform = false; - } - - @Override - public final void run() { - if (perform) { - perform(); - } - } - - public abstract void perform(); - } - - private class HidingTask extends CancelableRunnable { - @Override - public void perform() { - synchronized (lock) { - setVisible(false); - } - - synchronized (taskLock) { - showHideTask = null; - } - } - } - - private class ShowingTask extends CancelableRunnable { - @Override - public void perform() { - synchronized (lock) { - if (!isVisible()) { - setVisible(true); - } - repaint(); - } - - synchronized (taskLock) { - if (currentIcon > 0) { - currentIcon--; - showHideTask = new ShowingTask(); - LWCToolkit.performOnMainThreadAfterDelay(showHideTask, SHOWING_DELAY); - } else { - showHideTask = null; - } - } - } - } -} - diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java index d3ffcfc7730..2ce71b1fb95 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java @@ -117,7 +117,6 @@ import sun.lwawt.LWWindowPeer.PeerType; import sun.lwawt.PlatformComponent; import sun.lwawt.PlatformDropTarget; import sun.lwawt.PlatformWindow; -import sun.lwawt.SecurityWarningWindow; @SuppressWarnings("serial") // JDK implementation class final class NamedCursor extends Cursor { @@ -292,12 +291,6 @@ public final class LWCToolkit extends LWToolkit { return super.createDialog(target); } - @Override - protected SecurityWarningWindow createSecurityWarning(Window ownerWindow, - LWWindowPeer ownerPeer) { - return new CWarningWindow(ownerWindow, ownerPeer); - } - @Override protected PlatformComponent createPlatformComponent() { return new CPlatformComponent(); diff --git a/src/java.desktop/share/classes/java/awt/Desktop.java b/src/java.desktop/share/classes/java/awt/Desktop.java index 89a78518873..c3e89140dc9 100644 --- a/src/java.desktop/share/classes/java/awt/Desktop.java +++ b/src/java.desktop/share/classes/java/awt/Desktop.java @@ -378,22 +378,6 @@ public class Desktop { } } - - /** - * Calls to the security manager's {@code checkPermission} method with an - * {@code AWTPermission("showWindowWithoutWarningBanner")} permission. This - * permission is needed, because we cannot add a security warning icon to - * the windows of the external native application. - */ - private void checkAWTPermission() { - @SuppressWarnings("removal") - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(new AWTPermission( - "showWindowWithoutWarningBanner")); - } - } - /** * Launches the associated application to open the file. * @@ -411,7 +395,6 @@ public class Desktop { */ public void open(File file) throws IOException { file = new File(file.getPath()); - checkAWTPermission(); checkExec(); checkActionSupport(Action.OPEN); checkFileValidation(file); @@ -434,7 +417,6 @@ public class Desktop { */ public void edit(File file) throws IOException { file = new File(file.getPath()); - checkAWTPermission(); checkExec(); checkActionSupport(Action.EDIT); file.canWrite(); @@ -493,7 +475,6 @@ public class Desktop { * @see java.net.URI */ public void browse(URI uri) throws IOException { - checkAWTPermission(); checkExec(); checkActionSupport(Action.BROWSE); Objects.requireNonNull(uri); @@ -510,7 +491,6 @@ public class Desktop { * found, or it fails to be launched */ public void mail() throws IOException { - checkAWTPermission(); checkExec(); checkActionSupport(Action.MAIL); URI mailtoURI = null; @@ -548,7 +528,6 @@ public class Desktop { * @see java.net.URI */ public void mail(URI mailtoURI) throws IOException { - checkAWTPermission(); checkExec(); checkActionSupport(Action.MAIL); if (mailtoURI == null) throw new NullPointerException(); @@ -860,7 +839,6 @@ public class Desktop { * @since 9 */ public void openHelpViewer() { - checkAWTPermission(); checkExec(); checkEventsProcessingPermission(); checkActionSupport(Action.APP_HELP_VIEWER); @@ -903,7 +881,6 @@ public class Desktop { */ public void browseFileDirectory(File file) { file = new File(file.getPath()); - checkAWTPermission(); checkExec(); checkActionSupport(Action.BROWSE_FILE_DIR); checkFileValidation(file); diff --git a/src/java.desktop/share/classes/java/awt/Window.java b/src/java.desktop/share/classes/java/awt/Window.java index f6560fb8e58..ac1a2e41dc1 100644 --- a/src/java.desktop/share/classes/java/awt/Window.java +++ b/src/java.desktop/share/classes/java/awt/Window.java @@ -209,18 +209,6 @@ public class Window extends Container implements Accessible { POPUP } - /** - * This represents the warning message that is - * to be displayed in a non secure window. ie : - * a window that has a security manager installed that denies - * {@code AWTPermission("showWindowWithoutWarningBanner")}. - * This message can be displayed anywhere in the window. - * - * @serial - * @see #getWarningString - */ - String warningString; - /** * {@code icons} is the graphical way we can * represent the frames and dialogs. @@ -398,13 +386,6 @@ public class Window extends Container implements Accessible { transient boolean isTrayIconWindow = false; - /** - * These fields are initialized in the native peer code - * or via AWTAccessor's WindowAccessor. - */ - private transient volatile int securityWarningWidth; - private transient volatile int securityWarningHeight; - static { /* ensure that the necessary native libraries are loaded */ Toolkit.loadLibraries(); @@ -428,10 +409,6 @@ public class Window extends Container implements Accessible { * Constructs a new, initially invisible window in default size with the * specified {@code GraphicsConfiguration}. *

- * If there is a security manager, then it is invoked to check - * {@code AWTPermission("showWindowWithoutWarningBanner")} - * to determine whether or not the window must be displayed with - * a warning banner. * * @param gc the {@code GraphicsConfiguration} of the target screen * device. If {@code gc} is {@code null}, the system default @@ -532,10 +509,6 @@ public class Window extends Container implements Accessible { /** * Constructs a new, initially invisible window in the default size. *

- * If there is a security manager set, it is invoked to check - * {@code AWTPermission("showWindowWithoutWarningBanner")}. - * If that check fails with a {@code SecurityException} then a warning - * banner is created. * * @throws HeadlessException when * {@code GraphicsEnvironment.isHeadless()} returns {@code true} @@ -1361,11 +1334,14 @@ public class Window extends Container implements Accessible { * Gets the warning string that is displayed with this window. *

* Warning strings are no longer applicable, - * so this method always returns {@code null}. + * so this method always returns {@code null} and may be + * removed in a future release. * @return null + * @deprecated since JDK 24 */ + @Deprecated(since="24", forRemoval=true) public final String getWarningString() { - return warningString; + return null; } /** @@ -3075,9 +3051,6 @@ public class Window extends Container implements Accessible { shape = (Shape)f.get("shape", null); opacity = (Float)f.get("opacity", 1.0f); - this.securityWarningWidth = 0; - this.securityWarningHeight = 0; - deserializeResources(s); } @@ -3977,69 +3950,12 @@ public class Window extends Container implements Accessible { return value; } - /** - * Calculate the position of the security warning. - * - * This method gets the window location/size as reported by the native - * system since the locally cached values may represent outdated data. - * - * The method is used from the native code, or via AWTAccessor. - * - * NOTE: this method is invoked on the toolkit thread, and therefore is not - * supposed to become public/user-overridable. - */ - private Point2D calculateSecurityWarningPosition(double x, double y, - double w, double h) - { - // The desired location for the security warning - double wx = x + w * RIGHT_ALIGNMENT + 2.0; - double wy = y + h * TOP_ALIGNMENT + 0.0; - - // First, make sure the warning is not too far from the window bounds - wx = Window.limit(wx, - x - securityWarningWidth - 2, - x + w + 2); - wy = Window.limit(wy, - y - securityWarningHeight - 2, - y + h + 2); - - // Now make sure the warning window is visible on the screen - GraphicsConfiguration graphicsConfig = - getGraphicsConfiguration_NoClientCode(); - Rectangle screenBounds = graphicsConfig.getBounds(); - Insets screenInsets = - Toolkit.getDefaultToolkit().getScreenInsets(graphicsConfig); - - wx = Window.limit(wx, - screenBounds.x + screenInsets.left, - screenBounds.x + screenBounds.width - screenInsets.right - - securityWarningWidth); - wy = Window.limit(wy, - screenBounds.y + screenInsets.top, - screenBounds.y + screenBounds.height - screenInsets.bottom - - securityWarningHeight); - - return new Point2D.Double(wx, wy); - } - static { AWTAccessor.setWindowAccessor(new AWTAccessor.WindowAccessor() { public void updateWindow(Window window) { window.updateWindow(); } - public void setSecurityWarningSize(Window window, int width, int height) - { - window.securityWarningWidth = width; - window.securityWarningHeight = height; - } - - public Point2D calculateSecurityWarningPosition(Window window, - double x, double y, double w, double h) - { - return window.calculateSecurityWarningPosition(x, y, w, h); - } - public void setLWRequestStatus(Window changed, boolean status) { changed.syncLWRequests = status; } diff --git a/src/java.desktop/share/classes/java/awt/peer/WindowPeer.java b/src/java.desktop/share/classes/java/awt/peer/WindowPeer.java index 07013a10bd0..0c6c991959b 100644 --- a/src/java.desktop/share/classes/java/awt/peer/WindowPeer.java +++ b/src/java.desktop/share/classes/java/awt/peer/WindowPeer.java @@ -114,11 +114,6 @@ public interface WindowPeer extends ContainerPeer { */ void updateWindow(); - /** - * Instructs the peer to update the position of the security warning. - */ - void repositionSecurityWarning(); - /** * Requests a GC that best suits this Window. The returned GC may differ * from the requested GC passed as the argument to this method. This method diff --git a/src/java.desktop/share/classes/javax/swing/JInternalFrame.java b/src/java.desktop/share/classes/javax/swing/JInternalFrame.java index 38bd5ef2c41..d6b6958e084 100644 --- a/src/java.desktop/share/classes/javax/swing/JInternalFrame.java +++ b/src/java.desktop/share/classes/javax/swing/JInternalFrame.java @@ -1862,12 +1862,14 @@ public class JInternalFrame extends JComponent implements /** * Gets the warning string that is displayed with this internal frame. - * Since an internal frame is always secure (since it's fully - * contained within a window that might need a warning string) - * this method always returns null. + * This method always returns null. + * Warning strings are no longer applicable, even to top-level + * windows, so this method may be removed in a future release * @return null * @see java.awt.Window#getWarningString + * @deprecated since JDK 24 */ + @Deprecated(since="24", forRemoval=true) @BeanProperty(bound = false) public final String getWarningString() { return null; diff --git a/src/java.desktop/share/classes/sun/awt/AWTAccessor.java b/src/java.desktop/share/classes/sun/awt/AWTAccessor.java index 1303ef7b282..5a3d2c46773 100644 --- a/src/java.desktop/share/classes/sun/awt/AWTAccessor.java +++ b/src/java.desktop/share/classes/sun/awt/AWTAccessor.java @@ -305,17 +305,6 @@ public final class AWTAccessor { */ void updateWindow(Window window); - /** - * Set the size of the security warning. - */ - void setSecurityWarningSize(Window w, int width, int height); - - /** Request to recalculate the new position of the security warning for - * the given window size/location as reported by the native system. - */ - Point2D calculateSecurityWarningPosition(Window window, - double x, double y, double w, double h); - /** Sets the synchronous status of focus requests on lightweight * components in the specified window to the specified value. */ diff --git a/src/java.desktop/share/classes/sun/awt/AWTPermissions.java b/src/java.desktop/share/classes/sun/awt/AWTPermissions.java index 57ed7a96644..da0dcd1c3af 100644 --- a/src/java.desktop/share/classes/sun/awt/AWTPermissions.java +++ b/src/java.desktop/share/classes/sun/awt/AWTPermissions.java @@ -33,9 +33,6 @@ import java.awt.AWTPermission; public final class AWTPermissions { private AWTPermissions() { } - public static final AWTPermission TOPLEVEL_WINDOW_PERMISSION = - new AWTPermission("showWindowWithoutWarningBanner"); - public static final AWTPermission ACCESS_CLIPBOARD_PERMISSION = new AWTPermission("accessClipboard"); diff --git a/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java b/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java index ff68d45f623..e024a6466cb 100644 --- a/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java +++ b/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java @@ -590,9 +590,6 @@ public abstract class EmbeddedFrame extends Frame public void updateWindow() { } - public void repositionSecurityWarning() { - } - public void emulateActivation(boolean activate) { } } diff --git a/src/java.desktop/share/classes/sun/awt/resources/security-icon-bw16.png b/src/java.desktop/share/classes/sun/awt/resources/security-icon-bw16.png deleted file mode 100644 index 98dcd0f4e77d099c6d344ed0a3cdb7287e838c14..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 463 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8nE^f_u7!n#FJ8R3dGqFzCr{qKeS7E5o$J@HKX~xq)TvVq z4Gs71-8*#X(9xquYinx{95^t2`t2A>(;FkCr*@=m0h`VW!9`&6DCaX^73+Ua4h*ckZ08ukYr~n>92v)Ya9ktgNO?nezYt|1E1~I{_VOToU9L4CIms7z*d@?E`A> z^>lFzskjw#B3$f{0gp?da>s_t)$hOX-TVJ&!(@Ru-wiMAZ0TS6^2>yeJErX7=J;e2 zuyA$h-ghDeTTaIo{}Y&X^>x6^hdj0p+n8U}Pmt(1Z@XxskAU){-zsWyik}!BREa%y zWj65rvg2f`kj^gAjr}oMoFA@ldSf9ofAX>z&8fVaZ_13X-(r23BKV)nfT2fNdXl2v SCl#Q>7(8A5T-G@yGywpg#P84m diff --git a/src/java.desktop/share/classes/sun/awt/resources/security-icon-bw24.png b/src/java.desktop/share/classes/sun/awt/resources/security-icon-bw24.png deleted file mode 100644 index 5e5acae2e43758d7e27c5fd1238d53478f375ab1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 682 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaANtU=qlmzFem6RtIr7}3CxT{vbApFVy1_U+pi78VN^E}TAn zdTD9t)vH(Q>gp;hD~}vGGIQq4*4EZ}^XAQ+JGZ>N{KSb96DCaP=;#m>6l`c{c<|ss zZ*Ol=QIU#@ijtC2adEM(u5NdC_tdFV7c5wC{`~ps>gw6EXIolYPMS1HQc}{|+FC+F zV#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-icon-bw48.png deleted file mode 100644 index 9615364226a9744814bd2ce673adba31ccb72c07..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1137 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+7^?z&LR_z3zkcJ!jeGa*-Mo48_U+pR1qBZuK79ZF{hd2^ z9z1yP=FOXrA3wf*`}XeLyPrONx_0f_qeqW!-MaPS#fw+3UOj#K^!fAWPo6xvfB(L$ ztn9I4$Mp2{EG;cHH8qWmjoH}P=FOWYARut|?AZki7BDh0mX(#2mzSSBc~VkRvbwr@ z;lhOzCQLYb^r(=K(5X|WL`6j{EG!fi70;hPUsP0d`0!y>RaGu7u0w|oB_<~F^YfoL zae{+`gNKJ_`t<1~B_&IjE}b!B#;jShX3m^BXU?38iV7wsrYl#jFf%isK7IPgks}8W z9%Nx*adUG^O--FRaiW2NK}<}HtE=nd$B&O6KW=Sp?c?L)@9#ft+O+xe=lAyZ3JVL@ z*Vot8)$QNEKQAw@wzjspxp~s0Npt7UojiGRXJ=g((G^z<|~Hnz01%$_~Fva%8w1*N5>?d|QCE?sJEZOzTi?e6Zbs;X*eXlQC` zDl9Dg|Nnm~bHx&%y1J4ezhEGD-~huJyJtlV3{1?PE{-7;x29aVUUkbspy47b_jZ?e zor^WtlDiCBEF72=-|hW=uloJoPw(W`hB;m0$}C-1*7h_1k7U5P5N?D2EHm?F`=zJ( z&7Q*&dcbjmi3+Q;_nF4^5}!A+?b{)9q_*dvpXA2FVqe-`cNXXe7sRgLmBzVib6)7S z*@`a;v%lP6kKJr@eto~ZZ14KR$=gnwWwaaHUFI^nwEC`Igou|Tv)bMk*Vzwzc4__X zd-!~2=?3kBN%9hPT)U?oG_!l8_P@dN=iXdVpChX_w%$*0tUIoz)08nW=b!Wpb>}Sw z1qMEO^JX0smTcqaVmqy;^n;saYUa*>f{8(Xdi71-sa~-n9P=hF`Yit<=@pW8j>yr6TRmz;Khs#UUoenM7GSVilj;C8q~FuUF{I*F$cd|BhZO`|1G7Bt++F(a)c^WO#U+_Va_`RE zYUol~S>Ir>Ds`o>2G3#%XW1830sRNonk_%|w^_Jq_jYkB<}EFE=Cy3G&q(Rvm+yJH ztX;^dqIRPutBRyk#@_VFsG$$UVr#1>0G-C*>FVdQ&MBb@0PKeM-2eap diff --git a/src/java.desktop/share/classes/sun/awt/resources/security-icon-interim24.png b/src/java.desktop/share/classes/sun/awt/resources/security-icon-interim24.png deleted file mode 100644 index 753a2adab88e4719cf3dbd4d1e2b65ba5df5c64c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 741 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaANtU=qlmzFem6RtIr7}3Cl#|vKH>3wy(8i?fM#Qw=WBr z)NH?HvH#tR69okYmrQYAIMMCK$&y1GLT7e4?OhYRa;Ddn%(0pDJl8k z$uiOtuI}|?MQi4G-#A%$;$Y#<6@i-; z`W;*!vVU#Jor|^8+8x)=^Vz<+P)t<7-dgq0p2|bp8_plAC@XNjcctO%vARu5lXtAm zOvRIP2Ihr^zprJHa51a7n{!*NVGlN zaxIK?$%A`b@AiJrn=5;3SJc$c_PorUO|zc6?=!#7tFkpA;4|Z^oHQd}r7f3UigB{| zD?JqCm{8NI`hMX&^TVIMS{E3dxjij$&h`g&u%-gS-JV@BImDm zzqD<1!#LI*FP?okb(cy)I-}w>J{i-d4W{f9tY+RAb z#l>~wWaZ=*`-AI4`S~~|G}`T78*=aRbUr@5oy!Az>um#lEw?WVxN)+CiHWJU)NAjW z;5(P=_N)q8Im2^Cr<1t2cy*E6{>@n%7x->ilDK)1->#KGx6W7JyWS)yD5$BadG~z( z$LDJfZ3taG%d05gPen!L=IQb!Q$6lonzC%Vr>DE2oSfX0Hixxyybr7kIlL?P*6EhM z2HUMm{AYDLFPa_|8DceKYAhQY+q{0)DZQDu&vh=C=w@SMV{2`=W?BCFc|NyJ*WWx< z_y7O@hEo?}fq|Y=666;QNSl*>~&9;~LB9O8#>a5@r^9Q^_K`XyVGx#^@cl`BI znZ(avQ*Ssg;WyWs(@#zRR-)yV`o&rdKH)p^Uhvc(Vi%L}DCRjxr(vNThupD)(W7U?G03(D*T zMV3~csg!)uoPFA|Pxh+m{4byjEFqnsjhqJS@VTNyIWo2VyV`5^0Kp>z{sD*`v zy}kXGEn94DZ7nS=muK(3Xgg_VXQvvuA`@kf4>Hv6OJ$-A#aQ~lin-W<8ab}i^1O|lwASF|Z<7`jl^-TbwaOYvUxK)oE+1sf zNjOu(DN0e&`ue&R@ZPHNRhU2`kd5>ICqVve*CiwGjyNAIg&{2;jkvuNyPd5%NVq5q z935+-Uyune%7lw#r*(n;-5w9*b)9ZCM(O(03ldAuMBISyVe}V zg+_l(3i;fKL;BNy;^Cd4Yim$v!==DsE890kei2_{iPpu-z!r#$7Rq271pMtq5cn4i zBi|sHMt#FF<_;<&fN12)Me~fGIqh>00s|!7^lNV%)a6CckB9wS0_&8v_RBzCxhRBN}!?LP8WcfDrYmn^YqlOe9%I- z!`_|n9(L;YkW-sc(_RStRUmm>cI;qZe^=z{wy>zUYXL({6YzQWEOj!{ab>M5_e@-D z$Q!-jDrG2f*AwZ;g8-}0fjaTB1FX9hc4NCkfgN`3j5k-};0Ifc9D2rJyLUfB2Ehut zeA+HmQ`&^T)N!{NAp2Lj4Pyrm^kH5>WIJ?--PEa0Cs3_xd55b@N7FFbvh&9vw|1NN znQ^@pv&zgP=aY8&U?sr=e3QbFEB3o7<_-;igLoqB z_my45jXj4OUp~tI6gv(+{EhzbTOw~}1Z*>3!hL7g%Gez_+ePX-^H~%A1^yg>a0#`E TcSGkJQ3v3B2|lgfVXS`v6_*LB diff --git a/src/java.desktop/share/classes/sun/awt/resources/security-icon-yellow16.png b/src/java.desktop/share/classes/sun/awt/resources/security-icon-yellow16.png deleted file mode 100644 index 8dd91a92898a29c3b584f6474cf798a11980bc27..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 477 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8r2#%6u5+3g{(p7(|J&#Pd)xo7%>O?%`2SG*|6TR}ca8qv zR(pF*=kQ{N%NrT~KMsF;N^Z+^hJEuH-d>43zmDPUd8O6;3_E8t{D0&f%b#+r?&G*-J13ma7Lu7heOkJEUU2OPdqy?m;q`VwO{{R24midYu=wS1bAirQB zmkhul5IMISXhgTCi(^Q|t&kH}#SSY7xCUl<+_@WE{`9~7T7gS!=MK+}lnw~I-penr zy!>t)UnLRJ~bL)1i=1u?r diff --git a/src/java.desktop/share/classes/sun/awt/resources/security-icon-yellow24.png b/src/java.desktop/share/classes/sun/awt/resources/security-icon-yellow24.png deleted file mode 100644 index 0a3205ff67c358e1f2e1d7475af9334a886710d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 749 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaANtU=qlmzFem6RtIr7}3C$ngKG%m0t||9^V^e`)srnbH5ZR{tOC{ePhK z|DO8)JF5ThsQ&JHgpJn`i67m0O!v6;j{~vn1KBshgHN(!?4C^N|teL=Y zaXrJaWekFXg6GyUT;0rYcrk;LlG5wTnvRy-uTQHi?`C*?*6`#?hS%rqUf(p>Gml~O zRED|D4D(wVu5V?yv5mpf((?bKfXf>hR`xRNU&!$KYV!Y=m9H;H9@(t$`m~&`uI{!O z3`;s0{=X=Yl$2c9&Y+^A(oi5OF3QEk#B~3%`R(JT4-cu_Kdy0Viz7ET_loJRw~q#& z-yO7iuHK{bM$_7@PHeDXXJ(!9Xr80Yh=_6K9}Z-#uL%Ln?0NoP1u@ zWFXP@Fhh1NQ&55ao$B{{)3-0)J@vCaH*;sxr04GY%&+shEUk(A%6RHb=xR$PmaMG| zoL*n^w#O+o9B2ESad7|6cG*8t1smQRo|P(lUBF)?y!BANq2PWd{qy$QqqygNk8?6O zR#@Nk;ZWhm2dp6(v;MvOy6@r26^fz@HC~;4-mEX`x$;0}>)C11FC*r1ZJ8~$@;m=e zliTSY_fPg7ezDB|!KVACTH9aTij}yNcI6K@zj;&9iH=|M9|>xm7BF2P$KI@NvskEP zlG>GbrC&PJH!&|!k$tIuXofnUo7&)*UIkK36nZeqtylq-`syHwR O7(8A5T-G@yGywn=bB$5} diff --git a/src/java.desktop/share/classes/sun/awt/resources/security-icon-yellow32.png b/src/java.desktop/share/classes/sun/awt/resources/security-icon-yellow32.png deleted file mode 100644 index 6e178672b1fe8dad627f677ce8b656ca32dc7af0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 866 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+7##zALR@DzGW`GH`Tvja|G)nKzq78TQR*SU;KJ z%^97!{qCBYn#Y$j?4HZ8e~s$J4GeECILvQlcyl#r`%H$jYZ;iBnBH9Uy1td+&6U{2 z9Soah$-cQ~zH>Ii@@@t>Ik^kll#VWCu(7dub4p1_Na)Q?!-P=z|1T>~uV&b`%KF+C zh64*37Pc{Lna*%y8^htn44b9`P1Y6{7r(NZ;mujIgDd2HJ!RjVl3O@S_y5Z(E-o$= z6_t*1xg(nu-dqZ1V`B^RQ>`e{e{)go{5l4E8+8FbWb>R>b$nnU`0#*&WtA4wROd~CRcaivClz>vTK{qzFf>2=%wI3o1d2ii MPgg&ebxsLQ0Oi)ZdjJ3c diff --git a/src/java.desktop/share/classes/sun/awt/resources/security-icon-yellow48.png b/src/java.desktop/share/classes/sun/awt/resources/security-icon-yellow48.png deleted file mode 100644 index fcbfd7ff567b6da2225d65603b63d5413fcc9001..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1323 zcmdT?{WBDJ9R66^*0!5>-Ckp^l~rqHY45bGmlkcyO034^dPA1FUW9e2T#D#TL!HK@ zh)^hMlT1mML#0CAQWDl~`Id@^nsWEKy}7^Qo|)(K%=63VGtV=h!+` z`p9+a_%CVtx*67ISgjM5a@lHSa7>hPXLy_f#E~%(ig~`|cTdo~RAQK`+#AYL{&{#E(JQj%EO^OadLz&Ix-=Mn+MxWR}ya<6(qbJv3tkt^Z66ovelYSpQ zpC1~;6}j?t#a_(Rt>uxf7}Dunc^rBhgGgJ@r7RFQEx309BG=pQ-C=w8JoMcCq5U$D zR=@gl5F2UUse=3i@JAt#j*U47tZ$r#;jSg*`O^Gs*V|{oUpjYlgh$~)*dFa&ngM0U zpsf-zlUWoBrT8#dn$h;fS{fJ_kj|e+HSVO_g|x40t$-uDY{-Mf-XbPx=6QH{T+4yx zGH5J;GbvDV1R9ET*B!|tkFKjwlMA(Hpdbw{9MyH0M4q~zO@omkH$+&;?Zq2<-dB>N=Px3@A+zEkcl0G%%?X&N~oKK6SxUXb_`ZaG<)%t5| z!Mlp$V|?1WvE%j!;%2PqKVq97WZgJwo+%Xfg^(|`G`t+PTa~j&1!{TjPS-ptiIe$wYmD#4s9Vn0_EfLOg z{*)h)wqa@E=l2RWT`KOta9VYEVjwI10ln%1-ZuLU4Vei7% zU-WNkx7-*IXAN>?f6bDg6o^H_wUb#*$cF|N=@$}+@ z<0c&8?ekAMdwLo&?!{ekPYy0ol@=6~2GzC3$m+ET)voHZl^b9AI!RsX3Z2Ic8IBX1 z>9f< getChildren() { synchronized (getStateLock()) { return new HashSet(children); diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java index 102a76b16a7..49515bb2031 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java +++ b/src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java @@ -112,9 +112,6 @@ abstract class XDecoratedPeer extends XWindowPeer { content = XContentWindow.createContent(this); - if (warningWindow != null) { - warningWindow.toFront(); - } focusProxy = createFocusProxy(); } @@ -843,7 +840,6 @@ abstract class XDecoratedPeer extends XWindowPeer { reconfigureContentWindow(newDimensions); updateChildrenSizes(); - repositionSecurityWarning(); } private void checkShellRectSize(Rectangle shellRect) { diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XEmbedHelper.java b/src/java.desktop/unix/classes/sun/awt/X11/XEmbedHelper.java index 0c2acc44c1c..b4cddacf9a1 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11/XEmbedHelper.java +++ b/src/java.desktop/unix/classes/sun/awt/X11/XEmbedHelper.java @@ -216,7 +216,6 @@ public class XEmbedHelper { // Shouldn't be called on Toolkit thread. AWTKeyStroke getKeyStrokeForKeySym(long keysym, long state) { - XBaseWindow.checkSecurity(); int keycode; diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java index 2ec736feb29..400f8168f72 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java +++ b/src/java.desktop/unix/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java @@ -79,13 +79,6 @@ public class XKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl { to = AWTAccessor.getComponentAccessor().getPeer(currentFocusedWindow); } } - - if (from != null) { - from.updateSecurityWarningVisibility(); - } - if (to != null) { - to.updateSecurityWarningVisibility(); - } } @Override diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XScrollPanePeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XScrollPanePeer.java index 8b58fccacb5..bd05dd578c9 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11/XScrollPanePeer.java +++ b/src/java.desktop/unix/classes/sun/awt/X11/XScrollPanePeer.java @@ -272,7 +272,6 @@ class XScrollPanePeer extends XComponentPeer implements ScrollPanePeer, XScrollb */ @SuppressWarnings("deprecation") void scroll(int x, int y, int flag, int type) { - checkSecurity(); ScrollPane sp = (ScrollPane)target; Component c = getScrollChild(); if (c == null) { diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java b/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java index 920e1235fca..5a2a849b757 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java +++ b/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java @@ -199,7 +199,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable { private static final X11GraphicsDevice device; private static final long display; static int awt_multiclick_time; - static boolean securityWarningEnabled; /** * Dimensions of default virtual screen in pixels. These values are used to @@ -211,7 +210,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable { private static XMouseInfoPeer xPeer; static { - initSecurityWarning(); if (GraphicsEnvironment.isHeadless()) { localEnv = null; device = null; @@ -240,16 +238,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable { return Thread.currentThread() == toolkitThread; } - static void initSecurityWarning() { - // Enable warning only for internal builds - String runtime = System.getProperty("java.runtime.version"); - securityWarningEnabled = (runtime != null && runtime.contains("internal")); - } - - static boolean isSecurityWarningEnabled() { - return securityWarningEnabled; - } - static native void awt_output_flush(); static void awtFUnlock() { diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XWarningWindow.java b/src/java.desktop/unix/classes/sun/awt/X11/XWarningWindow.java deleted file mode 100644 index ba7359dc5c4..00000000000 --- a/src/java.desktop/unix/classes/sun/awt/X11/XWarningWindow.java +++ /dev/null @@ -1,416 +0,0 @@ -/* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package sun.awt.X11; - -import java.awt.*; -import java.awt.geom.Point2D; -import java.lang.ref.WeakReference; - -import sun.awt.IconInfo; -import sun.awt.AWTAccessor; -import sun.awt.SunToolkit; - -class XWarningWindow extends XWindow { - private static final int SHOWING_DELAY = 330; - private static final int HIDING_DELAY = 2000; - - private final Window ownerWindow; - private WeakReference ownerPeer; - private long parentWindow; - - private static final String OWNER = "OWNER"; - private InfoWindow.Tooltip tooltip; - - /** - * Animation stage. - */ - private volatile int currentIcon; - - /* -1 - uninitialized. - * 0 - 16x16 - * 1 - 24x24 - * 2 - 32x32 - * 3 - 48x48 - */ - private int currentSize = -1; - private static IconInfo[][] icons; - private static IconInfo getSecurityIconInfo(int size, int num) { - synchronized (XWarningWindow.class) { - if (icons == null) { - icons = new IconInfo[4][3]; - if (XlibWrapper.dataModel == 32) { - icons[0][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw16_png.security_icon_bw16_png); - icons[0][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim16_png.security_icon_interim16_png); - icons[0][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow16_png.security_icon_yellow16_png); - icons[1][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw24_png.security_icon_bw24_png); - icons[1][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim24_png.security_icon_interim24_png); - icons[1][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow24_png.security_icon_yellow24_png); - icons[2][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw32_png.security_icon_bw32_png); - icons[2][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim32_png.security_icon_interim32_png); - icons[2][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow32_png.security_icon_yellow32_png); - icons[3][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw48_png.security_icon_bw48_png); - icons[3][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim48_png.security_icon_interim48_png); - icons[3][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow48_png.security_icon_yellow48_png); - } else { - icons[0][0] = new IconInfo(sun.awt.AWTIcon64_security_icon_bw16_png.security_icon_bw16_png); - icons[0][1] = new IconInfo(sun.awt.AWTIcon64_security_icon_interim16_png.security_icon_interim16_png); - icons[0][2] = new IconInfo(sun.awt.AWTIcon64_security_icon_yellow16_png.security_icon_yellow16_png); - icons[1][0] = new IconInfo(sun.awt.AWTIcon64_security_icon_bw24_png.security_icon_bw24_png); - icons[1][1] = new IconInfo(sun.awt.AWTIcon64_security_icon_interim24_png.security_icon_interim24_png); - icons[1][2] = new IconInfo(sun.awt.AWTIcon64_security_icon_yellow24_png.security_icon_yellow24_png); - icons[2][0] = new IconInfo(sun.awt.AWTIcon64_security_icon_bw32_png.security_icon_bw32_png); - icons[2][1] = new IconInfo(sun.awt.AWTIcon64_security_icon_interim32_png.security_icon_interim32_png); - icons[2][2] = new IconInfo(sun.awt.AWTIcon64_security_icon_yellow32_png.security_icon_yellow32_png); - icons[3][0] = new IconInfo(sun.awt.AWTIcon64_security_icon_bw48_png.security_icon_bw48_png); - icons[3][1] = new IconInfo(sun.awt.AWTIcon64_security_icon_interim48_png.security_icon_interim48_png); - icons[3][2] = new IconInfo(sun.awt.AWTIcon64_security_icon_yellow48_png.security_icon_yellow48_png); - } - } - } - final int sizeIndex = size % icons.length; - return icons[sizeIndex][num % icons[sizeIndex].length]; - } - - private void updateIconSize() { - int newSize = -1; - - if (ownerWindow != null) { - Insets insets = ownerWindow.getInsets(); - int max = Math.max(insets.top, Math.max(insets.bottom, - Math.max(insets.left, insets.right))); - if (max < 24) { - newSize = 0; - } else if (max < 32) { - newSize = 1; - } else if (max < 48) { - newSize = 2; - } else { - newSize = 3; - } - } - // Make sure we have a valid size - if (newSize == -1) { - newSize = 0; - } - - // Note: this is not the most wise solution to use awtLock here, - // this should have been sync'ed with the stateLock. However, - // the awtLock must be taken first (see XBaseWindow.getStateLock()), - // and we need the awtLock anyway to update the shape of the icon. - // So it's easier to use just one lock instead. - XToolkit.awtLock(); - try { - if (newSize != currentSize) { - currentSize = newSize; - IconInfo ico = getSecurityIconInfo(currentSize, 0); - XlibWrapper.SetBitmapShape(XToolkit.getDisplay(), getWindow(), - ico.getWidth(), ico.getHeight(), ico.getIntData()); - AWTAccessor.getWindowAccessor().setSecurityWarningSize( - ownerWindow, ico.getWidth(), ico.getHeight()); - } - } finally { - XToolkit.awtUnlock(); - } - } - - private IconInfo getSecurityIconInfo() { - updateIconSize(); - return getSecurityIconInfo(currentSize, currentIcon); - } - - XWarningWindow(final Window ownerWindow, long parentWindow, XWindowPeer ownerPeer) { - super(new XCreateWindowParams(new Object[] { - TARGET, ownerWindow, - OWNER, Long.valueOf(parentWindow) - })); - this.ownerWindow = ownerWindow; - this.parentWindow = parentWindow; - this.tooltip = new InfoWindow.Tooltip(null, getTarget(), - new InfoWindow.Tooltip.LiveArguments() { - public boolean isDisposed() { - return XWarningWindow.this.isDisposed(); - } - public Rectangle getBounds() { - return XWarningWindow.this.getBounds(); - } - public String getTooltipString() { - return XWarningWindow.this.ownerWindow.getWarningString(); - } - }); - this.ownerPeer = new WeakReference(ownerPeer); - } - - private void requestNoTaskbar() { - XNETProtocol netProtocol = XWM.getWM().getNETProtocol(); - if (netProtocol != null) { - netProtocol.requestState(this, netProtocol.XA_NET_WM_STATE_SKIP_TASKBAR, true); - } - } - - @Override - void postInit(XCreateWindowParams params) { - super.postInit(params); - XToolkit.awtLock(); - try { - XWM.setMotifDecor(this, false, 0, 0); - XWM.setOLDecor(this, false, 0); - - long parentWindow = ((Long)params.get(OWNER)).longValue(); - XlibWrapper.XSetTransientFor(XToolkit.getDisplay(), - getWindow(), parentWindow); - - XWMHints hints = getWMHints(); - hints.set_flags(hints.get_flags() | (int)XUtilConstants.InputHint | (int)XUtilConstants.StateHint); - hints.set_input(false); - hints.set_initial_state(XUtilConstants.NormalState); - XlibWrapper.XSetWMHints(XToolkit.getDisplay(), getWindow(), hints.pData); - - initWMProtocols(); - requestNoTaskbar(); - } finally { - XToolkit.awtUnlock(); - } - } - - /** - * @param x,y,w,h coordinates of the untrusted window - */ - public void reposition(int x, int y, int w, int h) { - Point2D point = AWTAccessor.getWindowAccessor(). - calculateSecurityWarningPosition(ownerWindow, - x, y, w, h); - reshape((int)point.getX(), (int)point.getY(), getWidth(), getHeight()); - } - - protected String getWMName() { - return "Warning window"; - } - - public Graphics getGraphics() { - if ((surfaceData == null) || (ownerWindow == null)) return null; - return getGraphics(surfaceData, - getColor(), - getBackground(), - getFont()); - } - void paint(Graphics g, int x, int y, int width, int height) { - g.drawImage(getSecurityIconInfo().getImage(), 0, 0, null); - } - - String getWarningString() { - return ownerWindow.getWarningString(); - } - - int getWidth() { - return getSecurityIconInfo().getWidth(); - } - - int getHeight() { - return getSecurityIconInfo().getHeight(); - } - - Color getBackground() { - return SystemColor.window; - } - Color getColor() { - return Color.black; - } - Font getFont () { - return ownerWindow.getFont(); - } - - @Override - public void repaint() { - final Rectangle bounds = getBounds(); - final Graphics g = getGraphics(); - if (g != null) { - try { - paint(g, 0, 0, bounds.width, bounds.height); - } finally { - g.dispose(); - } - } - } - @Override - public void handleExposeEvent(XEvent xev) { - super.handleExposeEvent(xev); - - XExposeEvent xe = xev.get_xexpose(); - final int x = scaleDown(xe.get_x()); - final int y = scaleDown(xe.get_y()); - final int width = scaleDown(xe.get_width()); - final int height = scaleDown(xe.get_height()); - SunToolkit.executeOnEventHandlerThread(target, - new Runnable() { - public void run() { - final Graphics g = getGraphics(); - if (g != null) { - try { - paint(g, x, y, width, height); - } finally { - g.dispose(); - } - } - } - }); - } - - @Override - protected boolean isEventDisabled(XEvent e) { - return true; - } - - /** Send a synthetic UnmapNotify in order to withdraw the window. - */ - private void withdraw() { - XEvent req = new XEvent(); - try { - long root; - XToolkit.awtLock(); - try { - root = XlibWrapper.RootWindow(XToolkit.getDisplay(), getScreenNumber()); - } - finally { - XToolkit.awtUnlock(); - } - - req.set_type(XConstants.UnmapNotify); - - XUnmapEvent umev = req.get_xunmap(); - - umev.set_event(root); - umev.set_window(getWindow()); - umev.set_from_configure(false); - - XToolkit.awtLock(); - try { - XlibWrapper.XSendEvent(XToolkit.getDisplay(), - root, - false, - XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask, - req.pData); - } - finally { - XToolkit.awtUnlock(); - } - } finally { - req.dispose(); - } - } - - @Override - protected void stateChanged(long time, int oldState, int newState) { - if (newState == XUtilConstants.IconicState) { - super.xSetVisible(false); - withdraw(); - } - } - - @Override - protected void setMouseAbove(boolean above) { - super.setMouseAbove(above); - XWindowPeer p = ownerPeer.get(); - if (p != null) { - p.updateSecurityWarningVisibility(); - } - } - - @Override - protected void enterNotify(long window) { - super.enterNotify(window); - if (window == getWindow()) { - tooltip.enter(); - } - } - - @Override - protected void leaveNotify(long window) { - super.leaveNotify(window); - if (window == getWindow()) { - tooltip.exit(); - } - } - - @Override - public void xSetVisible(boolean visible) { - super.xSetVisible(visible); - - // The _NET_WM_STATE_SKIP_TASKBAR got reset upon hiding/showing, - // so we request it every time whenever we change the visibility. - requestNoTaskbar(); - } - - private final Runnable hidingTask = new Runnable() { - public void run() { - xSetVisible(false); - } - }; - - private final Runnable showingTask = new Runnable() { - public void run() { - if (!isVisible()) { - xSetVisible(true); - updateIconSize(); - XWindowPeer peer = ownerPeer.get(); - if (peer != null) { - peer.repositionSecurityWarning(); - } - } - repaint(); - if (currentIcon > 0) { - currentIcon--; - XToolkit.schedule(showingTask, SHOWING_DELAY); - } - } - }; - - public void setSecurityWarningVisible(boolean visible, boolean doSchedule) { - if (visible) { - XToolkit.remove(hidingTask); - XToolkit.remove(showingTask); - if (isVisible()) { - currentIcon = 0; - } else { - currentIcon = 3; - } - if (doSchedule) { - XToolkit.schedule(showingTask, 1); - } else { - showingTask.run(); - } - } else { - XToolkit.remove(showingTask); - XToolkit.remove(hidingTask); - if (!isVisible()) { - return; - } - if (doSchedule) { - XToolkit.schedule(hidingTask, HIDING_DELAY); - } else { - hidingTask.run(); - } - } - } -} diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java b/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java index 38e35bdbeea..3ade95f5870 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java +++ b/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java @@ -1488,8 +1488,8 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { static native int getKeySymForAWTKeyCode(int keycode); /* These two methods are actually applicable to toplevel windows only. - * However, the functionality is required by both the XWindowPeer and - * XWarningWindow, both of which have the XWindow as a common ancestor. + * However, the functionality is required by XWindowPeer + * which has XWindow as an ancestor. * See XWM.setMotifDecor() for details. */ public PropMwmHints getMWMHints() { diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java index ebd04f2b7dd..573d98390b4 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java +++ b/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java @@ -79,7 +79,6 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, private boolean cachedFocusableWindow; - XWarningWindow warningWindow; private boolean alwaysOnTop; private boolean locationByPlatform; @@ -277,15 +276,6 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, } } - // Init warning window(for applets) - if (((Window)target).getWarningString() != null) { - // accessSystemTray permission allows to display TrayIcon, TrayIcon tooltip - // and TrayIcon balloon windows without a warning window. - if (!AWTAccessor.getWindowAccessor().isTrayIconWindow((Window)target)) { - warningWindow = new XWarningWindow((Window)target, getWindow(), this); - } - } - setSaveUnder(true); updateIconImages(); @@ -502,9 +492,6 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, boolean isResized = !bounds.getSize().equals(oldBounds.getSize()); boolean isMoved = !bounds.getLocation().equals(oldBounds.getLocation()); - if (isMoved || isResized) { - repositionSecurityWarning(); - } if (isResized) { postEventToEventQueue(new ComponentEvent(getEventSource(), ComponentEvent.COMPONENT_RESIZED)); } @@ -807,7 +794,6 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, AWTAccessor.getComponentAccessor().setLocation(target, x, y); postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_MOVED)); } - repositionSecurityWarning(); } final void requestXFocus(long time) { @@ -1101,9 +1087,6 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, } updateFocusability(); promoteDefaultPosition(); - if (!vis && warningWindow != null) { - warningWindow.setSecurityWarningVisible(false, false); - } boolean refreshChildsTransientFor = isVisible() != vis; super.setVisible(vis); if (refreshChildsTransientFor) { @@ -1153,7 +1136,6 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, if (isOverrideRedirect() && vis) { updateChildrenSizes(); } - repositionSecurityWarning(); } protected void suppressWmTakeFocus(boolean doSuppress) { @@ -1162,9 +1144,6 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, final boolean isSimpleWindow() { return !(target instanceof Frame || target instanceof Dialog); } - boolean hasWarningWindow() { - return ((Window)target).getWarningString() != null; - } // The height of menu bar window int getMenuBarHeight() { @@ -1176,68 +1155,14 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, void updateChildrenSizes() { } - public void repositionSecurityWarning() { - // NOTE: On KWin if the window/border snapping option is enabled, - // the Java window may be swinging while it's being moved. - // This doesn't make the application unusable though looks quite ugly. - // Probably we need to find some hint to assign to our Security - // Warning window in order to exclude it from the snapping option. - // We are not currently aware of existence of such a property. - if (warningWindow != null) { - // We can't use the coordinates stored in the XBaseWindow since - // they are zeros for decorated frames. - ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); - int x = compAccessor.getX(target); - int y = compAccessor.getY(target); - int width = compAccessor.getWidth(target); - int height = compAccessor.getHeight(target); - warningWindow.reposition(x, y, width, height); - } - } - @Override protected void setMouseAbove(boolean above) { super.setMouseAbove(above); - updateSecurityWarningVisibility(); } @Override public void setFullScreenExclusiveModeState(boolean state) { super.setFullScreenExclusiveModeState(state); - updateSecurityWarningVisibility(); - } - - public void updateSecurityWarningVisibility() { - if (warningWindow == null) { - return; - } - - if (!isVisible()) { - return; // The warning window should already be hidden. - } - - boolean show = false; - - if (!isFullScreenExclusiveMode()) { - int state = getWMState(); - - // getWMState() always returns 0 (Withdrawn) for simple windows. Hence - // we ignore the state for such windows. - if (isVisible() && (state == XUtilConstants.NormalState || isSimpleWindow())) { - if (XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow() == - getTarget()) - { - show = true; - } - - if (isMouseAbove() || warningWindow.isMouseAbove()) - { - show = true; - } - } - } - - warningWindow.setSecurityWarningVisible(show, true); } boolean isOverrideRedirect() { @@ -1266,10 +1191,6 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, SunToolkit.awtUnlock(); } - if (warningWindow != null) { - warningWindow.destroy(); - } - removeRootPropertyEventDispatcher(); mustControlStackPosition = false; super.dispose(); @@ -1299,7 +1220,6 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, // if (ve.get_state() == XlibWrapper.VisibilityUnobscured) { // // raiseInputMethodWindow // } - repositionSecurityWarning(); } void handleRootPropertyNotify(XEvent xev) { @@ -1475,8 +1395,6 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, for (ToplevelStateListener topLevelListenerTmp : toplevelStateListeners) { topLevelListenerTmp.stateChangedICCCM(oldState, newState); } - - updateSecurityWarningVisibility(); } boolean isWithdrawn() { diff --git a/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java b/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java index 7b82229c02c..af1b77198c7 100644 --- a/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java +++ b/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java @@ -651,17 +651,10 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, private native void nativeGrab(); private native void nativeUngrab(); - private boolean hasWarningWindow() { - return ((Window)target).getWarningString() != null; - } - boolean isTargetUndecorated() { return true; } - @Override - public native void repositionSecurityWarning(); - @Override public void print(Graphics g) { // We assume we print the whole frame, diff --git a/src/java.desktop/windows/native/libawt/windows/awt.rc b/src/java.desktop/windows/native/libawt/windows/awt.rc index 3bc072180d4..36981f35f67 100644 --- a/src/java.desktop/windows/native/libawt/windows/awt.rc +++ b/src/java.desktop/windows/native/libawt/windows/awt.rc @@ -27,10 +27,3 @@ AWT_ICON ICON DISCARDABLE "awt.ico" CHECK_BITMAP BITMAP DISCARDABLE "check.bmp" - -// Note: the number of icons used is specified in the -// securityWarningIconCounter constant in awt_Toolkit.cpp. -SECURITY_WARNING_0 ICON DISCARDABLE "security_warning_bw.ico" -SECURITY_WARNING_1 ICON DISCARDABLE "security_warning_int.ico" -SECURITY_WARNING_2 ICON DISCARDABLE "security_warning.ico" - diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp b/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp index 640b06d0521..c49c2265ca3 100644 --- a/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp +++ b/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp @@ -6420,10 +6420,7 @@ void AwtComponent::PostUngrabEvent() { void AwtComponent::SetFocusedWindow(HWND window) { - HWND old = sm_focusedWindow; sm_focusedWindow = window; - - AwtWindow::FocusedWindowChanged(old, window); } /************************************************************************ diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp b/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp index 9ca12aa5802..e679eb88dd2 100644 --- a/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp +++ b/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp @@ -910,9 +910,6 @@ MsgRouting AwtFrame::WmWindowPosChanging(LPARAM windowPos) { MsgRouting AwtFrame::WmSize(UINT type, int w, int h) { currentWmSizeState = type; - if (currentWmSizeState == SIZE_MINIMIZED) { - UpdateSecurityWarningVisibility(); - } if (m_ignoreWmSize) { return mrDoDefault; diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp b/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp index b467a685516..4de63a19e30 100644 --- a/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp +++ b/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp @@ -1438,24 +1438,6 @@ LRESULT CALLBACK AwtToolkit::MouseLowLevelHook(int code, } tk.m_lastWindowUnderMouse = hwnd; - - if (fw) { - fw->UpdateSecurityWarningVisibility(); - } - // ... however, because we use GA_ROOT, we may find the warningIcon - // which is not a Java windows. - if (AwtWindow::IsWarningWindow(hwnd)) { - hwnd = ::GetParent(hwnd); - if (hwnd) { - tw = (AwtWindow*)AwtComponent::GetComponent(hwnd); - } - tk.m_lastWindowUnderMouse = hwnd; - } - if (tw) { - tw->UpdateSecurityWarningVisibility(); - } - - } } @@ -1909,48 +1891,6 @@ HICON AwtToolkit::GetAwtIconSm() return defaultIconSm; } -// The icon at index 0 must be gray. See AwtWindow::GetSecurityWarningIcon() -HICON AwtToolkit::GetSecurityWarningIcon(UINT index, UINT w, UINT h) -{ - //Note: should not exceed 10 because of the current implementation. - static const int securityWarningIconCounter = 3; - - static HICON securityWarningIcon[securityWarningIconCounter] = {NULL, NULL, NULL}; - static UINT securityWarningIconWidth[securityWarningIconCounter] = {0, 0, 0}; - static UINT securityWarningIconHeight[securityWarningIconCounter] = {0, 0, 0}; - - index = AwtToolkit::CalculateWave(index, securityWarningIconCounter); - - if (securityWarningIcon[index] == NULL || - w != securityWarningIconWidth[index] || - h != securityWarningIconHeight[index]) - { - if (securityWarningIcon[index] != NULL) - { - ::DestroyIcon(securityWarningIcon[index]); - } - - static const wchar_t securityWarningIconName[] = L"SECURITY_WARNING_"; - wchar_t iconResourceName[sizeof(securityWarningIconName) + 2]; - ::ZeroMemory(iconResourceName, sizeof(iconResourceName)); - wcscpy(iconResourceName, securityWarningIconName); - - wchar_t strIndex[2]; - ::ZeroMemory(strIndex, sizeof(strIndex)); - strIndex[0] = L'0' + index; - - wcscat(iconResourceName, strIndex); - - securityWarningIcon[index] = (HICON)::LoadImage(GetModuleHandle(), - iconResourceName, - IMAGE_ICON, w, h, LR_DEFAULTCOLOR); - securityWarningIconWidth[index] = w; - securityWarningIconHeight[index] = h; - } - - return securityWarningIcon[index]; -} - void throw_if_shutdown(void) { AwtToolkit::GetInstance().VerifyActive(); diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.h b/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.h index 29485c8ba41..d2adeca6776 100644 --- a/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.h +++ b/src/java.desktop/windows/native/libawt/windows/awt_Toolkit.h @@ -394,8 +394,6 @@ public: return value; } - HICON GetSecurityWarningIcon(UINT index, UINT w, UINT h); - /* Turns on/off dialog modality for the system. */ INLINE AwtDialog* SetModal(AwtDialog* frame) { AwtDialog* previousDialog = m_pModalDialog; diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp b/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp index a135d6f0113..9eb6cb51c7b 100644 --- a/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp +++ b/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp @@ -137,10 +137,6 @@ struct RequestWindowFocusStruct { jobject component; jboolean isMouseEventCause; }; -// struct for _RepositionSecurityWarning() method -struct RepositionSecurityWarningStruct { - jobject window; -}; struct SetFullScreenExclusiveModeStateStruct { jobject window; @@ -156,24 +152,18 @@ struct OverrideHandle { * AwtWindow fields */ -jfieldID AwtWindow::warningStringID; jfieldID AwtWindow::locationByPlatformID; jfieldID AwtWindow::autoRequestFocusID; -jfieldID AwtWindow::securityWarningWidthID; -jfieldID AwtWindow::securityWarningHeightID; jfieldID AwtWindow::windowTypeID; jmethodID AwtWindow::notifyWindowStateChangedMID; -jmethodID AwtWindow::getWarningStringMID; -jmethodID AwtWindow::calculateSecurityWarningPositionMID; jmethodID AwtWindow::windowTypeNameMID; int AwtWindow::ms_instanceCounter = 0; HHOOK AwtWindow::ms_hCBTFilter; AwtWindow * AwtWindow::m_grabbedWindow = NULL; BOOL AwtWindow::sm_resizing = FALSE; -UINT AwtWindow::untrustedWindowsCounter = 0; /************************************************************************ * AwtWindow class methods @@ -189,7 +179,6 @@ AwtWindow::AwtWindow() { m_iconInherited = FALSE; VERIFY(::SetRectEmpty(&m_insets)); VERIFY(::SetRectEmpty(&m_old_insets)); - VERIFY(::SetRectEmpty(&m_warningRect)); // what's the best initial value? m_screenNum = -1; @@ -208,11 +197,6 @@ AwtWindow::AwtWindow() { m_opaque = TRUE; m_opacity = 0xff; - - warningString = NULL; - warningWindow = NULL; - securityTooltipWindow = NULL; - securityWarningAnimationStage = 0; currentWmSizeState = SIZE_RESTORED; hContentBitmap = NULL; @@ -232,9 +216,6 @@ AwtWindow::AwtWindow() { AwtWindow::~AwtWindow() { - if (warningString != NULL) { - delete [] warningString; - } DeleteContentBitmap(); ::DeleteCriticalSection(&contentBitmapCS); } @@ -355,19 +336,6 @@ MsgRouting AwtWindow::WmWindowPosChanging(LPARAM windowPos) { return mrDoDefault; } -void AwtWindow::RepositionSecurityWarning(JNIEnv *env) -{ - RECT rect; - CalculateWarningWindowBounds(env, &rect); - - ::SetWindowPos(warningWindow, IsAlwaysOnTop() ? HWND_TOPMOST : HWND_NOTOPMOST, - rect.left, rect.top, - rect.right - rect.left, rect.bottom - rect.top, - SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | - SWP_NOOWNERZORDER - ); -} - MsgRouting AwtWindow::WmWindowPosChanged(LPARAM windowPos) { WINDOWPOS * wp = (WINDOWPOS *)windowPos; @@ -385,19 +353,6 @@ MsgRouting AwtWindow::WmWindowPosChanged(LPARAM windowPos) { prevScaleRec.scaleY = -1.0f; } - // Reposition the warning window - if (IsUntrusted() && warningWindow != NULL) { - if (wp->flags & SWP_HIDEWINDOW) { - UpdateSecurityWarningVisibility(); - } - - RepositionSecurityWarning((JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2)); - - if (wp->flags & SWP_SHOWWINDOW) { - UpdateSecurityWarningVisibility(); - } - } - if (wp->flags & SWP_HIDEWINDOW) { EnableTranslucency(FALSE); } @@ -424,29 +379,13 @@ void AwtWindow::FillClassInfo(WNDCLASSEX *lpwc) lpwc->cbWndExtra = DLGWINDOWEXTRA; } -bool AwtWindow::IsWarningWindow(HWND hWnd) -{ - const UINT len = 128; - TCHAR windowClassName[len]; - - ::RealGetWindowClass(hWnd, windowClassName, len); - return 0 == _tcsncmp(windowClassName, - AwtWindow::GetWarningWindowClassName(), len); -} - LRESULT CALLBACK AwtWindow::CBTFilter(int nCode, WPARAM wParam, LPARAM lParam) { if (nCode == HCBT_ACTIVATE || nCode == HCBT_SETFOCUS) { HWND hWnd = (HWND)wParam; AwtComponent *comp = AwtComponent::GetComponent(hWnd); - if (comp == NULL) { - // Check if it's a security warning icon - // See: 5091224, 6181725, 6732583 - if (AwtWindow::IsWarningWindow(hWnd)) { - return 1; - } - } else { + if (comp != NULL) { if (comp->IsTopLevel()) { AwtWindow* win = (AwtWindow*)comp; @@ -461,21 +400,6 @@ LRESULT CALLBACK AwtWindow::CBTFilter(int nCode, WPARAM wParam, LPARAM lParam) return ::CallNextHookEx(AwtWindow::ms_hCBTFilter, nCode, wParam, lParam); } -void AwtWindow::InitSecurityWarningSize(JNIEnv *env) -{ - warningWindowWidth = ::GetSystemMetrics(SM_CXSMICON); - warningWindowHeight = ::GetSystemMetrics(SM_CYSMICON); - - jobject target = GetTarget(env); - - env->SetIntField(target, AwtWindow::securityWarningWidthID, - warningWindowWidth); - env->SetIntField(target, AwtWindow::securityWarningHeightID, - warningWindowHeight); - - env->DeleteLocalRef(target); -} - void AwtWindow::CreateHWnd(JNIEnv *env, LPCWSTR title, DWORD windowStyle, DWORD windowExStyle, @@ -485,25 +409,6 @@ void AwtWindow::CreateHWnd(JNIEnv *env, LPCWSTR title, COLORREF colorBackground, jobject peer) { - // Retrieve the warning string - // Note: we need to get it before CreateHWnd() happens because - // the isUntrusted() method may be invoked while the HWND - // is being created in response to some window messages. - jobject target = env->GetObjectField(peer, AwtObject::targetID); - jstring javaWarningString = - (jstring)env->CallObjectMethod(target, AwtWindow::getWarningStringMID); - - if (javaWarningString != NULL) { - size_t length = env->GetStringLength(javaWarningString) + 1; - warningString = new WCHAR[length]; - env->GetStringRegion(javaWarningString, 0, - static_cast(length - 1), reinterpret_cast(warningString)); - warningString[length-1] = L'\0'; - - env->DeleteLocalRef(javaWarningString); - } - env->DeleteLocalRef(target); - InitType(env, peer); JNU_CHECK_EXCEPTION(env); @@ -517,330 +422,13 @@ void AwtWindow::CreateHWnd(JNIEnv *env, LPCWSTR title, colorForeground, colorBackground, peer); - - // Now we need to create the warning window. - CreateWarningWindow(env); -} - -void AwtWindow::CreateWarningWindow(JNIEnv *env) -{ - if (!IsUntrusted()) { - return; - } - - if (++AwtWindow::untrustedWindowsCounter == 1) { - AwtToolkit::GetInstance().InstallMouseLowLevelHook(); - } - - InitSecurityWarningSize(env); - - RECT rect; - CalculateWarningWindowBounds(env, &rect); - - RegisterWarningWindowClass(); - warningWindow = ::CreateWindowEx( - WS_EX_NOACTIVATE, - GetWarningWindowClassName(), - warningString, - WS_POPUP, - rect.left, rect.top, - rect.right - rect.left, rect.bottom - rect.top, - GetHWnd(), // owner - NULL, // menu - AwtToolkit::GetInstance().GetModuleHandle(), - NULL // lParam - ); - if (warningWindow == NULL) { - //XXX: actually this is bad... We didn't manage to create the window. - return; - } - - HICON hIcon = GetSecurityWarningIcon(); - - ICONINFO ii; - ::GetIconInfo(hIcon, &ii); - - //Note: we assume that every security icon has exactly the same shape. - HRGN rgn = BitmapUtil::BitmapToRgn(ii.hbmColor); - if (rgn) { - ::SetWindowRgn(warningWindow, rgn, TRUE); - } - - // Now we need to create the tooltip control for this window. - if (!ComCtl32Util::GetInstance().IsToolTipControlInitialized()) { - return; - } - - securityTooltipWindow = ::CreateWindowEx( - WS_EX_TOPMOST, - TOOLTIPS_CLASS, - NULL, - WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - warningWindow, - NULL, - AwtToolkit::GetInstance().GetModuleHandle(), - NULL - ); - - ::SetWindowPos(securityTooltipWindow, - HWND_TOPMOST, 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); - - - // We currently don't expect changing the size of the window, - // hence we may not care of updating the TOOL position/size. - ::GetClientRect(warningWindow, &rect); - - TOOLINFO ti; - - ti.cbSize = sizeof(ti); - ti.uFlags = TTF_SUBCLASS; - ti.hwnd = warningWindow; - ti.hinst = AwtToolkit::GetInstance().GetModuleHandle(); - ti.uId = 0; - ti.lpszText = warningString; - ti.rect.left = rect.left; - ti.rect.top = rect.top; - ti.rect.right = rect.right; - ti.rect.bottom = rect.bottom; - - ::SendMessage(securityTooltipWindow, TTM_ADDTOOL, - 0, (LPARAM) (LPTOOLINFO) &ti); -} - -void AwtWindow::DestroyWarningWindow() -{ - if (!IsUntrusted()) { - return; - } - if (--AwtWindow::untrustedWindowsCounter == 0) { - AwtToolkit::GetInstance().UninstallMouseLowLevelHook(); - } - if (warningWindow != NULL) { - // Note that the warningWindow is an owned window, and hence - // it would be destroyed automatically. However, the window - // class may only be unregistered if there's no any single - // window left using this class. Thus, we're destroying the - // warning window manually. Note that the tooltip window - // will be destroyed automatically because it's an owned - // window as well. - ::DestroyWindow(warningWindow); - warningWindow = NULL; - securityTooltipWindow = NULL; - UnregisterWarningWindowClass(); - } } void AwtWindow::DestroyHWnd() { - DestroyWarningWindow(); AwtCanvas::DestroyHWnd(); } -LPCTSTR AwtWindow::GetWarningWindowClassName() -{ - return TEXT("SunAwtWarningWindow"); -} - -void AwtWindow::FillWarningWindowClassInfo(WNDCLASS *lpwc) -{ - lpwc->style = 0L; - lpwc->lpfnWndProc = (WNDPROC)WarningWindowProc; - lpwc->cbClsExtra = 0; - lpwc->cbWndExtra = 0; - lpwc->hInstance = AwtToolkit::GetInstance().GetModuleHandle(), - lpwc->hIcon = AwtToolkit::GetInstance().GetAwtIcon(); - lpwc->hCursor = ::LoadCursor(NULL, IDC_ARROW); - lpwc->hbrBackground = NULL; - lpwc->lpszMenuName = NULL; - lpwc->lpszClassName = AwtWindow::GetWarningWindowClassName(); -} - -void AwtWindow::RegisterWarningWindowClass() -{ - WNDCLASS wc; - - ::ZeroMemory(&wc, sizeof(wc)); - - if (!::GetClassInfo(AwtToolkit::GetInstance().GetModuleHandle(), - AwtWindow::GetWarningWindowClassName(), &wc)) - { - AwtWindow::FillWarningWindowClassInfo(&wc); - ATOM atom = ::RegisterClass(&wc); - DASSERT(atom != 0); - } -} - -void AwtWindow::UnregisterWarningWindowClass() -{ - ::UnregisterClass(AwtWindow::GetWarningWindowClassName(), AwtToolkit::GetInstance().GetModuleHandle()); -} - -HICON AwtWindow::GetSecurityWarningIcon() -{ - // It is assumed that the icon at index 0 is gray - const UINT index = securityAnimationKind == akShow ? - securityWarningAnimationStage : 0; - HICON ico = AwtToolkit::GetInstance().GetSecurityWarningIcon(index, - warningWindowWidth, warningWindowHeight); - return ico; -} - -// This function calculates the bounds of the warning window and stores them -// into the RECT structure pointed by the argument rect. -void AwtWindow::CalculateWarningWindowBounds(JNIEnv *env, LPRECT rect) -{ - RECT windowBounds; - AwtToolkit::GetWindowRect(GetHWnd(), &windowBounds); - - jobject target = GetTarget(env); - jobject point2D = env->CallObjectMethod(target, - calculateSecurityWarningPositionMID, - (jdouble)windowBounds.left, (jdouble)windowBounds.top, - (jdouble)(windowBounds.right - windowBounds.left), - (jdouble)(windowBounds.bottom - windowBounds.top)); - env->DeleteLocalRef(target); - - static jclass point2DClassID = NULL; - static jmethodID point2DGetXMID = NULL; - static jmethodID point2DGetYMID = NULL; - - if (point2DClassID == NULL) { - jclass point2DClassIDLocal = env->FindClass("java/awt/geom/Point2D"); - if (point2DClassIDLocal == NULL) { - env->DeleteLocalRef(point2D); - return; - } - point2DClassID = (jclass)env->NewGlobalRef(point2DClassIDLocal); - env->DeleteLocalRef(point2DClassIDLocal); - } - - if (point2DGetXMID == NULL) { - point2DGetXMID = env->GetMethodID(point2DClassID, "getX", "()D"); - if (point2DGetXMID == NULL) { - env->DeleteLocalRef(point2D); - return; - } - } - if (point2DGetYMID == NULL) { - point2DGetYMID = env->GetMethodID(point2DClassID, "getY", "()D"); - if (point2DGetYMID == NULL) { - env->DeleteLocalRef(point2D); - return; - } - } - - - int x = (int)env->CallDoubleMethod(point2D, point2DGetXMID); - int y = (int)env->CallDoubleMethod(point2D, point2DGetYMID); - - env->DeleteLocalRef(point2D); - - rect->left = x; - rect->top = y; - rect->right = rect->left + warningWindowWidth; - rect->bottom = rect->top + warningWindowHeight; -} - -LRESULT CALLBACK AwtWindow::WarningWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch (uMsg) { - case WM_PAINT: - PaintWarningWindow(hwnd); - return 0; - - case WM_MOUSEACTIVATE: - { - // Retrieve the owner of the warning window. - HWND javaWindow = ::GetParent(hwnd); - if (javaWindow) { - // If the window is blocked by a modal dialog, substitute - // its handle with the topmost blocker. - HWND topmostBlocker = GetTopmostModalBlocker(javaWindow); - if (::IsWindow(topmostBlocker)) { - javaWindow = topmostBlocker; - } - - ::BringWindowToTop(javaWindow); - - AwtWindow * window = - (AwtWindow*)AwtComponent::GetComponent(javaWindow); - if (window == NULL) { - // Quite unlikely to go into here, but it's way better - // than getting a crash. - ::SetForegroundWindow(javaWindow); - } else { - // Activate the window if it is focusable and inactive - if (window->IsFocusableWindow() && - javaWindow != ::GetActiveWindow()) { - ::SetForegroundWindow(javaWindow); - } else { - // ...otherwise just start the animation. - window->StartSecurityAnimation(akShow); - } - } - - // In every case if there's a top-most blocker, we need to - // enable modal animation. - if (::IsWindow(topmostBlocker)) { - AwtDialog::AnimateModalBlocker(topmostBlocker); - } - } - return MA_NOACTIVATEANDEAT; - } - } - return ::DefWindowProc(hwnd, uMsg, wParam, lParam); -} - -void AwtWindow::PaintWarningWindow(HWND warningWindow) -{ - RECT updateRect; - - if (!::GetUpdateRect(warningWindow, &updateRect, FALSE)) { - // got nothing to update - return; - } - - PAINTSTRUCT ps; - HDC hdc = ::BeginPaint(warningWindow, &ps); - if (hdc == NULL) { - // indicates an error - return; - } - - PaintWarningWindow(warningWindow, hdc); - - ::EndPaint(warningWindow, &ps); -} - -void AwtWindow::PaintWarningWindow(HWND warningWindow, HDC hdc) -{ - HWND javaWindow = ::GetParent(warningWindow); - - AwtWindow * window = (AwtWindow*)AwtComponent::GetComponent(javaWindow); - if (window == NULL) { - return; - } - - ::DrawIconEx(hdc, 0, 0, window->GetSecurityWarningIcon(), - window->warningWindowWidth, window->warningWindowHeight, - 0, NULL, DI_NORMAL); -} - -static const UINT_PTR IDT_AWT_SECURITYANIMATION = 0x102; - -// Approximately 6 times a second. 0.75 seconds total. -static const UINT securityAnimationTimerElapse = 150; -static const UINT securityAnimationMaxIterations = 5; - -void AwtWindow::RepaintWarningWindow() -{ - HDC hdc = ::GetDC(warningWindow); - PaintWarningWindow(warningWindow, hdc); - ::ReleaseDC(warningWindow, hdc); -} - void AwtWindow::SetLayered(HWND window, bool layered) { const LONG ex_style = ::GetWindowLong(window, GWL_EXSTYLE); @@ -854,195 +442,9 @@ bool AwtWindow::IsLayered(HWND window) return ex_style & WS_EX_LAYERED; } -void AwtWindow::StartSecurityAnimation(AnimationKind kind) -{ - if (!IsUntrusted()) { - return; - } - if (warningWindow == NULL) { - return; - } - - securityAnimationKind = kind; - - securityWarningAnimationStage = 1; - ::SetTimer(GetHWnd(), IDT_AWT_SECURITYANIMATION, - securityAnimationTimerElapse, NULL); - - if (securityAnimationKind == akShow) { - ::SetWindowPos(warningWindow, - IsAlwaysOnTop() ? HWND_TOPMOST : HWND_NOTOPMOST, - 0, 0, 0, 0, - SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE | - SWP_SHOWWINDOW | SWP_NOOWNERZORDER); - - ::SetLayeredWindowAttributes(warningWindow, RGB(0, 0, 0), - 0xFF, LWA_ALPHA); - AwtWindow::SetLayered(warningWindow, false); - ::RedrawWindow(warningWindow, NULL, NULL, - RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN); - } else if (securityAnimationKind == akPreHide) { - // Pre-hiding means fading-out. We have to make the window layered. - // Note: Some VNC clients do not support layered windows, hence - // we dynamically turn it on and off. See 6805231. - AwtWindow::SetLayered(warningWindow, true); - } -} - -void AwtWindow::StopSecurityAnimation() -{ - if (!IsUntrusted()) { - return; - } - if (warningWindow == NULL) { - return; - } - - securityWarningAnimationStage = 0; - ::KillTimer(GetHWnd(), IDT_AWT_SECURITYANIMATION); - - switch (securityAnimationKind) { - case akHide: - case akPreHide: - ::SetWindowPos(warningWindow, HWND_NOTOPMOST, 0, 0, 0, 0, - SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE | - SWP_HIDEWINDOW | SWP_NOOWNERZORDER); - break; - case akShow: - RepaintWarningWindow(); - break; - } - - securityAnimationKind = akNone; -} - MsgRouting AwtWindow::WmTimer(UINT_PTR timerID) { - if (timerID != IDT_AWT_SECURITYANIMATION) { - return mrPassAlong; - } - - if (securityWarningAnimationStage == 0) { - return mrConsume; - } - - securityWarningAnimationStage++; - if (securityWarningAnimationStage >= securityAnimationMaxIterations) { - if (securityAnimationKind == akPreHide) { - // chain real hiding - StartSecurityAnimation(akHide); - } else { - StopSecurityAnimation(); - } - } else { - switch (securityAnimationKind) { - case akHide: - { - BYTE opacity = ((int)0xFF * - (securityAnimationMaxIterations - - securityWarningAnimationStage)) / - securityAnimationMaxIterations; - ::SetLayeredWindowAttributes(warningWindow, - RGB(0, 0, 0), opacity, LWA_ALPHA); - } - break; - case akShow: - case akNone: // quite unlikely, but quite safe - RepaintWarningWindow(); - break; - } - } - - return mrConsume; -} - -// The security warning is visible if: -// 1. The window has the keyboard window focus, OR -// 2. The mouse pointer is located within the window bounds, -// or within the security warning icon. -void AwtWindow::UpdateSecurityWarningVisibility() -{ - if (!IsUntrusted()) { - return; - } - if (warningWindow == NULL) { - return; - } - - bool show = false; - - if (IsVisible() && currentWmSizeState != SIZE_MINIMIZED && - !isFullScreenExclusiveMode()) - { - if (AwtComponent::GetFocusedWindow() == GetHWnd()) { - show = true; - } - - HWND hwnd = AwtToolkit::GetInstance().GetWindowUnderMouse(); - if (hwnd == GetHWnd()) { - show = true; - } - if (hwnd == warningWindow) { - show = true; - } - } - - if (show && (!::IsWindowVisible(warningWindow) || - securityAnimationKind == akHide || - securityAnimationKind == akPreHide)) { - StartSecurityAnimation(akShow); - } - if (!show && ::IsWindowVisible(warningWindow)) { - StartSecurityAnimation(akPreHide); - } -} - -void AwtWindow::FocusedWindowChanged(HWND from, HWND to) -{ - AwtWindow * fw = (AwtWindow *)AwtComponent::GetComponent(from); - AwtWindow * tw = (AwtWindow *)AwtComponent::GetComponent(to); - - if (fw != NULL) { - fw->UpdateSecurityWarningVisibility(); - } - if (tw != NULL) { - tw->UpdateSecurityWarningVisibility(); - - // Flash on receiving the keyboard focus even if the warning - // has already been shown (e.g. by hovering with the mouse) - tw->StartSecurityAnimation(akShow); - } -} - -void AwtWindow::_RepositionSecurityWarning(void* param) -{ - JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); - - RepositionSecurityWarningStruct *rsws = - static_cast(param); - jobject self = rsws->window; - - AwtWindow *window = NULL; - - if (self == NULL) { - env->ExceptionClear(); - JNU_ThrowNullPointerException(env, "self"); - delete rsws; - return; - } else { - window = (AwtWindow *)JNI_GET_PDATA(self); - if (window == NULL) { - THROW_NULL_PDATA_IF_NOT_DESTROYED(self); - env->DeleteGlobalRef(self); - delete rsws; - return; - } - } - - window->RepositionSecurityWarning(env); - - env->DeleteGlobalRef(self); - delete rsws; + return mrPassAlong; } void AwtWindow::InitType(JNIEnv *env, jobject peer) @@ -1919,7 +1321,6 @@ MsgRouting AwtWindow::WmSize(UINT type, int w, int h) currentWmSizeState = type; if (type == SIZE_MINIMIZED) { - UpdateSecurityWarningVisibility(); return mrDoDefault; } // Check for the new screen and update the java peer @@ -3356,20 +2757,10 @@ Java_java_awt_Window_initIDs(JNIEnv *env, jclass cls) { TRY; - CHECK_NULL(AwtWindow::warningStringID = - env->GetFieldID(cls, "warningString", "Ljava/lang/String;")); CHECK_NULL(AwtWindow::locationByPlatformID = env->GetFieldID(cls, "locationByPlatform", "Z")); - CHECK_NULL(AwtWindow::securityWarningWidthID = - env->GetFieldID(cls, "securityWarningWidth", "I")); - CHECK_NULL(AwtWindow::securityWarningHeightID = - env->GetFieldID(cls, "securityWarningHeight", "I")); - CHECK_NULL(AwtWindow::getWarningStringMID = - env->GetMethodID(cls, "getWarningString", "()Ljava/lang/String;")); CHECK_NULL(AwtWindow::autoRequestFocusID = env->GetFieldID(cls, "autoRequestFocus", "Z")); - CHECK_NULL(AwtWindow::calculateSecurityWarningPositionMID = - env->GetMethodID(cls, "calculateSecurityWarningPosition", "(DDDD)Ljava/awt/geom/Point2D;")); jclass windowTypeClass = env->FindClass("java/awt/Window$Type"); CHECK_NULL(windowTypeClass); @@ -4016,28 +3407,6 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_windows_WWindowPeer_requestWindowFocus CATCH_BAD_ALLOC_RET(JNI_FALSE); } -/* - * Class: sun_awt_windows_WWindowPeer - * Method: repositionSecurityWarning - * Signature: ()V - */ -JNIEXPORT void JNICALL -Java_sun_awt_windows_WWindowPeer_repositionSecurityWarning(JNIEnv *env, - jobject self) -{ - TRY; - - RepositionSecurityWarningStruct *rsws = - new RepositionSecurityWarningStruct; - rsws->window = env->NewGlobalRef(self); - - AwtToolkit::GetInstance().InvokeFunction( - AwtWindow::_RepositionSecurityWarning, rsws); - // global refs and mds are deleted in _RepositionSecurityWarning - - CATCH_BAD_ALLOC; -} - /* * Class: sun_awt_windows_WLightweightFramePeer * Method: overrideNativeHandle diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Window.h b/src/java.desktop/windows/native/libawt/windows/awt_Window.h index 5b0b8ba2ae4..d683a6cc7db 100644 --- a/src/java.desktop/windows/native/libawt/windows/awt_Window.h +++ b/src/java.desktop/windows/native/libawt/windows/awt_Window.h @@ -50,20 +50,15 @@ class AwtWindow : public AwtCanvas { public: /* java.awt.Window field ids */ - static jfieldID warningStringID; static jfieldID locationByPlatformID; static jfieldID screenID; /* screen number passed over from WindowPeer */ static jfieldID autoRequestFocusID; - static jfieldID securityWarningWidthID; - static jfieldID securityWarningHeightID; /* sun.awt.windows.WWindowPeer field and method IDs */ static jfieldID windowTypeID; static jmethodID notifyWindowStateChangedMID; /* java.awt.Window method IDs */ - static jmethodID getWarningStringMID; - static jmethodID calculateSecurityWarningPositionMID; static jmethodID windowTypeNameMID; AwtWindow(); @@ -240,7 +235,6 @@ public: static void _SetOpacity(void* param); static void _SetOpaque(void* param); static void _UpdateWindow(void* param); - static void _RepositionSecurityWarning(void* param); static void _SetFullScreenExclusiveModeState(void* param); static void _GetNativeWindowSize(void* param); static void _OverrideHandle(void *param); @@ -257,8 +251,6 @@ public: jobject peer); virtual void DestroyHWnd(); - static void FocusedWindowChanged(HWND from, HWND to); - inline HWND GetOverriddenHWnd() { return m_overriddenHwnd; } inline void OverrideHWnd(HWND hwnd) { m_overriddenHwnd = hwnd; } @@ -304,58 +296,15 @@ private: void RedrawWindow(); void DeleteContentBitmap(); - static UINT untrustedWindowsCounter; - - WCHAR * warningString; - - // The warning icon - HWND warningWindow; - // The tooltip that appears when hovering the icon - HWND securityTooltipWindow; - //Allows substitute parent window with JavaFX stage to make it below a dialog HWND m_overriddenHwnd; - UINT warningWindowWidth; - UINT warningWindowHeight; - void InitSecurityWarningSize(JNIEnv *env); - HICON GetSecurityWarningIcon(); - - void CreateWarningWindow(JNIEnv *env); - void DestroyWarningWindow(); - static LPCTSTR GetWarningWindowClassName(); - void FillWarningWindowClassInfo(WNDCLASS *lpwc); - void RegisterWarningWindowClass(); - void UnregisterWarningWindowClass(); - static LRESULT CALLBACK WarningWindowProc( - HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); - - static void PaintWarningWindow(HWND warningWindow); - static void PaintWarningWindow(HWND warningWindow, HDC hdc); - void RepaintWarningWindow(); - void CalculateWarningWindowBounds(JNIEnv *env, LPRECT rect); - - void AnimateSecurityWarning(bool enable); - UINT securityWarningAnimationStage; - - enum AnimationKind { - akNone, akShow, akPreHide, akHide - }; - - AnimationKind securityAnimationKind; - - void StartSecurityAnimation(AnimationKind kind); - void StopSecurityAnimation(); - - void RepositionSecurityWarning(JNIEnv *env); - static void SetLayered(HWND window, bool layered); static bool IsLayered(HWND window); BOOL fullScreenExclusiveModeState; inline void setFullScreenExclusiveModeState(BOOL isEntered) { fullScreenExclusiveModeState = isEntered; - UpdateSecurityWarningVisibility(); } inline BOOL isFullScreenExclusiveMode() { return fullScreenExclusiveModeState; @@ -363,8 +312,6 @@ private: public: - void UpdateSecurityWarningVisibility(); - static bool IsWarningWindow(HWND hWnd); protected: BOOL m_isResizable; @@ -374,10 +321,6 @@ protected: BOOL m_iconInherited; /* TRUE if icon is inherited from the owner */ BOOL m_filterFocusAndActivation; /* Used in the WH_CBT hook */ - inline BOOL IsUntrusted() { - return warningString != NULL; - } - UINT currentWmSizeState; void EnableTranslucency(BOOL enable); diff --git a/src/java.desktop/windows/native/libawt/windows/security_warning.ico b/src/java.desktop/windows/native/libawt/windows/security_warning.ico deleted file mode 100644 index 67793ed82648ad9f6f9164075ecbd60e1555da51..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17542 zcmdU0dvFz389xw)Ag=^0&z2;_gftCF2ocBw5-1dT)>0JBA2?X5w$7;FRBfG(go1r( zhjwg5X`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6Y`k^zYw4 z4CHy~=r#IK@MZHJpDB8RPUk1>ysRw;Bqb#!4CLA6oaTZ1jzO-BXEYCo%pR!jciP9y z)oaZ&qx$S9d3HJboVFv@k%PqRB#Yi@G42mu$a?5W88T!@7|8R|;aXIES*IAict3wz zN^ozs_KNNFm}TEHd&jzmOrBlNI;Twq+g`5YwuW9nIi8Ph;5l1+{!5;lJo&zQ2=Tgr zO?Zz9dy`7|bwcifDj7X`bQs8Uk|mF}6l}&TJYROuhrb=?0GyChR4m!q*7XvR_0P0{)x@%K?xiZid3XDI+|J6x z<4VyNUW6LWVqAkCP&RPiI396&*}(arFQVS%2XQ@1inTOJZesO~t27FCcQ zN;n_#Rn+Rgg=?^ayr|EMc)079C7jKB5bt|f(QRk+y5j;6|2OJG@-VJ}Abmr{&(B1k z5z=FKd`_@gO}mz}Mw~kRRFlbbNS$L1N1jLO92+?DTvF$V_gL^I3(hBXj(DF1Z?xc? zQs;>GTJUBI&MS3}c)ta2xG0>T>==!k6#g^EYPjcIk2P@5xgHzfo^w6IaSG>pgyVG1 w^~e`%IM<_o!A6f<3j<%eAy1Ed@rH9f@+BP3^~e`-IM-uaddFOk?UkJWA7e~-^Z)<= diff --git a/src/java.desktop/windows/native/libawt/windows/security_warning_bw.ico b/src/java.desktop/windows/native/libawt/windows/security_warning_bw.ico deleted file mode 100644 index 68a1824a2f529c830407f433863b101338c8478d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17542 zcmdU$S&U836UUnoGxlBV`x=DA10fzH z#Mt*GVqeD=BK9W_qW|Y}?$rJFZD+l6?&UY~Ro&IqU3JdA_jFZt9i^(N8md(*<W^8@7_hmph1Il{rdG? z(2g?~U8Zi@)2C0@H*en5Z{NO+gmL4>>5d&cx}Y6(9y-uv>!&|s#ti-X_3Oykzkk05 zaps`IOEWJco7K)4jj-Rsyu54>1J%soH_c^ zrAzwRvuB~GSFfH1QDj+@wZrr?URGA7pFDXIit5#?YY;`2HKXW8X5PGc`o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%Ot4&@x>ICZHW88#We{>Fu_*On zlJB+Ys8OTbnl;W4Xxrma`q|WznfB8r4{g`XMCr3_3R4rd`| z{y$0^n`_jl;evLQIi?Ic{qjk+jbVMxam-v(ly<|04bwg-?I?3hnW$$+VYV~Ac=2L4 z|K(M8=f|s6tClw5C+Ec{pN7sTwndfkIwSMa4UZZZsd*F%&rjaw2jvo@+H1=#UAiRxM~-8!m#lrx>SYJ<9d!*R;CacKyll>8y=)BP`PHeK zdk<#=a&|1#J})rkX>)#%R2^%O{fwDs0k$3VhYT5#5&IGg!}F3AUX(M0FuS6TuUWGu zeHP*6#|#@bOt)^`Is@>$WZ~iGux3>KNyu>yZ~BR5yQHK` zZQF@skWET&lIu_p5SA~^re+{X8-v!e-xsiR*W{3MQOgx%Q`|AL?##CTZ?~Omr6z=$ zHaT+;3NPDwk+}D;s`Aw1iQPhTRijr`TfOFED>b|FzBcWDll@$i)CdXny3QncWh`RU z8u_g$aze`yq#mh~RzRsss-(_)EY6!OPJL1(b>3%j-e_^^lq#w7UW;I0JL>5Rt#H)S7wRZ3qA%1@+>*XfUaX-nR9>(V%2)iUcR9(loxR53*}`T`a*djhrUo=&Qa=rl`>vm diff --git a/src/java.desktop/windows/native/libawt/windows/security_warning_int.ico b/src/java.desktop/windows/native/libawt/windows/security_warning_int.ico deleted file mode 100644 index d773dca9e643c9916849428fc601ed4f856cee6b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17542 zcmdU0X>b(B6>boP2vA6n5Dpio!59;+!bu^J5C{%q0ls5a_bF3=#qfaH{x0@$$Z2^)frm%+4NK3b{V@>(}qv zwV3Jm`n3?XL>Ce(*cmBAybz*!bJu+7uY|bIyhsMt->W0Utd>Ib=us`-QHYY( zLcGp8Y(n&BK+ftXI&mev2q2~yM;iV8o9`&Ku$0z6`d>%@U+@XvG0qRA?{yD!{ z*tYVGwLxhcY4+)>w7BH1SJZ11L4X}u*o19w{;@td{UcgbT<#UMYu6^gjx222@eP^y z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