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 transparency issues on Windows 10 #1412

Merged
merged 2 commits into from
Dec 15, 2023
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Changed
- updated many translations

### Fixed
- transparency issues on Windows 10

## [1.15.1] - 2023-11-19
### Fixed
- improve DND monitoring memory usage
Expand Down
13 changes: 10 additions & 3 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -736,11 +736,12 @@ function startMicrobreak () {
frame: showBreaksAsRegularWindows,
show: false,
backgroundThrottling: false,
transparent: settings.get('transparentMode'),
transparent: true,
backgroundColor: calculateBackgroundColor(settings.get('miniBreakColor')),
skipTaskbar: !showBreaksAsRegularWindows,
focusable: showBreaksAsRegularWindows,
alwaysOnTop: !showBreaksAsRegularWindows,
hasShadow: false,
title: 'Stretchly',
webPreferences: {
preload: path.join(__dirname, './microbreak.js'),
Expand All @@ -762,6 +763,7 @@ function startMicrobreak () {
let microbreakWinLocal = new BrowserWindow(windowOptions)
// seems to help with multiple-displays problems
microbreakWinLocal.setSize(windowOptions.width, windowOptions.height)

ipcMain.on('send-microbreak-data', (event) => {
const startTime = Date.now()
if (!strictMode || postponable) {
Expand Down Expand Up @@ -877,11 +879,12 @@ function startBreak () {
frame: showBreaksAsRegularWindows,
show: false,
backgroundThrottling: false,
transparent: settings.get('transparentMode'),
transparent: true,
backgroundColor: calculateBackgroundColor(settings.get('mainColor')),
skipTaskbar: !showBreaksAsRegularWindows,
focusable: showBreaksAsRegularWindows,
alwaysOnTop: !showBreaksAsRegularWindows,
hasShadow: false,
title: 'Stretchly',
webPreferences: {
preload: path.join(__dirname, './break.js'),
Expand Down Expand Up @@ -1080,7 +1083,11 @@ function resetBreaks () {
}

function calculateBackgroundColor (color) {
return color + Math.round(settings.get('opacity') * 255).toString(16)
let opacityMultiplier = 1;
if (settings.get('transparentMode')) {
opacityMultiplier = settings.get('opacity');
}
return color + Math.round(opacityMultiplier * 255).toString(16)
}

function loadIdeas () {
Expand Down