Problem with disabled windows on Terminal Server
Posted: Wed Feb 15, 2023 9:06 am
Hi, Roger.
This is some kind of uh-uh-problem. I already discussed it with Alaska Support.
I have an non-modal application window showing a modal dialog. By (not so good) design, this modal dialog uses some tables with same aliases and stuff like the parent dialog does, so all tables are closed and pointers are saved before the modal child dialog is build. After this dialog ends, it restores all workareas, pointers and so on. But in the parent dialog, there are lots of WHEN and, especially, EDITPROTECTED clauses referencing those tables - which are closed while the child dialog is shown, so evaluating EDITPROTECTED would cause trouble. This is no problem, since the parent dialog is disabled because the child is MODAL. But. If this is used in a Terminal Server situation and the session is closed and re-opened again,for the time of a twinkle of the eye, the parent dialog gets the display focus - and SetDisplayFocus() and/or SetInputFocus() is evaluated. This only happens on Terminal Servers and only if the session was disconnected and re-connected again. The child refreshes somehow, and the parent refreshes aswell - although it is disabled. EDITPROTECTED fails, since there are not tables. This is caused by the call of _EditProtected in line 4725 of _DCGETBX.PRG (build 267).
Till Warweg confirmed that this is not intended, but they don't have a solution. He suggested to reflect that situation somehow, but I don't have an idea. The dialogs are huge and full of legacy code, and the number of clients using Terminal Server grows day by day. Any ideas? Moving the child to a thread is not a solution.
This is some kind of uh-uh-problem. I already discussed it with Alaska Support.
I have an non-modal application window showing a modal dialog. By (not so good) design, this modal dialog uses some tables with same aliases and stuff like the parent dialog does, so all tables are closed and pointers are saved before the modal child dialog is build. After this dialog ends, it restores all workareas, pointers and so on. But in the parent dialog, there are lots of WHEN and, especially, EDITPROTECTED clauses referencing those tables - which are closed while the child dialog is shown, so evaluating EDITPROTECTED would cause trouble. This is no problem, since the parent dialog is disabled because the child is MODAL. But. If this is used in a Terminal Server situation and the session is closed and re-opened again,for the time of a twinkle of the eye, the parent dialog gets the display focus - and SetDisplayFocus() and/or SetInputFocus() is evaluated. This only happens on Terminal Servers and only if the session was disconnected and re-connected again. The child refreshes somehow, and the parent refreshes aswell - although it is disabled. EDITPROTECTED fails, since there are not tables. This is caused by the call of _EditProtected in line 4725 of _DCGETBX.PRG (build 267).
Till Warweg confirmed that this is not intended, but they don't have a solution. He suggested to reflect that situation somehow, but I don't have an idea. The dialogs are huge and full of legacy code, and the number of clients using Terminal Server grows day by day. Any ideas? Moving the child to a thread is not a solution.