From: Jaehyun Cho Date: Fri, 28 Jan 2022 09:35:09 +0000 (+0900) Subject: [NUI] Support RequestLayout() while main loop is in idle state X-Git-Tag: accepted/tizen/unified/20231205.024657~1180 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=74618c08ca4f6f78590eabc08ad5000e14701b32;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Support RequestLayout() while main loop is in idle state Previously, RequestLayout() was not supported if it was called while main loop was in idle state. Now, RequestLayout() calls Awake() to awake main loop again and Layout can be re-calculated correctly. --- diff --git a/src/Tizen.NUI/src/public/Layouting/LayoutItem.cs b/src/Tizen.NUI/src/public/Layouting/LayoutItem.cs index 3b074c5..6efc654 100755 --- a/src/Tizen.NUI/src/public/Layouting/LayoutItem.cs +++ b/src/Tizen.NUI/src/public/Layouting/LayoutItem.cs @@ -348,7 +348,15 @@ namespace Tizen.NUI public void RequestLayout() { flags = flags | LayoutFlags.ForceLayout; - if (parent != null) + if (parent == null) + { + // If RequestLayout() is called while main loop is in idle state, + // then Awake() is required to awake main loop again and + // Layout can be re-calculated correctly. + // For performance, Awake() is called only by the root layout. + ProcessorController.Instance.Awake(); + } + else { LayoutGroup layoutGroup = parent as LayoutGroup; if (layoutGroup != null && !layoutGroup.LayoutRequested)