Split from #640. For general python3 issues, see #1568.
If this can be made to work, maybe it will be more stable than the GTK2 version?
See also: #921 native win32 opengl client
poc using GLX to wrap the X11 window
Just because GTK3 decided to break every existing GTK opengl application out there does not mean that it should be that way.
Preparatory work removing unneeded dependencies on GTK from the pure opengl code: r16915, r16916, r16917, r16919, r16920, r16921, r16925, r16926, r16927.
The patch above almost works - it paints the screen OK but then the next update comes and messes it up.. It works fine with mmap. It probably needs xsync to prevent crashes too. It should be moved to platform code, and the client init code will need to be re-worked. The code could be made generic enough to be used with both GTK2 and GTK3: the context code only needs a window XID. Support for win32 and macos should also be possible. We may then also be able to query the real pixel depth supported on those platforms.
working patch
Support added for opengl with GTK3 in r16948 + r16949, only supported with X11 GLX for now. It is now enabled by default with Python3 / GTK3. The same backend can now also be used with GTK2 with X11:
xpra attach --opengl=native
Added bonus: we no longer depend on an unmaintained project.
Still TODO:
tray=yes
.. the way GTK has been sabotaging the system tray, I'm not sure we're to blame here - it doesn't work well at the best of times. It seems that simply enabling debugging (timing related?) can fix the crash, maybe we just need to xsync after running the gl_check?
Fixes and improvements:
TODO for win32 port:
present_fbo
fails at the point where we reset the target framebuffer, weird
As for macos, it's not very clear how we use opengl on an existing window:
As of r16993 (ugly workaround found here: How I can get DrawingArea window handle in Gtk3?), opengl works with the python3 builds on win32 (#1574). The present_fbo bug was fixed in r16964.
Still TODO:
The win32 port does work as of r16964, it justs needs some packaging fixes: #1574 / #1528.
Ready for testing on Linux.
The python3 builds should now work with opengl enabled by default.
Let's try to fix transparency: #1570.
There was a bug with GTK3 on 64-bit MS Windows builds but it looks like a recent GTK update has fixed that too.
r17368 also hooks up the driver probing so session info and OpenGL_check.exe
(fixed in r17370) will now show the correct details.
We don't use opengl on win32 if the window uses transparency, see ticket:1570#comment:4 and #1682.
I'll have to set up my mini test box here to use a display (good old Timmeh, he's configured to use packages not build from source) so I can give this a try.
NOTE:
Default install of python3-xpra
sets the shebang to /usr/bin/python2
.
Other than that, it seems to work fine for me - Fedora 26 and the 20171201r17551.fc26
python3-xpra-client
running against a trunk r17551 Fedora 26 server. With OpenGL enabled (Nvidia ION "GPU").
Default install of python3-xpra sets the shebang to /usr/bin/python2.
The default shebang belongs in the xpra-common
package, because we want to be able to install both python versions simultaneously.
Until the python3 version is made the default, this is how it is going to be. For running the python3 version, you are expected to run:
python3 /bin/xpra ...
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1569