GSoC 2024: Improvements to the Blender macOS User Interface Experience - Weekly Reports

Final Report - Improvements to the Blender macOS User Interface Experience - GSoC 2024

Summary

Over this summer, I got to work on improving the Blender macOS User Interface Experience. While the initial goal of the project was to add native macOS menubar support and inline titlebar decoration to Blender, the end goal ended up shifting towards more general macOS and general UI research, while still working on client-side window decorations, as outlined in this kickoff meeting note by my mentor Julian.

As such, this project ended up focusing on a new cross-platform API for client-side window decorations, combined with a practical colored titlebar macOS decoration implementation. I also worked on general macOS user experience and interface improvements, as well as backend refactors, while also experimenting with additional general UI enhancements.

Links and Process

During the project, I had regular weekly sync-up meetings with my mentor Julian, and for the first half of the project, my second co-mentor Farsthary. Towards the second half of the project, I also attended the bi-weekly UI module meetings, the notes of which you can find linked in the Weekly Reports.

Deliverables and Code

Colored Titlebar Decoration (macOS)

The main deliverable of this project, with probably the most impact on the Blender macOS end-user experience, are the Colored Titlebar Window Decorations. Providing native menu bar tinting to the Blender Window based on the current theme, blending the Blender window content with its titlebar, and improving its integration in the surrounding macOS environment.

juxtapose-gif
Colored titlebar decoration before/after GIF, using the default Blender Theme and the macOS Light Theme to showcase the difference


Full macOS Titlebar Window Blending, featuring the Nordic Gold Theme

More Informations, Screenshots, and Implementation Details can be found in the Pull Request: macOS: Colored Titlebar Client-Side Decorations - GSoC 2024

Client-Side Decorations Window Manager API (General UI)

Another main deliverable of this GSoC project, and a byproduct of the Colored Titlebar Window Decoration implementation, is the creation of an expandable, flag-based, Window Manager Client-Side Decoration API. With the ability to create dynamic decorations based off the current Blender theme or window state, while also being as simple and platform-independent as possible. See the technical API overview for more details.

A great example of the use of this API, is the Proof-of-Concept implementation of the Colored Titlebar decoration on Windows 11 by Harley Acheson (@Harleya - many thanks!), using a minimum amount of Windows specific backend code, and sharing the same decoration logic as its macOS counterpart


See Harley’s PR comment for more details.

Objective-C Refactor (macOS)

To lay a solid foundation for future Blender macOS features, and modernize the (now more than 10 years old!) GHOST Cocoa backend, one of the main deliverables of this GSoC project is a global refactor of the Blender Objective-C code, which also serves as a proposal for a unified Objective-C code style. To help with code review, the final result was split into 5 Pull Requests, for a grand diff total of (+1781 -1887) lines (with some overlap between PRs).

  • Main Tracking Issue #126772
    • Remove unsound use of const in Objective-C code #126768
    • Use idiomatic Obj-C objects for Window/App delegates #126767
    • Autoreleasepool and property dot-notation refactor #126771
    • Port BLI_delete_soft from objc_* runtime calls to proper Obj-C #126766
    • WindowViewCocoa refactor #126769
    • General Code Style cleanups #126770

Color Picker Layout Rework (General UI)

Capture_2024-08-06_22.44.08

Note: Work In Progress GIF — Final design is still under review and subject to change.

Pull Request: UI: Color Picker layout rework #125675

Image Copy / Pasting Support (macOS)

Capture_2024-08-14_02.02.08

Pull Request: macOS: Add Image Clipboard Copy/Paste Support #126574

Splash Screen notice to warn against reduced performance on Rosetta (macOS)

Note: Work In Progress — Further layout experiments and discussions are needed, with the general idea being approved.

Pull Request: macOS: Implement a Splash Screen notice to warn against reduced performance on Rosetta - GSoC 2024 #124382

Bugfixes

  • Window Titles
    • Fix: Window title not properly updating on editor change #124304
    • Fix: UI: Wrong single editor window titles due to unset area sub-spacetype #126224
    • Fix: UI: Editor window(s) title update when using interactive docking #126383
  • Interactive Docking (See Feature Info Thread)
    • Fix: Interactive Docking support on High-DPI/Retina Displays #125926
    • WIP Fix: Interactive Docking modal operator re-run glitch #126379
  • General UI
    • Fix #126246: Missing Outliner redraw notifier when making datablock single user #126386
    • WM API: Improve naming of WM_window_pixels_* functions #125994
  • Small documentation nitpicks
    • Fix bpy module typo #104880
    • Fix: RNA: Wrong doc description for WM_cursor_modal_set() / restore() #126227

Future Plans

Wrap up on-going work

Finish the code review of ongoing PRs, such as the UI: Color Picker layout rework, the macOS Rosetta Splash Screen Warning, etc…

Port old legacy client-side decorations Inline Titlebar experiment to the newly developed decoration API.

Legacy Inline Titlebar decoration experiment

Continue working on on-going experiments

  • macOS Specific: Native Color Picker, Theme Auto-Switching, iCloud support, Full Multi-Monitor Window Placement Support, etc…
  • General UI: Better main window titlebar, remove extra edges around main window
  • Objective-C Refactor: Use modern Cocoa APIs, removing remaining legacy code, switching to ARC
  • Color Related: New RGB node layout, Color Data-Block Drag-and-Drop in Node Tree, new Color Picker slider and wheel shapes
  • Improvements to macOS Steam Deployment via Universal Binaries
  • And more!

Thanks!

I would like to give a very warm thanks to everyone who supported me throughout this project, and most importantly to my mentor Julian Eisel, for his valuable guidance and feedbacks, and for keeping me motivated through regular sync-up meetings. As well as to my second co-mentor, Farsthary for his time and assistance during the first half of this project.

I would also like to thanks the Blender UI Module team, Pablo Vazquez for his interest in my works and his feedbacks, and especially Harley Acheson, for taking the time to answer my UI related questions, providing tons of useful feedbacks, and reviewing my code.

Finally I want to express my overall gratitudes to all the Blender Developers, and most importantly, the Blender Community. Looking forward to continue contributing to Blender and its beautiful user interface in the future!

26 Likes