Skip to content

Fix/tray icon flicker and block slider when HDR is on#18

Open
Cesarsk wants to merge 9 commits into
zpix1:mainfrom
Cesarsk:fix/tray-icon-flicker
Open

Fix/tray icon flicker and block slider when HDR is on#18
Cesarsk wants to merge 9 commits into
zpix1:mainfrom
Cesarsk:fix/tray-icon-flicker

Conversation

@Cesarsk
Copy link
Copy Markdown
Contributor

@Cesarsk Cesarsk commented May 24, 2026

Hi @zpix1, I hope this is appreciated. I wanted to fix a couple of annoying issue.

PR Summary:

  • Fix tray left-click behavior so startup and subsequent clicks use consistent open/close state.
  • Keep the hidden startup webview parked offscreen without marking it as open.
  • Move slow display/hardware commands off the Tauri UI thread.
  • Keep monitor data visible during background refreshes and prevent overlapping reloads.
  • Cache slow EDID/input capability probes.
  • Avoid unnecessary brightness/input-source refetches on monitor switching.
  • Reduce UI delays from debug serialization, slider animations, dialog close timers, and unnecessary control re-renders.
  • Disable brightness controls when HDR is enabled.

Bug showed in a video (slow down the video to see it):

IMG_8236.MOV

@Cesarsk Cesarsk changed the title Fix/tray icon flicker Fix/tray icon flicker and block slider when HDR is on May 24, 2026
@zpix1 zpix1 assigned zpix1 and Cesarsk and unassigned zpix1 May 26, 2026
@zpix1 zpix1 requested review from Copilot and zpix1 and removed request for zpix1 May 26, 2026 09:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses UI/tray interaction issues in the Tauri app and prevents invalid brightness changes when HDR is enabled on a monitor.

Changes:

  • Disable the brightness slider when hdr_status === "on" to block brightness adjustments under HDR.
  • Rework tray left-click handling to toggle the main window open/closed and add a 300ms focus-out hide delay to reduce flicker/double-click issues.
  • Dependency/lockfile updates (including package lock version bump and updated toolchain deps).

Reviewed changes

Copilot reviewed 3 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/components/MonitorControls.tsx Disables BrightnessSlider while HDR is enabled.
src-tauri/src/lib.rs Implements tray left-click toggle logic and focus-out debounced hide.
src-tauri/src/winDisplays.rs Minor formatting/import ordering and log formatting adjustments.
src-tauri/src/settings.rs Formatting-only change (brace alignment).
src-tauri/capabilities/default.json Formatting-only change (brace alignment).
package-lock.json Updates lockfile versions/dependencies and app version field.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src-tauri/src/lib.rs Outdated
Comment thread src-tauri/src/lib.rs Outdated
@Cesarsk
Copy link
Copy Markdown
Contributor Author

Cesarsk commented May 28, 2026

Hi @zpix1,

Addressed comments. New PR Summary:

  • Fix tray left-click behavior so startup and subsequent clicks use consistent open/close state.
  • Keep the hidden startup webview parked offscreen without marking it as open.
  • Move slow display/hardware commands off the Tauri UI thread.
  • Keep monitor data visible during background refreshes and prevent overlapping reloads.
  • Cache slow EDID/input capability probes.
  • Avoid unnecessary brightness/input-source refetches on monitor switching.
  • Reduce UI delays from debug serialization, slider animations, dialog close timers, and unnecessary control re-renders.
  • Disable brightness controls when HDR is enabled.

Feel free to review, thanks!

Comment thread src-tauri/src/lib.rs Outdated
let _ = window.show();
MAIN_WINDOW_OPEN.store(false, Ordering::SeqCst);

if std::env::var_os("WINDISPLAY_SMOKE").is_some() {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is it? is it required in lib.rs?

@zpix1
Copy link
Copy Markdown
Owner

zpix1 commented May 30, 2026

Disable brightness controls when HDR is enabled.

Better add some description (title tooltip) to blocked brightness when HDR is on, something like "Brightness can't be adjusted when HDR is on"

Fix tray left-click behavior so startup and subsequent clicks use consistent open/close state.

Actually window hide on focus out is a feature, and it is not working now. You can extract option to settings (it actually exist as hidden one (shouldHideUIOnFocusOut))

Slider animations when switching monitors

It's a feature. If you don't like it, you can extract an option to settings, something like "reduced motion", and make it disabled by default.

Overall, great job!

Copy link
Copy Markdown
Owner

@zpix1 zpix1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As stated above

@zpix1
Copy link
Copy Markdown
Owner

zpix1 commented May 30, 2026

Also, please update changelog and bump version after fixes.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 15 changed files in this pull request and generated 1 comment.

Comment thread src-tauri/src/lib.rs
@Cesarsk
Copy link
Copy Markdown
Contributor Author

Cesarsk commented May 30, 2026

Hi @zpix1,

thanks for the detailed review.

I addressed the requested changes in commit fedc266:

  • Added the HDR-disabled brightness tooltip with the text: Brightness can't be adjusted when HDR is on.
  • Restored hide-on-focus-out behavior and exposed the existing shouldHideUIOnFocusOut setting in Settings as Hide controls when focus is lost.
  • Kept the tray toggle fix intact by debouncing/cancelling focus-out hides when the tray toggle/reveal path is active.
  • Restored slider animations. They still respect the OS prefers-reduced-motion setting. For now it's fine to not have it. I was fighting to understand how to speed up the UI on my Computer. I actually like the animation.
  • Removed the WINDISPLAY_SMOKE block and smoke_report command from lib.rs; that was only local smoke-test instrumentation and is not required in the app -> Sorry about this, I haven't noticed it and I used it to do automatic tests on my side.

Thanks again for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants