Skip to content

Commit

Permalink
fix: unexpected fullscreen on macos
Browse files Browse the repository at this point in the history
Basically this allows the fullscreen calls to only activate when
dwmapi is available, indicating that such environment is Windows.

Confirmed as fixed on macOS 12.6 (21G115).
  • Loading branch information
GalvinGao committed Mar 22, 2023
1 parent fe89368 commit 44af522
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utils/dark_title_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ def set_dark_titlebar(window, dwmapi) -> None:
def set_dark_titlebar_qt(obj, dwmapi, fix=True) -> None:
if dwmapi and theme_manager.get_night_mode():
set_dark_titlebar(obj, dwmapi)
# Trick to refresh the titlebar after dark titlebar is set
if fix:
obj.showFullScreen()
obj.showNormal()
# Trick to refresh the titlebar after dark titlebar is set
if fix:
obj.showFullScreen()
obj.showNormal()

if system() == "Windows" and theme_manager.get_night_mode():
dwmapi = WinDLL("dwmapi")
Expand Down

3 comments on commit 44af522

@XiaKaiYang
Copy link

Choose a reason for hiding this comment

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

I don't know what the meaning .

@iso-hexane
Copy link

Choose a reason for hiding this comment

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

THANK YOU SO MUCH

@flippantbird
Copy link

Choose a reason for hiding this comment

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

Works

Please sign in to comment.