Tuesday, May 22nd 2018, 3:38pm UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Hfurrhuhurr

Beginner

Date of registration: May 16th 2018

Posts: 1

1

Wednesday, May 16th 2018, 2:03pm

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/C++ Source code

1
2
3
	WM_HideWindow(hDlgInputSelect);
	WM_ShowWindow(hDlgPreset);
	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/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// 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