Xpra: Ticket #640: Python3 GTK3 client feature parity

Split from #90, remaining items so that this port can be used in place of the current GTK2 version:

Lower priority:

Thu, 11 Sep 2014 12:27:26 GMT - Antoine Martin:

Thu, 11 Sep 2014 15:28:53 GMT - Antoine Martin: owner, status, description changed

Fri, 12 Sep 2014 11:20:49 GMT - Antoine Martin: attachment set

work in progress patch for gtk3 + opengl support

Fri, 12 Sep 2014 16:28:05 GMT - Antoine Martin: attachment set

dirty patch which sort of works if you ignore the stream of stacktraces!

Sat, 13 Sep 2014 05:11:21 GMT - Antoine Martin: attachment set

working patch which breaks gtk2... so close!

Sat, 13 Sep 2014 05:41:44 GMT - Antoine Martin: attachment set

working patch! just needs swap_buffers and packaging workaound for win32

Sun, 14 Sep 2014 03:45:00 GMT - Antoine Martin: attachment set

cleaner version that works with single buffering only

Sun, 14 Sep 2014 06:01:04 GMT - Antoine Martin:

opengl support merged in r7599, but some big issues remain:


The code is still an improvement I think, and may help with #608.

If gtkgl proves too problematic with GTK3, maybe we can use a different approach, like this one: gtkgl via X11 + ctypes (at least for X11..)

Mon, 15 Sep 2014 14:12:28 GMT - Antoine Martin:

Warning: r7573 introduced a crash on cursor stuff.. Until it is fixed, run with --no-cursors

Mon, 15 Sep 2014 15:34:47 GMT - Antoine Martin:

Much time wasted and still no clue: cursors are disabled on win32 until futher notice (done in r7625)

Mon, 15 Sep 2014 16:02:54 GMT - Antoine Martin:

More updates:

Summary of what's left:


Wed, 17 Sep 2014 04:19:40 GMT - Antoine Martin: attachment set

some work in progress to try to support cursors on win32 using cairo (requires gtk 3.10)

Wed, 17 Sep 2014 15:38:20 GMT - Antoine Martin:

RPM packaging for python3 in progress in r7673: we now generate 3 packages:

New TODO items:

Thu, 25 Sep 2014 01:56:57 GMT - Antoine Martin:

It seems that there are issues with opengl + python3: Oh, addendum to PyOpenGL 3.1.0b3; Py_buffer on Python3 unsupported (more info on memoryview: numpy.getbuffer causes AttributeError: 'module' object has no attribute 'getbuffer')

Sun, 28 Sep 2014 13:16:00 GMT - Antoine Martin:

r7599 broke opengl rendering on win32: it seems to revert to the GDI Generic renderer, and fails to locate some required opengl functions (GlActiveTexture and GlMultiTexCoord2i).

More worrying is that no-one noticed for 200+ revisions!

Sun, 28 Sep 2014 14:42:45 GMT - Antoine Martin:

Correction: the bug was spotted 3 days ago, see ticket:684#comment:3 where I suggested a way to get to the fix (playing with the manual double buffering toggle). As had been noted before (r2970, r2394), we MUST enable double buffering on win32: r7820 does this.

Sat, 11 Oct 2014 04:10:55 GMT - Antoine Martin:

A new pygobjectwin32 release is out based on GTK 3.14. Hopefully this one will work a bit better without requiring too many changes (packaging or other).

Sat, 11 Oct 2014 05:56:14 GMT - Antoine Martin:

Not too bad, r7931 allows us to build against this new release - sadly also breaks building against the older version...

Seems to work OK too. Downsides:

And still no development headers installed despite explicitly telling the installer we do want them, and even where we want them..

We still have to fix the cairo set_image_surface_data with no data bug too.

As per #734, maybe we can re-instate the cursor code?

See also #794 / #775.

Thu, 12 Feb 2015 11:42:54 GMT - Antoine Martin:

Not worth breaking the GTK2 build! see r8651

Mon, 02 Mar 2015 07:59:48 GMT - Antoine Martin:

