xpra icon
Bug tracker and wiki

Opened 4 months ago

Last modified 9 days ago

#1569 new defect

python3 opengl client

Reported by: Antoine Martin Owned by: J. Max Mena
Priority: major Milestone: 2.2
Component: client Version: trunk
Keywords: Cc:

Description (last modified by Antoine Martin)

Split from #640. For general python3 issues, see #1568.

See ticket:640#comment:41.

If this can be made to work, maybe it will be more stable than the GTK2 version?

See also: #921 native win32 opengl client

Attachments (2)

gtkglx.patch (6.8 KB) - added by Antoine Martin 2 months ago.
poc using GLX to wrap the X11 window
gtkglx-v2.patch (11.8 KB) - added by Antoine Martin 2 months ago.
working patch

Download all attachments as: .zip

Change History (13)

comment:1 Changed 4 months ago by Antoine Martin

Description: modified (diff)
Status: newassigned

Changed 2 months ago by Antoine Martin

Attachment: gtkglx.patch added

poc using GLX to wrap the X11 window

comment:2 Changed 2 months ago by Antoine Martin

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.

Changed 2 months ago by Antoine Martin

Attachment: gtkglx-v2.patch added

working patch

comment:3 Changed 2 months ago by Antoine Martin

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:

  • blocker: the client crashes with 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?
  • verify high bit depth support, see #1309
  • implement win32 and macos native contexts
Last edited 2 months ago by Antoine Martin (previous) (diff)

comment:4 Changed 2 months ago by Antoine Martin

Fixes and improvements:

  • r16949: missed changes to config, man page and cosmetic fixes (+r16953, r16954)
  • r16951: GLX improvements and cleanups (+r16958)
  • r16952: if all the backends fail, just log a warning and continue without opengl
  • r16955: win32 partial implementation (fixes in r16956, r16959, r16960)
  • r16957: tell GLX to stop using the context on exit

TODO for win32 port:

  • we cannot use the desktop window for running the sanity checks, so we may have to use a temporary (hidden?) window
  • present_fbo fails at the point where we reset the target framebuffer, weird
  • packaging: #1574

As for macos, it's not very clear how we use opengl on an existing window:

comment:5 Changed 8 weeks ago by Antoine Martin

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:

  • macos: comment:4 and #1575
  • sanity checks on win32 via temporary window
  • the window handle code should be generalized (see ugly code added in r16993)
Last edited 8 weeks ago by Antoine Martin (previous) (diff)

comment:6 Changed 7 weeks ago by Antoine Martin

The win32 port does work as of r16964, it justs needs some packaging fixes: #1574 / #1528.

comment:7 Changed 4 weeks ago by Antoine Martin

Owner: changed from Antoine Martin to J. Max Mena
Status: assignednew

Ready for testing on Linux.

The python3 builds should now work with opengl enabled by default.

comment:8 Changed 2 weeks ago by Antoine Martin

Let's try to fix transparency: #1570.

comment:9 Changed 10 days ago by Antoine Martin

There was a bug with GTK3 on 64-bit MS Windows builds but it looks like a recent GTK update has fixed that too.

comment:10 Changed 10 days ago by Antoine Martin

r17368 also hooks up the driver probing so session info and OpenGL_check.exe (fixed in r17370) will now show the correct details.

comment:11 Changed 9 days ago by Antoine Martin

We don't use opengl on win32 if the window uses transparency, see ticket:1570#comment:4 and #1682.

Note: See TracTickets for help on using tickets.