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

Python3 GTK3 client feature parity #640

Closed
totaam opened this issue Aug 19, 2014 · 57 comments
Closed

Python3 GTK3 client feature parity #640

totaam opened this issue Aug 19, 2014 · 57 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Aug 19, 2014

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

Lower priority:

  • the win32 cx_freeze installer could be trimmed down further (low priority) - ie: for opengl, see the osx changes in r7326 (those could also go into gtk2 builds)
  • fix transparency with cairo (or just use OpenGL)
  • fix webp
  • session info statistics are missing (string vs bytes nonsense), graphs need rewriting using cairo (oh joy)
  • XSETTINGS and root property support
  • packaging: use separate RPMs?
  • add --max-size option (see add a --max-size option to limit the maximum window size #263 for GTK2)
  • maybe GTK3 will allow us to deal with grabs and application-modal windows?
@totaam
Copy link
Collaborator Author

totaam commented Sep 11, 2014

2014-09-11 13:27:27: totaam commented


  • lots of cairo changes and we now have better Cython + (py)cairo paint code which avoids the awful roundtrip via png: r7557 (and fixes in later changesets as well as build fixes for win32)
  • cursor support in 7573
  • opengl (only checks) ported in r7587

@totaam
Copy link
Collaborator Author

totaam commented Sep 11, 2014

2014-09-11 16:28:53: totaam changed status from new to assigned

@totaam
Copy link
Collaborator Author

totaam commented Sep 12, 2014

2014-09-12 12:20:50: totaam uploaded file gtk3-gl-v4.patch (67.9 KiB)

work in progress patch for gtk3 + opengl support

@totaam
Copy link
Collaborator Author

totaam commented Sep 12, 2014

2014-09-12 17:28:05: totaam uploaded file gtk3-gl-v8.patch (73.7 KiB)

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

@totaam
Copy link
Collaborator Author

totaam commented Sep 14, 2014

2014-09-14 04:45:00: totaam uploaded file gtk3-gl-v13.patch (79.2 KiB)

cleaner version that works with single buffering only

@totaam
Copy link
Collaborator Author

totaam commented Sep 14, 2014

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

  • not tested on win32 since I don't have the hardware to test
  • python3 seems to have problems with pyopengl and memoryviews.. (so don't use video encodings for now - looks solvable)
  • the gtk3 code does not actually close the gl context and may leak resources (which is better than closing and crashing hard I guess)
  • the gtk3 uses contortions to try to call swap_buffers, creating a new window just to be able to call it.. (that's because the gi bindings don't give us the methods we need to get to the window... maybe we should assign the gl window to a custom widget when it gets realized instead?)
    etc..

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..)

@totaam
Copy link
Collaborator Author

totaam commented Sep 15, 2014

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

@totaam
Copy link
Collaborator Author

totaam commented Sep 15, 2014

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

@totaam
Copy link
Collaborator Author

totaam commented Sep 15, 2014

2014-09-15 17:02:55: totaam commented


More updates:

  • r7621 fixes the missing data on session info
  • r7622 ensures we honour the metadata
  • r7629 + r7630 remove some unnecessary bits, and the GTK3 installer is now pretty much the same size as the GTK2 one
  • r7607 added the GTK3 bits to the Fedora rpms
  • r7632 seems to fix CTRL_C

Summary of what's left:

Delayed:

@totaam
Copy link
Collaborator Author

totaam commented Sep 17, 2014

2014-09-17 05:19:40: totaam uploaded file gtk3-win32-cursors.patch (4.7 KiB)

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

@totaam
Copy link
Collaborator Author

totaam commented Sep 17, 2014

2014-09-17 16:38:21: totaam commented


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

  • xpra-common with icons, /usr/bin scripts, etc
  • xpra (as before, the gtk2 client and server)
  • python3-xpra

New TODO items:

  • the shebang in the /usr/bin files should be neutral? (/usr/bin/env python?)
  • dependencies need checking and updating for python3-xpra:
  • requires_opengl
  • requires_sound
  • requires_lzo
  • python3-netifaces - requires spec file update
  • python-lz4 - requires spec file update
  • dbus-python is now python3-dbus (does it work?)
  • opengl apparently fails on win32: see python3 and gtk3 support #90#comment:32 : some required OpenGL functions are not available: glActiveTexture, glMultiTexCoord2i - no idea why.
  • numpy 1.9.0 does not build..

@totaam
Copy link
Collaborator Author

totaam commented Sep 25, 2014

2014-09-25 02:56:58: totaam commented


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')

@totaam
Copy link
Collaborator Author

totaam commented Sep 28, 2014

2014-09-28 14:16:00: totaam commented


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!

@totaam
Copy link
Collaborator Author

totaam commented Sep 28, 2014

2014-09-28 15:42:45: totaam commented


Correction: the bug was spotted 3 days ago, see #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.

@totaam
Copy link
Collaborator Author

totaam commented Oct 11, 2014

2014-10-11 05:10:56: totaam commented


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).

