Recent

Author Topic: Controls inside the form disappear in execution.  (Read 6508 times)

GetMem

  • Hero Member
  • *****
  • Posts: 4077
Re: Controls inside the form disappear in execution.
« Reply #75 on: January 31, 2023, 06:43:14 am »
@dsiders

Thank you! What are the exact steps to make the controls disappear? I cannot reproduce the issue here, no matter how hard I try. Do you click on the taskbar and back to the application or something else?

dsiders

  • Hero Member
  • *****
  • Posts: 875
Re: Controls inside the form disappear in execution.
« Reply #76 on: January 31, 2023, 07:03:40 am »
@dsiders

Thank you! What are the exact steps to make the controls disappear? I cannot reproduce the issue here, no matter how hard I try. Do you click on the taskbar and back to the application or something else?

 I used the process you outlined:

Click on an unused area in the group box about 10 or 12 times.
Click on an unused area in the task bar.
Rinse and repeat until the error happens.

The clicks (on the group box) had to be pretty close together... and it took 8 or 9 cycles to get the error to occur.
Preview Lazarus 2.3.0 documentation at: https://dsiders.gitlab.io/lazdocsnext

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 819
Re: Controls inside the form disappear in execution.
« Reply #77 on: January 31, 2023, 07:11:59 am »
For me it's enough to:
1) Create new project
2) Add group box to form
3) Add button to group box
4) Run project
5) Click group box
6) Click task bar
7) Button disappears

Sometimes problem doesn't happen - button just flashes. But in most cases it happens.
29.12.2021 - migration to DynamicData 4.1 is completed - complete overhaul of data access driver.
My project still requires full Delphi 2009 support to be ported to Lazarus.
It's time to finally do it, because Delphi 2009 is 14 years old.

GetMem

  • Hero Member
  • *****
  • Posts: 4077
Re: Controls inside the form disappear in execution.
« Reply #78 on: January 31, 2023, 07:16:51 am »
@dsiders
This is my last attempt:
Code: Pascal  [Select][+][-]
  1.     WM_SETFOCUS, WM_KILLFOCUS:
  2.       begin
  3.         Result := WindowProc(Window, Msg, WParam, LParam);
  4.         Info := GetWin32WindowInfo(Window);
  5.         if Assigned(Info) and Info^.WinControl.IsEnabled then
  6.           InvalidateRect(Info^.WinControl.Handle, nil, True);
  7.         Exit;
  8.       end;

@Mr.Madguy
Did you applied the patch?

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 819
Re: Controls inside the form disappear in execution.
« Reply #79 on: January 31, 2023, 07:33:31 am »
Did you applied the patch?
No. Because I think, that something wrong happens here. Other problems should be checked before adding such crutch. First of all, both form and group box have WS_CLIPCHILDREN and WS_CLIPSIBLINGS. And while such problem was understandable back in WinXP era, we have had composite window manager since Vista. Such problems just shouldn't happen in a first place.
29.12.2021 - migration to DynamicData 4.1 is completed - complete overhaul of data access driver.
My project still requires full Delphi 2009 support to be ported to Lazarus.
It's time to finally do it, because Delphi 2009 is 14 years old.

dsiders

  • Hero Member
  • *****
  • Posts: 875
Re: Controls inside the form disappear in execution.
« Reply #80 on: January 31, 2023, 07:37:07 am »
@dsiders
This is my last attempt:
Code: Pascal  [Select][+][-]
  1.     WM_SETFOCUS, WM_KILLFOCUS:
  2.       begin
  3.         Result := WindowProc(Window, Msg, WParam, LParam);
  4.         Info := GetWin32WindowInfo(Window);
  5.         if Assigned(Info) and Info^.WinControl.IsEnabled then
  6.           InvalidateRect(Info^.WinControl.Handle, nil, True);
  7.         Exit;
  8.       end;

@Mr.Madguy
Did you applied the patch?

I tested with the code:

Code: Bash  [Select][+][-]
  1. diff --git a/lcl/interfaces/win32/win32wsstdctrls.pp b/lcl/interfaces/win32/win32wsstdctrls.pp
  2. index a1dce61f60..4f0df31e84 100644
  3. --- a/lcl/interfaces/win32/win32wsstdctrls.pp
  4. +++ b/lcl/interfaces/win32/win32wsstdctrls.pp
  5. @@ -583,6 +583,14 @@ begin
  6.            InvalidateRect(Window, nil, True);
  7.          Exit;
  8.        end;
  9. +    WM_SETFOCUS, WM_KILLFOCUS:
  10. +      begin
  11. +        Result := WindowProc(Window, Msg, WParam, LParam);
  12. +        Info := GetWin32WindowInfo(Window);
  13. +        if Assigned(Info) and Info^.WinControl.IsEnabled then
  14. +          InvalidateRect(Info^.WinControl.Handle, nil, True);
  15. +        Exit;
  16. +      end;
  17.      WM_PAINT:
  18.        begin
  19.          Result := WindowProc(Window, Msg, WParam, LParam);
  20.  

I've been clicking like a mad man and cannot make this variant reproduce the issue. Tab navigation works as expected. And I see no adverse affects of any kind.

Now, I never saw the issue to begin with when using the application like a normal human being. And this version seems to pass the ADD test.

Time for a cold one.
Preview Lazarus 2.3.0 documentation at: https://dsiders.gitlab.io/lazdocsnext

GetMem

  • Hero Member
  • *****
  • Posts: 4077
Re: Controls inside the form disappear in execution.
« Reply #81 on: January 31, 2023, 08:11:31 am »
@dsiders
Quote
I've been clicking like a mad man and cannot make this variant reproduce the issue. Tab navigation works as expected. And I see no adverse affects of any kind.

Now, I never saw the issue to begin with when using the application like a normal human being. And this version seems to pass the ADD test.

Time for a cold one.
Thanks again. I will wait a few more days just in case.


@Mr.Madguy
Quote
No. Because I think, that something wrong happens here. Other problems should be checked before adding such crutch. First of all, both form and group box have WS_CLIPCHILDREN and WS_CLIPSIBLINGS. And while such problem was understandable back in WinXP era, we have had composite window manager since Vista. Such problems just shouldn't happen in a first place.
Please do check for other problems, maybe you can come up with a better idea.

 

TinyPortal © 2005-2018