From 897ab9a4017e80a25144f3f8987cde2298594697 Mon Sep 17 00:00:00 2001 From: Morph21 Date: Tue, 8 Feb 2022 02:47:04 +0100 Subject: [PATCH] Release 1.2.2 Fixed overlay capture feature --- .../platform/core/MercuryConstants.java | 2 +- .../ui/adr/components/AbstractAdrFrame.java | 18 ++++++++++++++---- .../resources/notes/patch/patch-notes-new.json | 8 ++++++++ pom.xml | 2 +- release_files/release_config.xml | 8 ++++---- 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/app-core/src/main/java/com/mercury/platform/core/MercuryConstants.java b/app-core/src/main/java/com/mercury/platform/core/MercuryConstants.java index 38f5ddb7..37b690c9 100644 --- a/app-core/src/main/java/com/mercury/platform/core/MercuryConstants.java +++ b/app-core/src/main/java/com/mercury/platform/core/MercuryConstants.java @@ -1,7 +1,7 @@ package com.mercury.platform.core; public class MercuryConstants { - public static final String APP_VERSION = "1.2.1"; + public static final String APP_VERSION = "1.2.2"; public static final String SERVER_HOST = "exslims.ddns.net"; public static final int PORT = 5555; } diff --git a/app-ui/src/main/java/com/mercury/platform/ui/adr/components/AbstractAdrFrame.java b/app-ui/src/main/java/com/mercury/platform/ui/adr/components/AbstractAdrFrame.java index b07d9788..7ef7a050 100644 --- a/app-ui/src/main/java/com/mercury/platform/ui/adr/components/AbstractAdrFrame.java +++ b/app-ui/src/main/java/com/mercury/platform/ui/adr/components/AbstractAdrFrame.java @@ -6,7 +6,6 @@ import com.mercury.platform.ui.adr.components.panel.AdrComponentPanel; import com.mercury.platform.ui.frame.AbstractOverlaidFrame; import com.mercury.platform.ui.misc.MercuryStoreUI; -//import com.sun.awt.AWTUtilities; import com.sun.jna.Native; import com.sun.jna.platform.win32.User32; import com.sun.jna.platform.win32.WinDef; @@ -29,9 +28,20 @@ public abstract class AbstractAdrFrame extends protected AbstractAdrFrame(T descriptor) { super(); this.descriptor = descriptor; - //AWTUtilities.setWindowOpaque(this, false); + setWindowOpaque(this, false); + } + private void setWindowOpaque(Window window, boolean opaque) { + Color bg = window.getBackground(); + if (bg == null) { + bg = new Color(0, 0, 0, 0); + } + window.setBackground(new Color(bg.getRed(), bg.getGreen(), bg.getBlue(), + opaque ? 255 : 0)); + } + + private static WinDef.HWND getHWnd(Component w) { WinDef.HWND hwnd = new WinDef.HWND(); hwnd.setPointer(Native.getComponentPointer(w)); @@ -71,8 +81,8 @@ private void setTransparent(Component w) { this.componentHwnd = getHWnd(w); this.settingWl = User32.INSTANCE.GetWindowLong(componentHwnd, WinUser.GWL_EXSTYLE); int transparentWl = User32.INSTANCE.GetWindowLong(componentHwnd, WinUser.GWL_EXSTYLE) | - WinUser.WS_EX_LAYERED | - WinUser.WS_EX_TRANSPARENT; + WinUser.WS_EX_LAYERED | + WinUser.WS_EX_TRANSPARENT; User32.INSTANCE.SetWindowLong(componentHwnd, WinUser.GWL_EXSTYLE, transparentWl); } } diff --git a/app-ui/src/main/resources/notes/patch/patch-notes-new.json b/app-ui/src/main/resources/notes/patch/patch-notes-new.json index b08e8daf..46f05e92 100644 --- a/app-ui/src/main/resources/notes/patch/patch-notes-new.json +++ b/app-ui/src/main/resources/notes/patch/patch-notes-new.json @@ -1,4 +1,12 @@ [ + { + "version": "1.2.2", + "fix": [ + { + "changed": "Fixed overlay capture feature" + } + ] + }, { "version": "1.2.1", "fix": [ diff --git a/pom.xml b/pom.xml index 6e7f0ea0..962d2899 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ pom - 1.2.1 + 1.2.2 2.0.2 4.4.0 diff --git a/release_files/release_config.xml b/release_files/release_config.xml index 239d5ead..530a06c2 100644 --- a/release_files/release_config.xml +++ b/release_files/release_config.xml @@ -30,12 +30,12 @@ -XX:+UseG1GC - 1.2.1.0 - 1.2.1 + 1.2.2.0 + 1.2.2 MercuryTrade Morph21 - 1.2.1.0 - 1.2.1 + 1.2.2.0 + 1.2.2 MercuryTrade Morph MercuryTrade