electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 95ae42b998f6abbe8667d9032f2084f78ad009bf
parent e34afd62cecf7ef0e191fb12e5ebcfe2a1dfb7cb
Author: SomberNight <somber.night@protonmail.com>
Date:   Tue, 13 Aug 2019 17:12:42 +0200

kivy wizard: undo Window.bind callbacks

related: #5534

Diffstat:
Melectrum/gui/kivy/main_window.py | 9++++-----
Melectrum/gui/kivy/uix/dialogs/installwizard.py | 14++++++++++----
2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/electrum/gui/kivy/main_window.py b/electrum/gui/kivy/main_window.py @@ -495,11 +495,10 @@ class ElectrumWindow(App): ''' import time Logger.info('Time to on_start: {} <<<<<<<<'.format(time.clock())) - win = Window - win.bind(size=self.on_size, on_keyboard=self.on_keyboard) - win.bind(on_key_down=self.on_key_down) - #win.softinput_mode = 'below_target' - self.on_size(win, win.size) + Window.bind(size=self.on_size, on_keyboard=self.on_keyboard) + Window.bind(on_key_down=self.on_key_down) + #Window.softinput_mode = 'below_target' + self.on_size(Window, Window.size) self.init_ui() crash_reporter.ExceptionHook(self) # init plugins diff --git a/electrum/gui/kivy/uix/dialogs/installwizard.py b/electrum/gui/kivy/uix/dialogs/installwizard.py @@ -539,11 +539,14 @@ class WizardDialog(EventsDialog): self.ids.back.disabled = not wizard.can_go_back() self.app = App.get_running_app() self.run_next = kwargs['run_next'] - _trigger_size_dialog = Clock.create_trigger(self._size_dialog) - Window.bind(size=_trigger_size_dialog, - rotation=_trigger_size_dialog, + + self._trigger_size_dialog = Clock.create_trigger(self._size_dialog) + # note: everything bound here needs to be unbound as otherwise the + # objects will be kept around and keep receiving the callbacks + Window.bind(size=self._trigger_size_dialog, + rotation=self._trigger_size_dialog, on_keyboard=self.on_keyboard) - _trigger_size_dialog() + self._trigger_size_dialog() self._on_release = False def _size_dialog(self, dt): @@ -579,6 +582,9 @@ class WizardDialog(EventsDialog): return True def on_dismiss(self): + Window.unbind(size=self._trigger_size_dialog, + rotation=self._trigger_size_dialog, + on_keyboard=self.on_keyboard) app = App.get_running_app() if app.wallet is None and not self._on_release: app.stop()