Window behaviour has changed between OSX 10.12.6 and 10.13.1

I experience some difference in the way windows are handled.


I have windows without title :


        self.window!.titleVisibility = NSWindow.TitleVisibility.hidden
        self.window!.titlebarAppearsTransparent = true
        self.window!.styleMask.insert(NSWindow.StyleMask.fullSizeContentView)

I draw a textField with a coloured background at the place of the title, next to the control buttons.

In 10.12.6, I set the background color of the textField at windowDidLoad ; and it stays so all time (that helps user recognize what type of window it is).

When I run the same code in 10.13.1, the color of the textField changes when window is not frontmost ; just as if system was using the color defined in xib for textField when window is not frontmost.


I tried to force background color in all func:

windowDidBecomeMain

windowDidResignKey

windowDidBecomeKey

windowDidResignMain

No result.


However, another textField which is single character does not experience the problem.

(I noticed in XCode 9.2 release note a point about this :

Localization warnings are no longer reported for a UILabel with numberOfLines set to 0, or for any single-character text strings. (34767956)

Could there be a link ?)


I read this SO thread that seems to hint at a bug or change of behavior at least.

h ttps://stackoverflow.com/questions/44448448/frameless-browserwindow-in-macos-10-13-beta-still-displays-a-title-bar


Is this documented somewhere ?

Is there a way to avoid this behavior .

Is this a bug ?


------------------------------------------

I also noticed that the dragging of objects in the window that was very smooth on 10.12 is now a bit jirky.

Here also, did anything change in 10.13 with porrer performance ?

EDITED : Problem was a intempestive cursor update. My error, nothing to do with OSX.

Replies

I found a workaround.


In fact, nothing to do with single character field.


I have a subclass

class TextFieldWithHelp: NSTextField


If I use it for the textField, the backgroundcolor problem disappear.


This subclass has no specific draw (just call super).


EDITED: I suspect this to be really OS related and not app specific:

I noticed also some change in other apps for NSButtons. For instance, OpenOffice now hilites all buttons in blue (when window is front) in OSX 10.13.1 (either for version 4.1.1 of 2014 or the latest 4.1.4 of 2017).

On OSX 10.12.6, with version 4.1.3, no such problem.