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