mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JBR-4959 [macOS Ventura] Screen flickering after OS update when IDE is full screen
Replace multiple CHANGE_SCREEN notifications fired around the same time with just one
(cherry picked from commit cd6ca71ea8)
This commit is contained in:
@@ -44,6 +44,9 @@
|
||||
// The following is a AWT convention?
|
||||
#define PREFERENCES_TAG 42
|
||||
|
||||
// Do not pass extra NOTIFY_CHANGE_SCREEN during this timeout
|
||||
#define CHANGE_SCREEN_MUTE_TIME 0.1
|
||||
|
||||
static void addMenuItem(NSMenuItem* menuItem, NSInteger index) {
|
||||
AWT_ASSERT_APPKIT_THREAD;
|
||||
|
||||
@@ -512,7 +515,14 @@ AWT_ASSERT_APPKIT_THREAD;
|
||||
}
|
||||
|
||||
+ (void)_didChangeScreen {
|
||||
[ApplicationDelegate _notifyJava:com_apple_eawt__AppEventHandler_NOTIFY_CHANGE_SCREEN];
|
||||
static CFTimeInterval time = 0;
|
||||
|
||||
CFTimeInterval ctime = CACurrentMediaTime();
|
||||
|
||||
if (time + CHANGE_SCREEN_MUTE_TIME < ctime) {
|
||||
time = ctime;
|
||||
[ApplicationDelegate _notifyJava:com_apple_eawt__AppEventHandler_NOTIFY_CHANGE_SCREEN];
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieves the menu to be attached to the Dock icon (AppKit callback)
|
||||
|
||||
Reference in New Issue
Block a user