aboutsummaryrefslogtreecommitdiff
path: root/src/osx/gui/Window.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/osx/gui/Window.mm')
-rw-r--r--src/osx/gui/Window.mm11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/osx/gui/Window.mm b/src/osx/gui/Window.mm
index a026a455..0112fd43 100644
--- a/src/osx/gui/Window.mm
+++ b/src/osx/gui/Window.mm
@@ -241,6 +241,11 @@ void OsxWindow::CreateWindow() {
[p_->window_ setDelegate:p_->window_delegate_];
+ if (p_->parent_) {
+ auto parent = CheckPlatform<OsxWindow>(p_->parent_, GetPlatformId());
+ [p_->window_ setParentWindow:parent->p_->window_];
+ }
+
NSView* content_view = [[CruView alloc] init:p_.get()
input_context_p:p_->input_method_context_->p_.get()
frame:Rect(Point{}, p_->content_rect_.GetSize())];
@@ -254,6 +259,12 @@ void OsxWindow::CreateWindow() {
RequestRepaint();
}
+bool OsxWindow::RequestFocus() {
+ if (!p_->window_) return false;
+ [p_->window_ makeKeyWindow];
+ return true;
+}
+
Point OsxWindow::GetMousePosition() {
auto p = [p_->window_ mouseLocationOutsideOfEventStream];
return Point(p.x, p.y);