Unwanted redrawing of FRAMEWIN

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Unwanted redrawing of FRAMEWIN

      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

      C Source Code

      1. WM_HideWindow(hDlgInputSelect);
      2. WM_ShowWindow(hDlgPreset);
      3. WM_SetFocus(hDlgPreset);


      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

      1. // user message to update the contents
      2. PresetDlg: MsgId: 1026, src: 0, dst: 3, code: 3
      3. // NOTIFY_PARENT -> GOT_FOCUS
      4. PresetDlg: MsgId: 38, src: 12, dst: 3, code: 8
      5. // CHILD_HAS_FOCUS
      6. PresetDlg: MsgId: 32, src: 0, dst: 3, code: 268450896
      7. // PRE_PAINT
      8. PresetDlg: MsgId: 46, src: 0, dst: 3, code: 0
      9. // PAINT
      10. PresetDlg: MsgId: 15, src: 0, dst: 4, code: 268450700
      11. // POST_PAINT
      12. PresetDlg: MsgId: 47, src: 0, dst: 3, code: 0
      13. Now, the window is displayed properly and has focus.
      14. At this point, when I touch the display, a redraw is triggered as follows:
      15. // PID_STATE_CHANGED
      16. PresetDlg: MsgId: 17, src: 0, dst: 3, code: 268450768
      17. // TOUCH
      18. PresetDlg: MsgId: 12, src: 0, dst: 3, code: 268450732
      19. // TOUCH
      20. PresetDlg: MsgId: 12, src: 0, dst: 3, code: 268450732
      21. // TOUCH
      22. PresetDlg: MsgId: 12, src: 0, dst: 3, code: 268450732
      23. // PRE_PAINT
      24. PresetDlg: MsgId: 46, src: 0, dst: 3, code: 0
      25. // PAINT
      26. PresetDlg: MsgId: 15, src: 0, dst: 4, code: 268450700
      27. // POST_PAINT
      28. PresetDlg: MsgId: 47, src: 0, dst: 3, code: 0
      29. After this one redraw, no further redraws are done (except when desired by actions caused by touching a button).
      30. // TOUCH
      31. PresetDlg: MsgId: 12, src: 0, dst: 3, code: 268450732
      32. // PID_STATE_CHANGED
      33. PresetDlg: MsgId: 17, src: 0, dst: 3, code: 268450768
      34. // TOUCH
      35. PresetDlg: MsgId: 12, src: 0, dst: 3, code: 268450732
      36. ...
      37. PresetDlg: MsgId: 17, src: 0, dst: 3, code: 268450768
      38. PresetDlg: MsgId: 12, src: 0, dst: 3, code: 268450732
      39. PresetDlg: MsgId: 12, src: 0, dst: 3, code: 268450732
      40. PresetDlg: MsgId: 12, src: 0, dst: 3, code: 268450732
      41. PresetDlg: MsgId: 18, src: 0, dst: 3, code: 268450732
      Display All


      Any idea what causes this redrawing and how to remove it?

      Best regards,

      Rainer