Bug 7490

Strange behavior with Windows taskbar when SetRedraw on main MDI Window 17 November, 2021

Andreas Synthesis
11 November, 2021
Product: PowerBuilder Category: Controls & UI
Version: 2019 R2 Build: 2353
Classification: Publishing: Public
Priority: P3
Status: Reproducing Reason:
Communication Status: Waiting for Appeon
Mark Lee @Appeon 17 November, 2021
Hi Andreas,

Thanks for reporting the problem. We are working on it and we will get back to you after analyzing it.
We'll keep you posted here!

Mark Lee
Chris Pollach @Appeon 16 November, 2021
Hi Andreas;

   hank you for your updated test case. I will now transfer this ticket over to the main Support / Engineering Team for further study. As you mentioned before, this seems to also be related to W10. So having Engineering take a look would be prudent IMHO.

Regards ... Chris
Andreas Synthesis 16 November, 2021
* (correction)  the icon of the application disappearing/reappearing
Andreas Synthesis 16 November, 2021
redraw_using_timer.rar (76KB)

Hi Chris,

Once again thanks for the fast response.

I didn't release that the Sleep command would take the PB App off the O/S Dispatch chain, as I always thought it only pauses the execution of the next command for a given number of seconds. I rerun the first test case that I uploaded without the SetRedraw script, but kept the Sleep command and there was no issue.

Nevertheless, using your new Test Case (with modifications "CIPTEST") and adding the SetRedraw(False) /SetRedraw(True) to the function "of_opensheet", the problem is still present with the icon moving position and the application disappearing/reappearing.

I have attached the modified version of your Test Case with the SetRedraw as mentioned above.

Chris Pollach @Appeon 12 November, 2021
Hi Andreas;

  Thank you for the Test Case!  I was able to replicate your O/S TaskBar ICON behaviour. However, I then noticed that you had the SLEEP() command in your code which would have taken the PB App off the O/S "Dispatch" chain and the after the time expired, placed the App back on the O/S "dispatch" chain. Thus resulting in a repaint of the O/S taskbar.

  I modified your Test Case to alleviate this Dispatch Chain issue while still emulating the "Sheet" 5 second delay. This altered code leaves the PB App on the O/S dispatch chain and this the ICON stays in place on the O/S taskbar.

  Note: If your search the new Test Case for "CIPTEST", you will see how I altered your code.

Regards ... Chris
Chris Pollach @Appeon 12 November, 2021
Test Case (By Chris)

Corrected behaviour for dispatch chain
Andreas Synthesis 12 November, 2021
Redraw Sample.rar (35KB)

Hi Chris,

Thanks for the fast response.

I have attached to this post a RAR file containing a project generated from PB target "Template Application" of type MDI with connectivity options set to none. 

I modified the function "of_opensheet" from the user object "n_redraw_sample_sheetmanager" to have the PB script SetReDraw. (As shown Below with comments //Andreas)

Important Note: 
* Correction to my previous post, the repositioning also happens while running it from PB development (reason I did not notice this before is because I have my Windows taskbar icons to group).
* You will notice in the sample the function "sleep", this is to simulate the time the Sheet opens due to loading data and other PB scripts in the open event.
* I ran the same test using PB 12 on Windows 10 & 11 and the issue is not present.   
* This issue might be related with Bug 5721

Sample of the Code

//*    of_OpenSheet:  Open an instance of a sheet
int li_rc
w_redraw_sample_basesheet lw_sheet

w_redraw_sample_frame.SetRedraw(False) //Andreas

/*  Open an instance of the specified sheet  */
li_rc = OpenSheet ( lw_sheet, as_sheetname, w_redraw_sample_frame, 0, Cascaded! ) 

// Simulate loading of data, PB statements, etc
Sleep ( 5 )

//w_redraw_sample_frame.Post SetRedraw(True) // In some cases of PB script I found that our company uses Post SetReDraw!

//End Andreas

If li_rc = 1 Then
	/*  Add the sheet reference to the open sheet array  */
	iw_opensheets[UpperBound(iw_opensheets)+1] = lw_sheet 
End If

Return li_rc

Chris Pollach @Appeon 11 November, 2021
Hi Andreas;

  I cannot reproduce this issue on my W10 or W11 test PC's. Please provide a simple Test Case PB App that mirrors this behaviour for us to study further.

Many thanks in advance.
Regards ... Chris
Andreas Synthesis 11 November, 2021
When the main MDI Window is set to SetRedraw(False) and then afterwards SetRedraw(True), the application icon on the Windows 10 & 11 taskbar disappears and reappears, resulting also its position on the taskbar to move at the end of the list (As if it was closed and reopened). 

Note: The repositioning is only happening when running from a deployed application, while if you are running it from the PB development, the application icon disappears and reappears without repositioning.

This behavior is not present on Windows 7 & 8.
Windows 10
Database Type:
Database Version: