Closed totaam closed 9 years ago
Some useful links:
- GObject Introspection
- Introspection Porting
- Migrating from GTK+ 2.x to GTK+ 3 (and in particular changes that need to be done at the time of the switch)
- GTK+ 3 Reference Manual
- The Python GTK+ 3 Tutorial
- Converting PIL Image to GTK Pixbuf
- pygi-convert.sh
- Ubuntu app indicators when using PyGObject (grrr)
- Convert PIL Image to Cairo ImageSurface
- PIL and Cairographics / PyCairo
- cairo.ImageSurface.create_for_data
xpra-gtk3.patch
(33.0 KiB)rough patch for gtk3/python3 support
The patch above "works" in the sense that one can get something on screen with gtk3, but it has a number of important shortcomings:
- problems with the new
StringIO
class, which fails because of a missingfileno()
jpeg
andrgb24
have to be parsed usingPIL
then exported toPNG
to then be loaded by cairo as cairo is incapable of loading anything else (seriously!? gtk devs, this is not an upgrade by a giant leap backwards). Forrgb24
it seems to require an unnecessarily large rowstride (RGBA? according to this answer it uses 32 bit per channel data no matter what) - which we do not control as it is generated by gdk on the server side. This means making png the default and finding a solution for the mmap case: possibly using cairo server side to export with the rowstride expected by cairo on the client? Maybe also moving the draw/expose code to a utility class so we can use the current code on gtk2 and the new horrible mess on gtk3 only.- some re-drawing problems due to coordinates and clipping interfering with each other (shouldn't be too hard to fix)
r640 makes python3 + gtk3 almost usable by providing two different window backing mechanisms (we keep the old/fast code for gtk2, cairo for gtk3). But there are still many issues remaining:
- most of the gtk3 function stubs at the top of
client.py
are still missing an actual implementation (no cursors, no keyboard support, etc)display = gdk.display_get_default()
and watching for screen changes has been hacked out with aif not is_gtk3()
guard- the gtk3 version of the tray menu is mostly broken due to api changes: missing icons, about dialog errors, etc
- r667 fixes
get_modifiers_mask
,set_geometry_hints
andis_flag_set
vsMAPPED
/REALIZED
There are serious compatibility issues between the new
io.StringIO
module andPIL
, r697 reverts back toStringIO.StringIO
in order to fix window icons - this will cause problems when trying to port the server to gtk3/python3.
delayed, this is hard!
Worth updating and getting the basics to work properly (keyboard, etc)
And maybe also: transparency, GL, cursors, ..
too much work, too little time
Lots of updates, this may be a better option than #300:
- misc fixes: r6205, r6203, r6194, r6192, r6191, r6190, r6208
- py3k string mess: r6189, r6184, r6183, r6181, r6179+r6180, r6178
- build updates: r6188, r6177, r6176 (broke rencode python build on win32 - fixed by r6211), r6210, r6213, r6214, r6215
- refactoring: r6202
- gtk3 x11: r6201, r6200, r6199
- mouse and beep support: r6206, r6207
- re-use new buffer code (see #465): r6198, r6212
- ugly cairo mess: r6197, r6196, r6187, r6186, r6185 (last three are candidates for backports)
- support for icons: r6195
- support for system tray: r6193
It is in a much better shape now, including some keyboard support.
[[BR]]
Things that just need more work:
- transparency (should now work on osx and win32 without opengl?)
- window state (fullscreen, etc)
- spinner
- workspaces
- launcher
- session info and about dialog
- clipboard (oh joy)
- sound (gstreamer 1.x)
- osx integration work (..)
[[BR]]
Things that won't work out of the box with python3:
- py2exe does not support python3 at all, maybe use cx_freeze (the python documentation claims to be able to generate installers directly, I doubt this will work well enough for our needs but worth a try: distutils builtdist: creating windows installers)
- gtkglext and pygtkglext aren't supported with gtk3... tegtkgl claims to be GTK+ 3.0 OpenGL widget, or maybe this gtkglext port to GTK+ 3 - Note: A git build is included below as part of the
pygobjectwin32
installer.[[BR]]
- python netifaces does not support py3k
MS Windows issues
GTK (what a mess):
- pygobjectwin32 seems to be the place to get everything - the alternative would be to build from source with mingw and jhbuild...
[[BR]]
Things that install OK on win32 via installers (preferred):
[[BR]]
Things that install OK on win32 via
scripts\pip.exe install
orpy -3 -m pip install
:[[BR]]
Things that need a C compiler to install on win32. Note: I have used mingw32 as per [http://stackoverflow.com/questions/3297254/how-to-use-mingws-gcc-compiler-when-installing-python-package-using-pip ] instead of Visual Studio 2010 normally used with Python 3.4 because I already have Visual Studio 2008 installed for Python 2.7... for now.
netifaces-python3.patch
(6.8 KiB)fixes netifaces to build with python3
Using Porting Extension Modules to Python 3 and Porting Extension Modules To Py3k, it was relatively easy to port
netifaces
. Now builds on both Linux and win32 with Python 3.4. I have sent the patch to the author, who said he was going to look at it. Alternatively, netifaces-merged could be used.
win32-build-with-mingw.patch
(15.6 KiB)with this patch I can build with python3.4 and mingw
More fixes:
- gtk fixes (about and session-info now work): r6229, r6231, r6232
- encoders fallback / info improvements: r6217, r6218, r6219, r6220, r6221, r6222, r6223, r6227
- more string issues: r6225 + r6226, r6228, r6230
Harder (delayed):
- client launcher
- latency graphs (need porting to cairo..)
Many build updates in r6233, r6236, r6237, r6238, r6239, r6240, r6241, r6242
We can now build all the cython modules properly easily with unmodified build files:
set PYTHON=C:\Python34 set PATH=%PATH%;C:\MinGW\bin set PKG_CONFIG_PATH=C:\MinGW\lib\pkgconfig;C:\MinGW\msys\1.0\local\lib\pkgconfig;C:\MinGW\msys\1.0\lib\pkgconfig win32\MAKE-INSTALLER.BAT /silent
You must build
ffmpeg
andlibvpx
into the mingw environment to use them viapkg-config
:./configure (...) --prefix=C:\MinGW make make install
And... cx freeze (stub added in r6243) is not available for Python 3.4 on win32, it does not build either. So I will start again from the top with Python 3.3.5 instead.
Things to install using pygobjectwin32:
gobject-introspection
(replacespygtk
)gst-plugins
gdkglext
gst-plugins-extra
gtk+
pango
gstreamer
gdk-pixbuf
dbus-glib
gtkglext
- Development packages (use defaults)
More build updates in r6245, r6246, r6247, r6248, r6249, r6250, r6251. Big change in r6252 allows us to build correctly again on all (?) platforms (fixes buffer compilation issues with Visual Studio)
Issue migrated from trac ticket # 90
component: core | priority: major | resolution: fixed
2012-03-27 08:53:09: antoine created the issue