Skip to content

feat: use native macOS window frame on Apple Silicon#907

Open
ZiWei09 wants to merge 2 commits into
DreamSourceLab:masterfrom
ZiWei09:feat/macos-native-window
Open

feat: use native macOS window frame on Apple Silicon#907
ZiWei09 wants to merge 2 commits into
DreamSourceLab:masterfrom
ZiWei09:feat/macos-native-window

Conversation

@ZiWei09
Copy link
Copy Markdown

@ZiWei09 ZiWei09 commented May 15, 2026

Summary

This PR replaces the Windows-style custom titlebar and resize borders with the native macOS window frame on Q_OS_DARWIN. The custom FramelessWindowHint approach looks out of place on macOS and causes usability issues.

Changes

  • DSView/pv/mainframe.cpp: On macOS, use Qt::Window instead of FramelessWindowHint, skip creating TitleBar and Border widgets, use QGridLayout directly for the main window
  • DSView/pv/mainwindow.cpp: Add #ifndef Q_OS_DARWIN guard for title_bar assertion since it's NULL on macOS

Tested

  • macOS 15 (Apple Silicon, arm64 native build)
  • Windows/Linux behavior is unchanged (all changes are guarded by #ifdef Q_OS_DARWIN)

Screenshot

Before: Custom Windows-style titlebar with DSL logo, minimize/maximize/close buttons
After: Native macOS window frame with standard traffic light buttons and proxy icon


This addresses the request for native macOS arm64 builds (see v1.3.2-arm64 release with prebuilt .dmg at https://github.com/ZiWei09/DSView/releases).

On macOS, skip the Windows-style frameless window with custom TitleBar
and resize Borders. Use Qt::Window with native decorations instead.
Add NULL guards for _titleBar since it's not created on macOS.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@oxoocoffee
Copy link
Copy Markdown

I did try your build and dropped it to ~/Applications/DSView.app. Since the application is not signed it is failing to start. But running sudo xattr -r -d com.apple.quarantine ~/Applications/DSView.app which should do the trick, I get following

 sudo xattr -r -d com.apple.quarantine ~/Applications/DSView.app
xattr: No such file: /Users/rob/Applications/DSView.app/Contents/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages
 $ ls -l /Users/rob/Applications/DSView.app//Contents/Frameworks/Python.framework/Versions/3.14/lib/python3.14/ | grep site-packages
lrwxr-xr-x@   1 rob  staff      46 May 15 13:43 site-packages -> ../../../../../../lib/python3.14/site-packages

 $ ls -l  /Users/rob/Applications/DSView.app//Contents/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/
ls: /Users/rob/Applications/DSView.app//Contents/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/: No such file or directory

$ python3 --version 
Python 3.14.5

@ZiWei09
Copy link
Copy Markdown
Author

ZiWei09 commented May 20, 2026

Thanks for the detailed report! This is a build system issue — when the Python.framework is copied into the app bundle, a relative symlink (site-packages -> ../../../../../../lib/python3.14/site-packages) is preserved from the Homebrew installation, but the target directory (Contents/lib/python3.14/site-packages) isn't included in the bundle. This causes both codesign and xattr to fail.
Quick Fix For Nowå
You can resolve this temporarily by running the following commands in your terminal:

sudo rm /Applications/DSView.app/Contents/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages
sudo mkdir /Applications/DSView.app/Contents/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages
sudo codesign --force --deep --sign - /Applications/DSView.app
sudo xattr -r -d com.apple.quarantine /Applications/DSView.app
open /Applications/DSView.app

I'll also fix this in the build system so future builds handle the broken symlinks automatically.

When macdeployqt copies Python.framework into the app bundle, relative
symlinks from the Homebrew installation (e.g., site-packages) become
broken because their targets don't exist inside the bundle. This causes
codesign and xattr to fail. Added a `fixup_bundle` make target that
replaces broken symlinks with real directories.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

2 participants