@totaam
Copy link
Collaborator Author

totaam commented Oct 11, 2014

2014-10-11 06:56:14: totaam commented


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:

  • no theming (known upstream bug)
  • warnings about settings that are deprecated (icons, etc)

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.

@totaam
Copy link
Collaborator Author

totaam commented Feb 12, 2015

2015-02-12 11:42:55: totaam commented


Not worth breaking the GTK2 build! see r8651

@totaam
Copy link
Collaborator Author

totaam commented Mar 2, 2015

2015-03-02 07:59:48: antoine commented


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

@totaam
Copy link
Collaborator Author

totaam commented Mar 30, 2015

2015-03-30 09:52:03: antoine commented


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

@totaam
Copy link
Collaborator Author

totaam commented Mar 30, 2015

2015-03-30 10:35:20: antoine commented


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

@totaam
Copy link
Collaborator Author

totaam commented Apr 17, 2015

2015-04-17 09:15:59: antoine commented


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

@totaam
Copy link
Collaborator Author

totaam commented Apr 17, 2015

2015-04-17 12:57:18: antoine commented


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

@totaam
Copy link
Collaborator Author

totaam commented Apr 19, 2015

2015-04-19 12:39:45: antoine commented


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

@totaam
Copy link
Collaborator Author

totaam commented Apr 20, 2015

2015-04-20 03:47:41: antoine commented


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.

@totaam
Copy link
Collaborator Author

totaam commented Apr 20, 2015

2015-04-20 10:46:33: antoine commented


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:

  • copy libwebp.lib to C:\Python34\libs to allow the webp codecs to link properly
  • copy mingw's libiconv-2.dll to C:\Python34\Lib\site-packages\gnome\ - somehow needed by the avcodec2 module (see r9074)? (why is the msvc build doing this?)

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

  • with mingw, it builds, it loads and runs but causes crashes on exit (bad pointer, somewhere deep in pygilstate_reinit)
  • with msvc, it builds but does not load...
    We do need this module to make things fast enough to be usable.

@totaam
Copy link
Collaborator Author

totaam commented Apr 20, 2015

2015-04-20 14:13:34: antoine commented


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:

  • the launcher doesn't start, doesn't complain either
  • sound doesn't seem to work, and causes crashes
  • exiting the client pops up an "unclean exit" dialog..
    etc..
    Is GTK3 really worth the pain?

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

  • Xpra-GTK3-py34-MSVC_Setup_0.15.0-[r9076](../commit/76b4e965bebd16d1398f1c69510d010a88817182).exe
  • Xpra-GTK3-py34-MinGW_Setup_0.15.0-[r9076](../commit/76b4e965bebd16d1398f1c69510d010a88817182).exe
    We'll have to see which one is best.

@totaam
Copy link
Collaborator Author

totaam commented Apr 23, 2015

2015-04-23 12:02:14: antoine commented


Stumbled upon these relevant comments (mostly on just how painful it is to move to python3): Python 3 adoption, in particular: qahirah: Qahirah is yet another Python language binding for the Cairo graphics library, for use with Python 3.2 or later. It is modelled to some extent on 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.

@totaam
Copy link
Collaborator Author

totaam commented Apr 24, 2015

2015-04-24 05:27:15: antoine commented


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: #373#comment:6

@totaam
Copy link
Collaborator Author

totaam commented May 3, 2015

2015-05-03 10:13:25: antoine uploaded file bencode-work9.patch (15.0 KiB)

work in progress patch - fixes bencode for py3k

@totaam
Copy link
Collaborator Author

totaam commented May 11, 2015

2015-05-11 11:32:40: antoine commented


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

@totaam
Copy link
Collaborator Author

totaam commented Oct 27, 2017

2017-10-27 04:58:13: antoine commented


hashlib.algorithms_available, but that's only available in Python 2.7.9
Thanks, see #1674. (this not related to python3 or GTK3)

@totaam
Copy link
Collaborator Author

totaam commented Jan 11, 2018

2018-01-11 05:35:21: antoine commented


Follow up ticket: #1717

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant