From ed05ac710b91694d64e86ad498549b3a6b0bce7b Mon Sep 17 00:00:00 2001 From: "retiutut@icloud.com" Date: Fri, 3 Sep 2021 15:43:57 -0500 Subject: [PATCH] Fix highDPI code breaking GUI on some Macs Fixes #987 Fixes #990 --- CHANGELOG.md | 8 ++++++++ OpenBCI_GUI/Info.plist.tmpl | 4 ++-- OpenBCI_GUI/OpenBCI_GUI.pde | 27 +++++++++++++++------------ 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 468107c26..79f11848f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# v5.0.7 + +### Improvements + + +### Bug Fixes +* Fix GUI not running on some Macs due to high-dpi screen code #987 #990 + # v5.0.6 ### Improvements diff --git a/OpenBCI_GUI/Info.plist.tmpl b/OpenBCI_GUI/Info.plist.tmpl index 9aad9c08c..936cc6a2d 100644 --- a/OpenBCI_GUI/Info.plist.tmpl +++ b/OpenBCI_GUI/Info.plist.tmpl @@ -23,7 +23,7 @@ CFBundleShortVersionString 5 CFBundleVersion - 5.0.6 + 5.0.7 CFBundleSignature ???? NSHumanReadableCopyright @@ -32,7 +32,7 @@ Copyright © 2021 OpenBCI CFBundleGetInfoString - July 2021 + September 2021 @@jvm_runtime@@ diff --git a/OpenBCI_GUI/OpenBCI_GUI.pde b/OpenBCI_GUI/OpenBCI_GUI.pde index c7084707e..6fda69e2d 100644 --- a/OpenBCI_GUI/OpenBCI_GUI.pde +++ b/OpenBCI_GUI/OpenBCI_GUI.pde @@ -60,8 +60,8 @@ import http.requests.*; // Global Variables & Instances //------------------------------------------------------------------------ //Used to check GUI version in TopNav.pde and displayed on the splash screen on startup -String localGUIVersionString = "v5.0.6"; -String localGUIVersionDate = "July 2021"; +final String localGUIVersionString = "v5.0.7-alpha.1"; +String localGUIVersionDate = "September 2021"; String guiLatestVersionGithubAPI = "https://api.github.com/repos/OpenBCI/OpenBCI_GUI/releases/latest"; String guiLatestReleaseLocation = "https://github.com/OpenBCI/OpenBCI_GUI/releases/latest"; @@ -288,6 +288,9 @@ TopNav topNav; ddf.minim.analysis.FFT[] fftBuff = new ddf.minim.analysis.FFT[nchan]; //from the minim library boolean isFFTFiltered = true; //yes by default ... this is used in dataProcessing.pde to determine which uV array feeds the FFT calculation +StringBuilder globalScreenResolution; +StringBuilder globalScreenDPI; + //------------------------------------------------------------------------ // Global Functions //------------------------------------------------------------------------ @@ -308,18 +311,18 @@ void settings() { win_h = 580; } size(win_w, win_h, P2D); -} -void setup() { - StringBuilder sb_res = new StringBuilder("Screen Resolution: "); - sb_res.append(displayWidth); - sb_res.append(" X "); - sb_res.append(displayHeight); + globalScreenResolution = new StringBuilder("Screen Resolution: "); + globalScreenResolution.append(displayWidth); + globalScreenResolution.append(" X "); + globalScreenResolution.append(displayHeight); //Account for high-dpi displays on Mac, Windows, and Linux Machines Fixes #968 pixelDensity(displayDensity()); - StringBuilder sb_dpi = new StringBuilder("High-DPI Screen Detected: "); - sb_dpi.append(displayDensity() == 2); + globalScreenDPI = new StringBuilder("High-DPI Screen Detected: "); + globalScreenDPI.append(displayDensity() == 2); +} +void setup() { frameRate(120); copyPaste = new CopyPaste(); @@ -381,8 +384,8 @@ void setup() { } println("Console Log Started at Local Time: " + directoryManager.getFileNameDateTime()); - println(sb_res.toString()); - println(sb_dpi.toString()); + println(globalScreenResolution.toString()); + println(globalScreenDPI.toString()); println(osName.toString()); println("Welcome to the Processing-based OpenBCI GUI!"); //Welcome line. println("For more information, please visit: https://openbci.github.io/Documentation/docs/06Software/01-OpenBCISoftware/GUIDocs");