diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a1c2be4..a139981a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,7 +130,7 @@ set_property(GLOBAL PROPERTY OS_FOLDERS ON) # Specify the CEF distribution version. if(NOT DEFINED CEF_VERSION) - set(CEF_VERSION "141.0.10+g1d65b0d+chromium-141.0.7390.123") + set(CEF_VERSION "142.0.17+g60aac24+chromium-142.0.7444.176") endif() # Determine the platform. diff --git a/java/org/cef/browser/CefBrowserOsr.java b/java/org/cef/browser/CefBrowserOsr.java index b999b6ba..4a87b2ea 100644 --- a/java/org/cef/browser/CefBrowserOsr.java +++ b/java/org/cef/browser/CefBrowserOsr.java @@ -199,11 +199,15 @@ public void paint(Graphics g) { @Override public void addNotify() { - super.addNotify(); - if (removed_) { - notifyAfterParentChanged(); - removed_ = false; + if (!removed_) { + // On MacOS it may happen that the platform has not correctly notified us of a previous removal. + // In this case, the jogl canvas will throw an error because of a second add operation in a row. + // We patch this by post-notifying the canvas of the removal first, before notifying the canvas as normal. + super.removeNotify(); } + super.addNotify(); + notifyAfterParentChanged(); + removed_ = false; } @Override