Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display errors in Windows Forms applications with wine #3621

Closed
Emslaender73 opened this issue Sep 16, 2022 · 13 comments
Closed

Display errors in Windows Forms applications with wine #3621

Emslaender73 opened this issue Sep 16, 2022 · 13 comments
Labels
bug Something isn't working

Comments

@Emslaender73
Copy link

I use xpra to display a Windows Forms application via wine in the (chrome or firefox) browser. It actually works very well, but if the form height is changed directly after creating a modal dialogue, there are display problems. A part of the form is not displayed or sometimes even unintentionally transparent. If the form is then moved, often nothing is visible at all.

If I start the application directly in wine, everything is displayed as desired.

In the attached test application you should be able to reproduce the problem together with wine.

To Reproduce

  1. Install wine
  2. run wine with attached application
  3. open it with xpra
  4. click on "MDI-Child öffnen"
  5. click on Button "Modales Formular öffnen"

System Information

  • Server OS: Ubuntu 20.04
  • Client OS: Ubuntu 20.04
  • Xpra Server Version 4.3.4
  • Xpra Client Version 4.3.4
  • Wine Version HQ 7.0 stable

GUITestD11_2.zip

@Emslaender73 Emslaender73 added the bug Something isn't working label Sep 16, 2022
@totaam
Copy link
Collaborator

totaam commented Sep 16, 2022

Please provide the source of the application, not an executable as I do not run random executables.

@Emslaender73
Copy link
Author

See source-zip in the appendix. Can be built with a Delphi 11.2 test version.

GUITestD11_source.zip

@totaam
Copy link
Collaborator

totaam commented Sep 16, 2022

Well, that just shifts the burden to another download: Delphi, which is not open source either.

@Emslaender73
Copy link
Author

I have reproduced the problem with Lazarus (GNU GPL -> https://www.lazarus-ide.org), the source code is attached. If this is compiled under Linux, Wine can be dispensed with.
TestTFormAppSaaS_Lazarus.zip

@totaam
Copy link
Collaborator

totaam commented Sep 20, 2022

Edit: got it.
Found this in the server log:

Traceback (most recent call last):
  File "/usr/local/lib64/python3.10/site-packages/xpra/x11/server.py", line 525, in _new_window_signaled
    self._add_new_window(window)
  File "/usr/local/lib64/python3.10/site-packages/xpra/x11/server.py", line 579, in _add_new_window
    self.client_configure_window(window, geometry)
  File "/usr/local/lib64/python3.10/site-packages/xpra/x11/server.py", line 920, in client_configure_window
    win.show()
  File "/usr/local/lib64/python3.10/site-packages/xpra/x11/models/window.py", line 450, in show
    self.map()
  File "/usr/local/lib64/python3.10/site-packages/xpra/x11/models/window.py", line 398, in map
    with xsync:
  File "/usr/local/lib64/python3.10/site-packages/xpra/gtk_common/error.py", line 197, in __exit__
    trap.Xexit()
  File "/usr/local/lib64/python3.10/site-packages/xpra/gtk_common/error.py", line 119, in Xexit
    raise XError(error)
xpra.gtk_common.error.XError: XError: BadWindow (invalid Window parameter)

(Xpra:188066): Gdk-WARNING **: 20:16:35.377: GdkWindow 0x4000a6 unexpectedly destroyed

@totaam
Copy link
Collaborator

totaam commented Sep 20, 2022

To fix the first problem (git master only):

xpra start --env=XPRA_PRE_MAP_WINDOWS=0 --start=xterm

This is caused by #3473

@totaam
Copy link
Collaborator

totaam commented Sep 20, 2022

Interesting. The bug does not occur with git master.
With the 4.3.x branch, I get a black window as soon as I run your example.
@Emslaender73 Is this what you were seeing too?

Please try the beta channel and let me know if that fixes things for you.
I have very limited time and may or may not bisect to find the commit that fixed this particular issue.
I will try to fix the XPRA_PRE_MAP_WINDOWS=0 issue still.

Edit: also be aware that the html5 client does not handle modal windows, the python client can using --modal-windows=yes. The default is no because GTK does not support group-modal, only full-modal.

@Emslaender73
Copy link
Author

Emslaender73 commented Sep 21, 2022

I tried it with 4.4-r31917 and the controls are visible again. But the form resize (setting the height in the code -> self.height) does not work correctly. You can see in the video in the second call that first the change of the form height is made, but then it is set back to the original size.

What I still don't quite understand: We use the HTML 5 client, but modal windows seem to work.

Zipped Video:
xpra_issue3621.zip

@totaam
Copy link
Collaborator

totaam commented Sep 21, 2022

You can see in the video in the second call that first the change of the form height is made, but then it is set back to the original size

I think that this is a race condition between the client and server both updating the window size simultaneously - there can be no correct answer to that, so I wouldn't worry about it.
Edit: if this only happens with the html5 client then this is a bug in this client.

We use the HTML 5 client, but modal windows seem to work.

It kinda works most of the time, we're using high z-index values.
Xpra-org/xpra-html5#11

@Emslaender73
Copy link
Author

I once locked the update of the controls, then changed the form height and waited 150 milliseconds before triggering the update. In this case it works as desired, but "I'll wait a few milliseconds" would not really be satisfactory :-)
Is there perhaps another solution?
xpa_ussue3621_2.zip

@totaam
Copy link
Collaborator

totaam commented Sep 21, 2022

Is there perhaps another solution?

Not really, there is no way to ensure precise time sync between client and server, so there is no way of knowing which one should take precedence.

@Emslaender73
Copy link
Author

Ok, thanks, that helps me a bit. Is there a schedule for the rollout of the 4.4 version ?

@totaam
Copy link
Collaborator

totaam commented Sep 21, 2022

Is there a schedule for the rollout of the 4.4 version ?

Real-soon-now(tm).

@totaam totaam closed this as completed Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants