InputCommon:QuarzKB&M: Use view position instead of window position
This commit is contained in:
parent
798b241832
commit
588c4bd635
|
@ -23,6 +23,7 @@
|
|||
|
||||
@implementation DolWindowPositionObserver
|
||||
{
|
||||
NSView* _view;
|
||||
NSWindow* _window;
|
||||
NSRect _frame;
|
||||
std::mutex _mtx;
|
||||
|
@ -30,7 +31,7 @@
|
|||
|
||||
- (NSRect)calcFrame
|
||||
{
|
||||
return [_window frame];
|
||||
return [_window convertRectToScreen:[_view frame]];
|
||||
}
|
||||
|
||||
- (instancetype)initWithView:(NSView*)view
|
||||
|
@ -38,6 +39,7 @@
|
|||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
_view = view;
|
||||
_window = [view window];
|
||||
_frame = [self calcFrame];
|
||||
[_window addObserver:self forKeyPath:@"frame" options:0 context:nil];
|
||||
|
|
Loading…
Reference in New Issue