Handled potential native errors better

This commit is contained in:
crschnick 2024-07-26 13:18:45 +00:00
parent 4a84c07c56
commit 8ea0f98ae9

View file

@ -1,6 +1,7 @@
package io.xpipe.app.core.window;
import io.xpipe.app.core.AppProperties;
import io.xpipe.app.issue.ErrorEvent;
import io.xpipe.app.util.NativeBridge;
import io.xpipe.app.util.ThreadHelper;
import io.xpipe.core.util.ModuleHelper;
@ -42,10 +43,14 @@ public class NativeMacOsWindowControl {
return false;
}
try {
lib.get().setAppearance(new NativeLong(nsWindow), seamlessFrame, darkMode);
if (seamlessFrame) {
ThreadHelper.sleep(100);
}
} catch (Throwable e) {
ErrorEvent.fromThrowable(e).handle();
}
return true;
}
}