5

I've just upgraded to Delphi 11 Alexandria from Delphi 10.4.2. I use RDP a lot so I noticed flicker when a TPaintBox is invalidated. The weird thing is that it doesn't flicker if the form with the TPaintBox is the first one created. Also it doesn't flicker if run on local machine. Only in RDP. If I compile same project in Delphi 10.4.2 it doesn't flicker in RDP.

Can anyone figure this one out? Is it "simply" a bug in Delphi 11?

Edit: Demoproject http://procurisupdate.se/downloads/Temp/PaintBoxFlicker.zip

Simple project with two forms. One has an TImage so it is quite large. If run as is, when you click the picture and move the mouse it flickers. If you change so that Form23 is created first (or even if it is created before Application.run) it doesn't flicker. Note it onlyt flickers in RDP.

Edit2: After some looking I find the following in TApplication.Run:

procedure TApplication.Run;
begin
  FRunning := True;
  try
{$IF NOT DEFINED(CLR)}
    AddExitProc(DoneApplication);
{$ENDIF}
    RemoteSessionCheck; // This has been added since Delphi 10.4.2
    if FMainForm <> nil then
    ...

If I comment out RemoteSessionCheck; and recompile (you have to add Your Source\vcl dir to Library path) it works with no flicker.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Rogfitz
  • 61
  • 2
  • 1
    Would be nice if you show a [minimal, complete, verifiable and reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) that we can play with. – fpiette Sep 21 '21 at 08:01
  • Please edit the question and include minimal code inside the question itself, not as external link. – Dalija Prasnikar Sep 21 '21 at 09:54
  • 1
    Sounds like a bug you should [report to Embarcadero](https://quality.embarcadero.com) since it is related to new functionality added in 11.0 – Remy Lebeau Sep 21 '21 at 16:07

2 Answers2

4

Per a private communication with Embarcadero:

fyi: This issue seems related to:

TRemoteSessionChangedEvent = procedure (Sender: TObject; var InRemoteSession) of object;

which should have been:

TRemoteSessionChangedEvent = procedure (Sender: TObject; var InRemoteSession: Boolean) of object;

Our Support team tracked down the issue; explained why it does not affect auto-created forms, and how this will mess up C++ (where the untyped parameter will be exposed as Variant).

A bug ticket was filed, but it is private to their internal system only.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
4

You can check the TApplication.SingleBufferingInRemoteSessions property and set it to False.

Tyler2P
  • 2,324
  • 26
  • 22
  • 31
deda911
  • 51
  • 2