kupferlauncher / kupfer

kupfer, smart, quick launcher. `master' is kupfer's release branch.
http://kupferlauncher.github.io
GNU General Public License v3.0
368 stars 64 forks source link

Segfaults under Wayland with new libwnck #165

Closed toobaz closed 1 year ago

toobaz commented 1 year ago

Please provide enough information to reproduce the issue.

Environment

Kupfer Version: both 320 and git master ( 35759097a043e366968d8723ec77f5bcc47d0c99 ) Window Manager: Wayland Desktop Environment: gnome-shell Linux Distribution: Debian testing

Actual Behaviour

When first called, Kupfer starts fine, but as soon as a key is pressed, it segtaults

Expected Behaviour

Normal behavior.

This is due to the following regression in libwnck: https://gitlab.gnome.org/GNOME/libwnck/-/issues/157

... but to be fair, it might be not too elegant to ask info on the current X session when no X session is running.

I'm sure cleaner approaches are possible, but the simplest fix I could find was to put the following lines:

import os
from gi.repository import Wnck
if 'WAYLAND_DISPLAY' in os.environ:
    Wnck.Screen.get_default = lambda *x : None

... before the if in kupfer.py (line 21). This restores the previous behavior of get_default(), and so kupfer works just fine.

khurshid-alam commented 1 year ago

libwnck is xorg only. Try running under xorg @toobaz

toobaz commented 1 year ago

libwnck is xorg only. Try running under xorg @toobaz

Is kupfer xorg only?

I've been using it under Wayland for months... (and I'm still doing it, with the code added above).

khurshid-alam commented 1 year ago

Kufer depends on some libraries which are xorg only.

toobaz commented 1 year ago

Well, just for you to know, it should work again in Wayland if https://gitlab.gnome.org/GNOME/libwnck/-/merge_requests/52 is merged.

(Or if you make the minimal edit I am proposing, which won't harm anyway)

KarolBedkowski commented 1 year ago

In debian 11.6 (Gnome, wayland) i don't see problem with segfault. Wnck.Screen.get_display() return None and only report "is designed to work with x11 only..." I found some places that result of get_display() is not checked and this may cause some problems.
Also other things are totally broken - keybinder i.e.

toobaz commented 1 year ago

In debian 11.6 (Gnome, wayland) i don't see problem with segfault

I can confirm: the bug emerged only when upgrading to testing (libwnck 43.0).

toobaz commented 1 year ago

@KarolBedkowski I can confirm your fix works fine (and looks better than mine). Do you plan to merge it in master?

(Just asking to understand if a patch on the Debian package is worth it)

KarolBedkowski commented 1 year ago

I will prepare new release - maybe tomorrow..