contrary to what is said in comment:6, r7632 did not fix the control-c handler, but r8736 does! (see #819)

Mon, 30 Mar 2015 08:52:03 GMT - Antoine Martin:

Some new sound problems, see ticket:669#comment:19

Mon, 30 Mar 2015 09:35:19 GMT - Antoine Martin:

I am now also seeing some paint problems, both with the opengl and cairo backends... sigh.

Fri, 17 Apr 2015 08:15:59 GMT - Antoine Martin:

I am seeing opengl rendering issues, so r9041 disables opengl by default on python3 (but it can still be enabled from the tray).

Fri, 17 Apr 2015 11:57:17 GMT - Antoine Martin:

The paint problems from comment:16 were probably resolved by the fixes in ticket:465#comment:19

Sun, 19 Apr 2015 11:39:45 GMT - Antoine Martin:

Also worth a try: updating to pygi-aio-3.14.0_rev16.

Mon, 20 Apr 2015 02:47:41 GMT - Antoine Martin:

Minor build fixes in r9064. Tweaking the distutils.cfg before building to match the compiler for each one of the BAT files is not longer required.

Mon, 20 Apr 2015 09:46:32 GMT - Antoine Martin:

With the numerous tedious changes in r9069, r9070 + r9071, r9072, we can finally build with mingw or with msvc out of the box after installing the latest pygi bindings (see comment:19). It is almost certain that older versions of the bindings will not build correctly - despite using the same release as base... (3.14.0)

r9073 fixes some broken mouse events with these latest builds (only on win32 + py3k)

For msvc builds you will need:

There is still a weird problem with the cairo workaround cython module:

We do need this module to make things fast enough to be usable.

Mon, 20 Apr 2015 13:13:34 GMT - Antoine Martin:

It seems that the cairo workaround module actually does work, both with the msvc and mingw builds, just not on the build machine! (which makes it really tedious to test). On the other hand, setting window icon works on the build machine and not on other test machines... also very tedious. r9077 disables setting window icons with GTK3 on win32. I'll need to figure it out later. (I'm sure I had seen this before, but can't find out what we're supposed to do - fixed size? buffer problem?) Other new known problems:

etc.. Is GTK3 really worth the pain?

PS: as of r9076, we include the type of build in the setup filename, ie:

We'll have to see which one is best.

Thu, 23 Apr 2015 11:02:13 GMT - Antoine Martin:

Stumbled upon these relevant comments (mostly on just how painful it is to move to python3): Pycairo.

Seeing how slow and poor the pycairo py3k bindings are (see r6394 for example), this could well be the solution we need. It has create_for_data wrapped, including the stride argument we need.

Fri, 24 Apr 2015 04:27:14 GMT - Antoine Martin:

Important note (I had to rebuild everything as the update from Python 3.4.2 to 3.4.3 just failed mysteriously every time), for gmp follow these instructions: ticket:373#comment:6

Sun, 03 May 2015 09:13:25 GMT - Antoine Martin: attachment set

work in progress patch - fixes bencode for py3k

Mon, 11 May 2015 10:32:40 GMT - Antoine Martin:

For the control-c handling, see ticket:626#comment:8

Wed, 13 May 2015 02:08:33 GMT - Antoine Martin:

