Disabling hardware acceleration for Night Shift
-
27-04-2021 - |
Frage
I'm noticing some artifacts when I watch full-screen videos on macOS with Night Shift enabled, and I suspect they are caused by hardware, because they disappear whenever an overlay appears over a full-screen video.
So, I was wondering, is there any way to disable hardware acceleration for Night Shift? And, if not, then is there any other application I can use that would perform the same function, but without taking advantage of hardware acceleration? (maybe an old version of f.lux or something else?)
Lösung
Since the artifacts disappear whenever an overlay appears, I solved the issue by creating an app that displays a persistent, invisible overlay:
- Created a new macOS Cocoa App in Xcode.
- Edited the window properties in
MainMenu.xib
, in the attributes inspector, and unchecked "Title Bar", "Shadow", "Close", "Minimize" and "Resize", then in the size inspector I set content size width and height to 1, and initial position x and y to 0. - Edited
Info.plist
and added a new property "Application is agent (UIElement)" set toYES
. Edited
AppDelegate.swift
and changedapplicationDidFinishLaunching
to:window.isOpaque = false window.alphaValue = 0 window.ignoresMouseEvents = true window.level = .floating window.collectionBehavior = [.canJoinAllSpaces, .transient]
Compiled the app for production with Product 🢒 Archive 🢒 Distribute App 🢒 Copy App.
Now, whenever I want to watch full-screen videos with Night Shift turned on, I can start the application and there won't be any further artifacts. I can then close it from Activity Monitor. Another option would be to have it run at startup (System Preferences 🢒 Users & Groups 🢒 Login Items).