Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix highDPI code breaking GUI on some Macs #995

Merged
merged 1 commit into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions OpenBCI_GUI/Info.plist.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<key>CFBundleShortVersionString</key>
<string>5</string>
<key>CFBundleVersion</key>
<string>5.0.6</string>
<string>5.0.7</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>NSHumanReadableCopyright</key>
Expand All @@ -32,7 +32,7 @@
Copyright © 2021 OpenBCI
</string>
<key>CFBundleGetInfoString</key>
<string>July 2021</string>
<string>September 2021</string>
<!-- End of the set that can be customized -->

@@jvm_runtime@@
Expand Down
27 changes: 15 additions & 12 deletions OpenBCI_GUI/OpenBCI_GUI.pde
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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
//------------------------------------------------------------------------
Expand All @@ -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();
Expand Down Expand Up @@ -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");
Expand Down