mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-24 10:18:51 +00:00
[GTK] Only import wnck on X11 display
Wnck is only supported on X11 and raises errors in Wayland so only load it when X11 present. Fixes: #3265
This commit is contained in:
parent
7ee8750be4
commit
03e7952d26
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
### Gtk UI
|
### Gtk UI
|
||||||
|
|
||||||
|
- Fix errors running on Wayland (#3265).
|
||||||
- Fix Peers Tab tooltip and context menu errors (#3266).
|
- Fix Peers Tab tooltip and context menu errors (#3266).
|
||||||
|
|
||||||
### Web UI
|
### Web UI
|
||||||
|
@ -13,6 +13,7 @@ import logging
|
|||||||
import os.path
|
import os.path
|
||||||
from hashlib import sha1 as sha
|
from hashlib import sha1 as sha
|
||||||
|
|
||||||
|
import gi
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
from gi.repository.Gdk import DragAction, WindowState
|
from gi.repository.Gdk import DragAction, WindowState
|
||||||
from twisted.internet import reactor
|
from twisted.internet import reactor
|
||||||
@ -27,19 +28,19 @@ from .common import get_deluge_icon
|
|||||||
from .dialogs import PasswordDialog
|
from .dialogs import PasswordDialog
|
||||||
from .ipcinterface import process_args
|
from .ipcinterface import process_args
|
||||||
|
|
||||||
try:
|
|
||||||
import gi
|
|
||||||
|
|
||||||
gi.require_version('Wnck', '3.0')
|
|
||||||
from gi.repository import Wnck
|
|
||||||
except ValueError:
|
|
||||||
Wnck = None
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from gi.repository import GdkX11
|
from gi.repository import GdkX11
|
||||||
except ImportError:
|
except ImportError:
|
||||||
GdkX11 = None
|
GdkX11 = None
|
||||||
|
|
||||||
|
Wnck = None
|
||||||
|
if GdkX11:
|
||||||
|
try:
|
||||||
|
gi.require_version('Wnck', '3.0')
|
||||||
|
from gi.repository import Wnck
|
||||||
|
except (ImportError, ValueError):
|
||||||
|
pass
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user