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

python-wnck removed in Ubuntu 18.04 #95

Open
bl4ck5un opened this Issue May 1, 2018 · 16 comments

Comments

Projects
None yet
8 participants
@bl4ck5un

bl4ck5un commented May 1, 2018

python-wnck is no longer available in Ubuntu 18.04. I'm using the package from artful (17.10) as a workaround. Would be great to know how to install quicktile properly in 18.04.

@ssokolow

This comment has been minimized.

Owner

ssokolow commented May 1, 2018

Ahh. I didn't catch that because, as every *buntu upgrade I've ever done has unpredictably broken things, I haven't been able to speculatively budget a huge block of time for an upgrade from 14.04 LTS yet.

I suspect python-wnck is gone because applications are expected to use PyGI and the language-agnostic GObject Introspection bindings for libwnck rather than PyGTK and python-wnck.

The proper solution will be me migrating it to Python 3.x and PyGI when I can spare the time (the API adapter to ease porting PyGTK apps to PyGI segfaults when I hook QuickTile up to it, so I need to do it the long way... which also takes time I haven't had).

@bl4ck5un

This comment has been minimized.

bl4ck5un commented May 2, 2018

Okay. make sense. I'm not familiar with PyGI etc at all so can't help there. For now, using python-wnck from 17.10 works flawlessly.

@fidergo-stephane-gourichon

This comment has been minimized.

fidergo-stephane-gourichon commented May 25, 2018

If you're reading this because you just want a python-wnck that work on Ubuntu Bionic Beaver 18.04, download it for your architecture from https://packages.ubuntu.com/artful/python-wnck . Thanks @bl4ck5un for the tip!

To @ssokolow: thanks for all.

It seems python-wnck package was removed a month ago, ref https://launchpad.net/ubuntu/bionic/amd64/python-wnck with reference to https://bugs.launchpad.net/ubuntu/+source/gnome-python-desktop/+bug/1739797

gnome-python-desktop was recently removed from Debian Testing since it is GNOME2 tech that has been unmaintained for years.

@Falieson

This comment has been minimized.

Falieson commented Jun 7, 2018

sudo sh -c "echo 'deb http://cz.archive.ubuntu.com/ubuntu artful main universe' > /etc/apt/sources.list" 

then you can run the apt install command

@perlun

This comment has been minimized.

perlun commented Jul 8, 2018

The situation is the same with Debian Testing (Buster) which is what Ubuntu 18.04 is based on; python-wnck is unavailable. But, it's available in Debian Unstable i.e. sid - those of you running Debian Testing can download the sid/stretch packages here: https://packages.debian.org/sid/python-wnck and https://packages.debian.org/stretch/python-wnck

@fidergo-stephane-gourichon

This comment has been minimized.

fidergo-stephane-gourichon commented Jul 25, 2018

It looks like there is a way to directly have wnck available from python without dedicated python-wnck package, using the GObject introspection infrastructure. Details are on https://stackoverflow.com/a/43349245/1429390

apt-get install python3-gi gir1.2-wnck-3.0

then

>>> import gi
>>> gi.require_version('Wnck', '3.0')
>>> from gi.repository import Wnck
@ssokolow

This comment has been minimized.

Owner

ssokolow commented Jul 25, 2018

I've been aware of that for a while, but there are three problems with it:

  1. That's libwnck 3.x, which is for GTK+ 3.x, while QuickTile is a GTK+ 2.x application.
  2. I don't think it's possible to mix PyGTK and PyGI in the same event loop and, even if it is, it's likely to introduce random crashes.
  3. I've tried to start porting from PyGTK to PyGI in the past, but, when I just swapped in the API shim PyGI provides to ease porting of PyGTK apps, I got segfaults on my *buntu 14.04 LTS system.

Basically, while I do eventually want to use that, it requires a very involved porting process that I'm still trying to make time for:

  1. Port from Python 2.x to Python 3.x, because Python 2.x is soon to be end-of-lifed
  2. Port from PyGTK to PyGI, because PyGTK is end-of-lifed
  3. Port from GTK+ 2.x to GTK+ 3.x, because GTK+ 2.x is end-of-lifed (that's why libwnck 2 is going away)

...and since PyGTK isn't available for Python 3.x and PyGI's support for GTK+ 2.x is flaky at best, I have to do it all at once.

(And it's impossible to keep it working during the intermediate steps so I can port incrementally and test for bugs along the way. It many ways, the complexity approaches a complete rewrite and, if there were a suitable equivalent to libwnck in the Qt ecosystem, I'd probably that port to PyQt 5 instead.)

I'd hoped to write an automated test suite first, but other things kept cropping up.

@aarredon

This comment has been minimized.

aarredon commented Jul 28, 2018

For those that want to add the artful repo as mentioned by @Falieson I would recommend using the following command:

sudo sh -c "echo 'deb http://cz.archive.ubuntu.com/ubuntu artful main universe' >> /etc/apt/sources.list"
Make sure that you have two >> and not just one > The reason being that > will overwrite the file, but >> will append it to the end of the file. Trust me you don't want to wipe out your /etc/apt/sources.list file. I got my setup running using @Falieson command (thanks!) and my little tweak.

@ssokolow

This comment has been minimized.

Owner

ssokolow commented Jul 28, 2018

I recommend adding a file to /etc/apt/sources.list.d instead. That way, you're not even touching sources.list.

sudo sh -c "echo 'deb http://cz.archive.ubuntu.com/ubuntu artful main universe' > /etc/apt/sources.list.d/artful-main-universe.list"
@kbsali

This comment has been minimized.

kbsali commented Nov 5, 2018

@ssokolow obviously same issue on 18.10,
any plan on fixing this? (maybe you are not an Ubuntu user!? :) )

@peteruithoven

This comment has been minimized.

peteruithoven commented Nov 5, 2018

I wasn't really looking forward to play around with sources so I've figured out a crude way of doing quarter tiling using this script:
https://gist.github.com/peteruithoven/db0cba0b0849c8cb5e267f6e75126304
You'll have to adapt some values based on your screen size, top panel size, window margins etc. The default window margins are elementary OS specific for example.

@kbsali

This comment has been minimized.

kbsali commented Nov 5, 2018

@peteruithoven nice, although this looks very very basic! :) quicktile does a lot more than just quarter tile! I've been using quicktile for years now and couldn't find a better option (I'm biased & used to it). You script looks good for 1 single "fixed" monitor, I use it on my laptop which I connect to different external devices.

@ssokolow

This comment has been minimized.

Owner

ssokolow commented Nov 5, 2018

@kbsali Oh, I certainly intend to fix it.

It's just that my life has been so busy lately that I'm still on Kubuntu 14.04 LTS despite its support period ending in only a few months.

The problem is that switching to what's supported in newer releases requires a port from GTK+ 2.x to GTK+ 3.x, and that's more complicated than it sounds because of the need to also port from PyGTK to PyGI. (And staying on Python 2.x initially and using the PyGTK->PyGI porting shim to port in stages is complicated by the fact that, last time I tried that, PyGI segfaulted.)

@ssokolow

This comment has been minimized.

Owner

ssokolow commented Nov 6, 2018

I had some free time today, so I decided "appears to work, but potentially buggy" is better than "nothing testable", and I've started to work on getting it ported to PyGI and Wnck 2.x.

I'm to the point where the only thing left that static analysis is complaining about is the handful of sparse unit tests I have, which are use GdkRegion for mocking... and there's no apparent "rename X to Y" porting path for that, so I'll need a little more time to rewrite the relevant bits.

UPDATE: ...and manual testing reminded me of how heavily I use GdkRegion in the code without directly referencing the type name. Time to figure out what the APIs which used to return it are returning now.

UPDATE: To clarify, GdkRegion was replaced with cairo_region_t, but I'm having trouble figuring out how to access it via a Python binding. (The API exposed by PyGI doesn't seem to have a way for me to instantiate one and I'm still on PyCairo 1.8.8, when cairo.Region didn't get exposed until 1.11.0.)

@ssokolow

This comment has been minimized.

Owner

ssokolow commented Nov 9, 2018

I decided I'll just leave the GTK+ 2.x version easily accessible in a branch for anyone needing pre-1.11.0 PyCairo, so I upgraded my copy of PyCairo and I've continued to work on the porting to GTK+ 3.x.

Still not complete enough to run without dying from "no such method" errors, but progress is being made.

@kbsali

This comment has been minimized.

kbsali commented Nov 10, 2018

Great news, thanks for the effort! 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment