mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
[GTK3][OSX] Restore windowing lookup for quartz
This commit is contained in:
parent
b29b6fe69f
commit
250afa6e0b
1 changed files with 8 additions and 4 deletions
|
@ -22,8 +22,8 @@ gi.require_version('Gtk', '3.0') # NOQA: E402
|
||||||
gi.require_version('Gdk', '3.0') # NOQA: E402
|
gi.require_version('Gdk', '3.0') # NOQA: E402
|
||||||
|
|
||||||
# isort:imports-thirdparty
|
# isort:imports-thirdparty
|
||||||
from gi.repository.Gdk import threads_enter, threads_init, threads_leave
|
from gi.repository.Gdk import Display, threads_enter, threads_init, threads_leave
|
||||||
from gi.repository.GObject import set_prgname
|
from gi.repository.GLib import set_prgname
|
||||||
from gi.repository.Gtk import ResponseType
|
from gi.repository.Gtk import ResponseType
|
||||||
from twisted.internet import defer, gtk3reactor
|
from twisted.internet import defer, gtk3reactor
|
||||||
from twisted.internet.error import ReactorAlreadyInstalledError
|
from twisted.internet.error import ReactorAlreadyInstalledError
|
||||||
|
@ -148,6 +148,10 @@ DEFAULT_PREFS = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def windowing(like):
|
||||||
|
return like.lower() in str(type(Display.get_default())).lower()
|
||||||
|
|
||||||
|
|
||||||
class GtkUI(object):
|
class GtkUI(object):
|
||||||
def __init__(self, args):
|
def __init__(self, args):
|
||||||
# Setup gtkbuilder/glade translation
|
# Setup gtkbuilder/glade translation
|
||||||
|
@ -163,7 +167,7 @@ class GtkUI(object):
|
||||||
|
|
||||||
SetConsoleCtrlHandler(on_die, True)
|
SetConsoleCtrlHandler(on_die, True)
|
||||||
log.debug('Win32 "die" handler registered')
|
log.debug('Win32 "die" handler registered')
|
||||||
elif osx_check(): # TODO: Add this back: `and WINDOWING == 'quartz':`
|
elif osx_check() and windowing('quartz'):
|
||||||
import gtkosx_application
|
import gtkosx_application
|
||||||
|
|
||||||
self.osxapp = gtkosx_application.gtkosx_application_get()
|
self.osxapp = gtkosx_application.gtkosx_application_get()
|
||||||
|
@ -215,7 +219,7 @@ class GtkUI(object):
|
||||||
self.statusbar = StatusBar()
|
self.statusbar = StatusBar()
|
||||||
self.addtorrentdialog = AddTorrentDialog()
|
self.addtorrentdialog = AddTorrentDialog()
|
||||||
|
|
||||||
if osx_check(): # TODO: Add this back: `and WINDOWING == 'quartz':`
|
if osx_check() and windowing('quartz'):
|
||||||
|
|
||||||
def nsapp_open_file(osxapp, filename):
|
def nsapp_open_file(osxapp, filename):
|
||||||
# Ignore command name which is raised at app launch (python opening main script).
|
# Ignore command name which is raised at app launch (python opening main script).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue