Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not change window properties during MetalRedrawer creation #1034

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions skiko/src/awtMain/objectiveC/macos/MetalRedrawer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,6 @@ static jmethodID getOnOcclusionStateChangedMethodID(JNIEnv *env, jobject redrawe
return onOcclusionStateChanged;
}


static void setWindowPropertiesUnsafe(NSWindow* window, jboolean transparency) {
if (window == NULL) return;
if (transparency) {
window.hasShadow = NO;
}
}

static void setWindowProperties(NSWindow* window, jboolean transparency) {
if (NSThread.currentThread.isMainThread) {
setWindowPropertiesUnsafe(window, transparency);
} else {
// In case of OpenJDK, EDT thread != NSThread main thread
__weak NSWindow *weakWindow = window;
dispatch_async(dispatch_get_main_queue(), ^{
setWindowPropertiesUnsafe(weakWindow, transparency);
});
}
}

extern "C"
{

Expand Down Expand Up @@ -181,8 +161,6 @@ JNIEXPORT jlong JNICALL Java_org_jetbrains_skiko_redrawer_MetalRedrawer_createMe
device.inflightSemaphore = dispatch_semaphore_create(device.layer.maximumDrawableCount);

NSWindow* window = (__bridge NSWindow*) (void *) windowPtr;
setWindowProperties(window, transparency);

jmethodID onOcclusionStateChanged = getOnOcclusionStateChangedMethodID(env, redrawer);
device.occlusionObserver =
[[NSNotificationCenter defaultCenter] addObserverForName:NSWindowDidChangeOcclusionStateNotification
Expand Down
Loading