How to increase GUIX performance when using gx_widget_show/hide

Kwon 20 Reputation points
2023-06-27T19:57:20.7266667+00:00

I have a window with 4 subwindows covering the same area on the canvas, each subwindow with ~50 nested widgets. The UI is controlled by a state machine executing every 40ms processing any touch events that the state machine consumes and subsequently calls the gx_widget_show/gx_widget_hide APIs on the subwindows. Calling gx_widget_show(subwindow_1) is instant, however calling gx_widget_hide(subwindow_1) and then gx_widget_show(subwindow_2) takes significantly longer(~1second). Is there any recommendation on how to improve this process?

Azure RTOS
Azure RTOS
An Azure embedded development suite including a small but powerful operating system for resource-constrained devices.
331 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ting Zhu 485 Reputation points Microsoft Employee
    2023-06-29T06:53:46.4133333+00:00

    What is the priority of the state machine thread in relation to the GUIX thread? If the state machine thread has a lower priority, my assumption is that after calling gx_widget_hide(subwindow_1), the thread might be preempted by the GUIX thread, resulting in the screen being refreshed. gx_widget_show(subwindow_2) will get execution after the refresh is complete. This implies that calling gx_widget_hide and gx_widget_show consecutively could potentially trigger GUIX refreshing twice. To investigate this further, could you try placing the hide and show calls within the GUIX thread, such as in an event processing function, and observe if the same behavior occurs?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.