Skip to content

Commit

Permalink
fixup quit_handler changes
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Jul 28, 2023
1 parent 54b4802 commit 56cfbee
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions xpra/platform/darwin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,21 @@ def do_init_env():
os.environ["GST_PLUGIN_SCANNER"] = os.path.join(rsc_dir, "bin", "gst-plugin-scanner-1.0")


def noop(*args):
pass
def default_gtk_main_exit():
import gi
gi.require_version('Gtk', '3.0') # @UndefinedVariable
from gi.repository import Gtk # @UnresolvedImport
Gtk.main_quit()

exit_cb : Callable = noop

exit_cb : Callable = default_gtk_main_exit
def quit_handler(*_args):
global exit_cb
exit_cb()
else:
import gi
gi.require_version('Gtk', '3.0') # @UndefinedVariable
from gi.repository import Gtk # @UnresolvedImport
Gtk.main_quit()
return True

def set_exit_cb(ecb : Callable):
global exit_cb
assert ecb is not None
exit_cb = ecb

macapp = None
Expand Down

0 comments on commit 56cfbee

Please sign in to comment.