Skip to content

Commit d66ca54

Browse files
committed
UIViewComponentPeer: Avoid sending unnecessary UIWindowScene change notifications
1 parent 87cec3b commit d66ca54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/juce_gui_basics/native/juce_UIViewComponentPeer_ios.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353

5454
void setWindowScene (UIWindowScene* x) API_AVAILABLE (ios (13.0))
5555
{
56-
windowScene = x;
57-
listeners.call ([] (auto& l) { l.windowSceneChanged(); });
56+
if (std::exchange (windowScene, x) != x)
57+
listeners.call ([] (auto& l) { l.windowSceneChanged(); });
5858
}
5959

6060
UIWindowScene* getWindowScene() const API_AVAILABLE (ios (13.0))

0 commit comments

Comments
 (0)