I have an app which contains a WKWebview inside of an NSWindow which has its level set to an elevated value (NSStatusWindowLevel). From this webview, if a user presses the character palette key combination (ctrl + cmd + space), the palette is being shown at level 20 (found through trial & error), causing it to be underneath the WKWebView's window. If I change the level of the window to 20 or lower, the palette renders properly.
If I perform the same action on the same window (with level NSStatusWindowLevel) with say an NSTextView instead, the palette properly shows above the window.
Is there a bug in how WkWebView is causing the character palette draw, or is there something I can do to properly layer the character palette window?
For any future folks with a similar problem, I figured out the issue. The character palette looks to the first responder to see if it implements the NSTextInputClient protocol. If it does, the protocol function windowLevel tells the character palette what the correct window level it needs to show at is. If this isn't implemented (such as with a WKWebView, or anything besides NSTextView it seems) the palette defaults to 20.
Subclassing WKWebView and implementing the minimum required functions along with windowLevel to return the WKWebView window's level solved the problem.