macOS: Implement NSTextInputClient.windowLevel
Without this optional NSTextInputClient method the input methods will assume it's safe to place the input panel somewhere above NSFloatingWindowLevel. But our NSWindow level can potentially be higher than that, if set via QWindow::setFlags(), or directly on the NSWindow. In practice this can be observed by setting a level higher than kCGDockWindowLevel on the NSWindow. Account for this by returning the true window level. Pick-to: 6.6 6.5 6.2 Change-Id: I77d9ac3c59e2f6de9b768c7519b2bc0f1e5fda1d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>bb10
parent
cb94e360ec
commit
709d2848e1
|
|
@ -505,6 +505,23 @@
|
|||
return NSNotFound;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns the window level of the text input.
|
||||
|
||||
This allows the input method to place its input panel
|
||||
above the text input.
|
||||
*/
|
||||
- (NSInteger)windowLevel
|
||||
{
|
||||
// The default level assumed by input methods is NSFloatingWindowLevel,
|
||||
// but our NSWindow level could be higher than that for many reasons,
|
||||
// including being set via QWindow::setFlags() or directly on the
|
||||
// NSWindow, or because we're embedded into a native view hierarchy.
|
||||
// Return the actual window level to account for this.
|
||||
return m_platformWindow ? m_platformWindow->nativeWindow().level
|
||||
: NSNormalWindowLevel;
|
||||
}
|
||||
|
||||
// ------------- Helper functions -------------
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue