diff --git a/CHANGES b/CHANGES index 58a54cac28f..efb29e8f9f6 100755 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ [1.9.15] - [BREAKING CHANGE] Requires Java 7 or above - [BREAKING CHANGE] API Change: Scaling is now an object instead of an enum. This may change behavior when used with serialization. +- [BREAKING CHANGE] Group#clearChildren() now unfocuses the actors. Added Group#clearChildren(boolean unfocus) for when this isn't wanted. #6423 - Scene2d.ui: Added new ParticleEffectActor to use particle effects on Stage - API addition: iOS: Added HdpiMode option to IOSApplicationConfiguration to allow users to set whether they want to work in logical or raw pixels (default logical). - Fix for #6377 Gdx.net.openURI not working with targetSdk 30 diff --git a/gdx/src/com/badlogic/gdx/scenes/scene2d/Group.java b/gdx/src/com/badlogic/gdx/scenes/scene2d/Group.java index 886333bc75b..eb070dd8af9 100644 --- a/gdx/src/com/badlogic/gdx/scenes/scene2d/Group.java +++ b/gdx/src/com/badlogic/gdx/scenes/scene2d/Group.java @@ -349,11 +349,20 @@ public Actor removeActorAt (int index, boolean unfocus) { return actor; } - /** Removes all actors from this group. */ + /** Removes all actors from this group and unfocuses them. Calls {@link #clearChildren(boolean)} with true. */ public void clearChildren () { + clearChildren(true); + } + + /** Removes all actors from this group. */ + public void clearChildren (boolean unfocus) { Actor[] actors = children.begin(); for (int i = 0, n = children.size; i < n; i++) { Actor child = actors[i]; + if (unfocus) { + Stage stage = getStage(); + if (stage != null) stage.unfocus(child); + } child.setStage(null); child.setParent(null); }