JBR-5497: revert JRSUIController changes (performOnMainThreadWaiting:YES) to avoid UI freeze but appkit violations must be fixed in follow-up fix

This commit is contained in:
bourgesl
2024-10-17 09:09:07 +02:00
committed by Maxim Kartashev
parent 4e4e5c74c5
commit d27909ade0

View File

@@ -25,7 +25,6 @@
#import "JNIUtilities.h"
#import <JavaRuntimeSupport/JavaRuntimeSupport.h>
#import <ThreadUtilities.h>
#import "apple_laf_JRSUIControl.h"
#import "apple_laf_JRSUIConstants_DoubleValue.h"
@@ -160,12 +159,13 @@ static inline jint doPaintCGContext(CGContextRef cgRef, jlong controlPtr, jlong
{
JRSUIControlRef control = (JRSUIControlRef)jlong_to_ptr(controlPtr);
_SyncEncodedProperties(control, oldProperties, newProperties);
/*
JBR-5497: revert to avoid UI freeze => must be fixed in follow-up fix
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
*/
CGRect bounds = CGRectMake(x, y, w, h);
JRSUIControlDraw(gRenderer, control, cgRef, bounds);
}];
/* }]; */
return 0;
}
@@ -254,11 +254,12 @@ JNIEXPORT jint JNICALL Java_apple_laf_JRSUIControl_getNativeHitPart
CGPoint point = CGPointMake(pointX, pointY);
__block jint result;
/*
JBR-5497: revert to avoid UI freeze => must be fixed in follow-up fix
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
*/
result = JRSUIControlGetHitPart(gRenderer, control, bounds, point);
}];
/* }]; */
return result;
}
@@ -272,9 +273,12 @@ JNIEXPORT jboolean JNICALL Java_apple_laf_JRSUIUtils_00024ScrollBar_shouldUseScr
{
__block Boolean result;
/*
JBR-5497: revert to avoid UI freeze => must be fixed in follow-up fix
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
*/
result = JRSUIControlShouldScrollToClick();
}];
/* }]; */
return result;
}
@@ -290,11 +294,13 @@ JNIEXPORT void JNICALL Java_apple_laf_JRSUIControl_getNativePartBounds
_SyncEncodedProperties(control, oldProperties, newProperties);
__block CGRect partBounds;
/*
JBR-5497: revert to avoid UI freeze => must be fixed in follow-up fix
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
*/
CGRect frame = CGRectMake(x, y, w, h);
partBounds = JRSUIControlGetScrollBarPartBounds(control, frame, part);
}];
/* }]; */
jdouble *rect = (*env)->GetPrimitiveArrayCritical(env, rectArray, NULL);
if (rect != NULL) {
@@ -319,9 +325,12 @@ JNIEXPORT jdouble JNICALL Java_apple_laf_JRSUIControl_getNativeScrollBarOffsetCh
__block jdouble result;
/*
JBR-5497: revert to avoid UI freeze => must be fixed in follow-up fix
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
*/
CGRect frame = CGRectMake(x, y, w, h);
result = (jdouble)JRSUIControlGetScrollBarOffsetFor(control, frame, offset, visibleAmount, extent);
}];
/* }]; */
return result;
}