Useful links for py3k porting (see also ticket:90#comment:2):

Sat, 23 May 2015 09:33:21 GMT - Antoine Martin:

GTK3 won't play nice with KDE by the looks of things: https://bugzilla.gnome.org/show_bug.cgi?id=735211: I'm actually happy that it's stopped working.

Already broke our fix for XPRA/winswitch windows suffer from the default drag on all empty parts window dragging behaviour. (API got moved to gobject then removed completely).

Constant API churn when it's not missing altogether. Ouch.

Tue, 09 Jun 2015 08:19:24 GMT - Antoine Martin:

From what I am reading, the "proper" way of building GTK3 stuff is to use MSYS2 See also:

Sun, 14 Jun 2015 11:48:55 GMT - Antoine Martin:

New items (mostly related to #885):

And maybe GTK3 handles max-size natively on win32? (so we could remove the window hooks we use as workaround - see #263)

Tue, 16 Jun 2015 16:12:27 GMT - Antoine Martin:

This whole thread has useful pointers: Outdated win32 bundle

Sat, 27 Jun 2015 18:18:27 GMT - Antoine Martin:

Workaround for the gobject3 SIGINT problems added in r9747, for details see unable to trap SIGINT. Once this bug is fixed, we should probably add a version check and disable the workarounds if the gobject version has the fix... meh.

Fri, 23 Oct 2015 06:49:06 GMT - Antoine Martin: milestone changed

This is such a pain, going native might well be a quicker option. Re-scheduling.

Mon, 23 Nov 2015 17:11:37 GMT - Antoine Martin:

There are newer GTK3 builds available: pygobjectwin32

Mon, 04 Jan 2016 04:24:27 GMT - Antoine Martin:

Some work done on this for #1041, and some updates: where has gtkglext gone?

See this very good thread: http://markmail.org/message/umj6fzfimaptcxit: We have been asking for 15 years to include something like these 250 lines of code, that is ALL that is needed to bridge GtK and OpenGL. So they've merged some similar code to https://bugzilla.gnome.org/show_bug.cgi?id=707723. (NIH syndrome?)

It gets worse https://www.bassi.io/articles/2015/02/17/using-opengl-with-gtk/: the OpenGL support inside GTK+ requires core GL profiles, and thus it won’t work with the fixed pipeline API that was common until OpenGL 3.2 and later versions. And the GDK drawing model was simpler, in those days, so these libraries just took a native windowing system surface, bound it to a GL context, and expected everything to work - well yes, I use an API and I expect it to work, crazy isn't it.

Let's see how hard it is to do for X11: GTK3 Displaying OpenGL inside a drawing area, trivial. Ouch.

Time to ditch GTK3? It's a train wreck. Things that used to work fine in GTK2, don't work at all: performance, opengl, win32 port, osx port?, API stability, etc..

Tue, 05 Jan 2016 09:41:48 GMT - Antoine Martin:

Some notes on GTK3 (if we ever try to take this further): as done for #1041, we can probably remove more gir files and their dlls (see r11587)

Sun, 27 Mar 2016 17:51:55 GMT - Antoine Martin:

Found some build scripts for the full GTK3 stack: https://github.com/wingtk/gtk-win32 (based on the hexchat ones)

Sun, 10 Apr 2016 08:24:06 GMT - Antoine Martin:

GL still does not work in GTK3 on osx: https://bugzilla.gnome.org/show_bug.cgi?id=740199

Tue, 12 Jul 2016 16:51:50 GMT - Antoine Martin: milestone changed

Milestone renamed

Sun, 21 Aug 2016 09:55:49 GMT - Antoine Martin: milestone changed

Milestone renamed

Wed, 07 Sep 2016 10:05:50 GMT - Antoine Martin:

Blocked by #917 / #678 / #300, see also #1072

Mon, 23 Jan 2017 09:21:44 GMT - Antoine Martin:

Some python3 fixes in r14839.

It seems that the GTK3 gtkglext bindings have already been removed in Fedora 25. To support opengl with GTK3 we would have to change the opengl code... and lose compatibility with the well supported and undoubtedly much more stable GTK2 backend. YUK.


Code examples:

Wed, 15 Feb 2017 09:45:34 GMT - Antoine Martin: milestone changed

Whatever the solution is, it is going to take a lot of work.


Sat, 08 Jul 2017 13:30:04 GMT - Antoine Martin:

Minor improvements and fixes for 2.1:

Sun, 09 Jul 2017 14:12:32 GMT - Antoine Martin:

As of r16251, the python3 client (and also python2 with cairo backend via XPRA_USE_CAIRO_BACKING=1) works as well as the pixmap backend. The X11 bugs have been fixed, etc - see comment:43 for details.

Still TODO:

Mon, 10 Jul 2017 05:23:33 GMT - Antoine Martin: status, summary changed; resolution set

Minor fixes and improvements:

Changed ticket scope: just the client is tracked here, so we can close this. (there are too many fixes, so the backport is likely to just disable GTK3 in older branches)

Follow up python3 tickets:

Mon, 10 Jul 2017 14:25:05 GMT - Antoine Martin: milestone changed

(fix milestone)

Thu, 26 Oct 2017 17:03:26 GMT - Norman Rasmussen:

btw, r14839 added hashlib.algorithms_available, but that's only available in Python 2.7.9 (and I'm still on Trusty with 2.7.6), so for now I've just edited it to read 'hashlib.algorithms' :-)

Fri, 27 Oct 2017 03:58:12 GMT - Antoine Martin:

hashlib.algorithms_available, but that's only available in Python 2.7.9

Thanks, see #1674. (this not related to python3 or GTK3)

Thu, 11 Jan 2018 05:35:21 GMT - Antoine Martin:

Follow up ticket: #1717

Sat, 23 Jan 2021 05:01:40 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/640