mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +00:00
Create NSWindow in main thread/queue on Skia/OSX port
We cannot create/handle UI controls outside the main thread.
This commit is contained in:
parent
69bb8fef9b
commit
7118251f83
@ -24,18 +24,26 @@ public:
|
||||
gfx::Size clientSize;
|
||||
gfx::Size restoredSize;
|
||||
|
||||
Impl() {
|
||||
closing = false;
|
||||
scale = 1;
|
||||
window = [OSXWindow new];
|
||||
[window setCloseDelegate:this];
|
||||
}
|
||||
|
||||
void notifyClose() override {
|
||||
closing = true;
|
||||
}
|
||||
};
|
||||
|
||||
SkiaWindow::SkiaWindow(EventQueue* queue, SkiaDisplay* display)
|
||||
: m_impl(new SkiaWindow::Impl)
|
||||
: m_impl(nullptr)
|
||||
{
|
||||
m_impl->closing = false;
|
||||
m_impl->scale = 1;
|
||||
m_impl->window = [OSXWindow new];
|
||||
[m_impl->window setCloseDelegate:m_impl];
|
||||
dispatch_sync(
|
||||
dispatch_get_main_queue(),
|
||||
^{
|
||||
m_impl = new SkiaWindow::Impl;
|
||||
});
|
||||
}
|
||||
|
||||
SkiaWindow::~SkiaWindow()
|
||||
|
Loading…
x
Reference in New Issue
Block a user