Hi all,
I am using a 176x220px display on a Cortex-M without buffering, so I need to avoid unnecessary redrawings etc. to minimize flickering.
My application uses several Dialogs but only one is shown at a time. To switch between the dialogs, I implemented a swipe detection that is, the user swipes left or right to go through the dialogs.
After swiping, I hide the current window and show the desired window like this
So far, that works. However, there is one annoying issue:
After the new dialog is displayed, the first touch to any area triggers a redraw and I don't know how to prevent this.
I recorded the messages sent to the window directly after it is activated via swiping, see below.
Of course, it's no C code, but it's nicely displayed using the quoting.
The comments translate the msg IDs to WM_ message codes.
Display All
Any idea what causes this redrawing and how to remove it?
Best regards,
Rainer
I am using a 176x220px display on a Cortex-M without buffering, so I need to avoid unnecessary redrawings etc. to minimize flickering.
My application uses several Dialogs but only one is shown at a time. To switch between the dialogs, I implemented a swipe detection that is, the user swipes left or right to go through the dialogs.
After swiping, I hide the current window and show the desired window like this
So far, that works. However, there is one annoying issue:
After the new dialog is displayed, the first touch to any area triggers a redraw and I don't know how to prevent this.
I recorded the messages sent to the window directly after it is activated via swiping, see below.
Of course, it's no C code, but it's nicely displayed using the quoting.
The comments translate the msg IDs to WM_ message codes.
C Source Code
- // user message to update the contents
- PresetDlg: MsgId: 1026, src: 0, dst: 3, code: 3
- // NOTIFY_PARENT -> GOT_FOCUS
- PresetDlg: MsgId: 38, src: 12, dst: 3, code: 8
- // CHILD_HAS_FOCUS
- PresetDlg: MsgId: 32, src: 0, dst: 3, code: 268450896
- // PRE_PAINT
- PresetDlg: MsgId: 46, src: 0, dst: 3, code: 0
- // PAINT
- PresetDlg: MsgId: 15, src: 0, dst: 4, code: 268450700
- // POST_PAINT
- PresetDlg: MsgId: 47, src: 0, dst: 3, code: 0
- Now, the window is displayed properly and has focus.
- At this point, when I touch the display, a redraw is triggered as follows:
- // PID_STATE_CHANGED
- PresetDlg: MsgId: 17, src: 0, dst: 3, code: 268450768
- // TOUCH
- PresetDlg: MsgId: 12, src: 0, dst: 3, code: 268450732
- // TOUCH
- PresetDlg: MsgId: 12, src: 0, dst: 3, code: 268450732
- // TOUCH
- PresetDlg: MsgId: 12, src: 0, dst: 3, code: 268450732
- // PRE_PAINT
- PresetDlg: MsgId: 46, src: 0, dst: 3, code: 0
- // PAINT
- PresetDlg: MsgId: 15, src: 0, dst: 4, code: 268450700
- // POST_PAINT
- PresetDlg: MsgId: 47, src: 0, dst: 3, code: 0
- After this one redraw, no further redraws are done (except when desired by actions caused by touching a button).
- // TOUCH
- PresetDlg: MsgId: 12, src: 0, dst: 3, code: 268450732
- // PID_STATE_CHANGED
- PresetDlg: MsgId: 17, src: 0, dst: 3, code: 268450768
- // TOUCH
- PresetDlg: MsgId: 12, src: 0, dst: 3, code: 268450732
- ...
- PresetDlg: MsgId: 17, src: 0, dst: 3, code: 268450768
- PresetDlg: MsgId: 12, src: 0, dst: 3, code: 268450732
- PresetDlg: MsgId: 12, src: 0, dst: 3, code: 268450732
- PresetDlg: MsgId: 12, src: 0, dst: 3, code: 268450732
- PresetDlg: MsgId: 18, src: 0, dst: 3, code: 268450732
Any idea what causes this redrawing and how to remove it?
Best regards,
Rainer