Commit cdeb98ed authored by Roman Sedaikin's avatar Roman Sedaikin

Fixed getting NSWindow in drawlayer.m

parent e8268d3f
...@@ -302,9 +302,8 @@ JNIEXPORT void JNICALL Java_org_jetbrains_skiko_HardwareLayer_updateLayer(JNIEnv ...@@ -302,9 +302,8 @@ JNIEXPORT void JNICALL Java_org_jetbrains_skiko_HardwareLayer_updateLayer(JNIEnv
if (unknownWindows == nil) if (unknownWindows == nil)
{ {
NSMutableArray<NSWindow *> *windows = [NSMutableArray arrayWithArray: [[NSApplication sharedApplication] windows]]; NSMutableArray<NSWindow *> *windows = [NSMutableArray arrayWithArray: [[NSApplication sharedApplication] windows]];
NSWindow *mainWindow = [[NSApplication sharedApplication] mainWindow]; layersSet.window = [windows lastObject];
layersSet.window = mainWindow; [windows removeObject: layersSet.window];
[windows removeObject: mainWindow];
unknownWindows = windows; unknownWindows = windows;
} }
else else
...@@ -320,11 +319,10 @@ JNIEXPORT void JNICALL Java_org_jetbrains_skiko_HardwareLayer_updateLayer(JNIEnv ...@@ -320,11 +319,10 @@ JNIEXPORT void JNICALL Java_org_jetbrains_skiko_HardwareLayer_updateLayer(JNIEnv
{ {
layersSet.window = value.window; layersSet.window = value.window;
} }
[windows removeObject: value.window];
} }
if (layersSet.window == NULL) if (layersSet.window == NULL)
{ {
layersSet.window = [windows firstObject]; layersSet.window = [windows lastObject];
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment