electrum

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

commit 4f7169db6adea6804dab17dfceb810a584d70eda
parent b0afdf46140c10506ffd6be771bb9bb533dde7ba
Author: ThomasV <thomasv@electrum.org>
Date:   Fri, 12 Aug 2016 13:09:16 +0200

fix issue #1892 (window geometry)

Diffstat:
Mgui/qt/main_window.py | 17+++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py @@ -271,12 +271,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): self.clear_receive_tab() self.request_list.update() self.tabs.show() - - try: - self.setGeometry(*self.wallet.storage.get("winpos-qt")) - except: - self.setGeometry(100, 100, 840, 400) - + self.init_geometry() if self.config.get('hide_gui') and self.gui_object.tray.isVisible(): self.hide() else: @@ -284,6 +279,16 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): self.watching_only_changed() run_hook('load_wallet', wallet, self) + def init_geometry(self): + winpos = self.wallet.storage.get("winpos-qt") + try: + screen = self.app.desktop().screenGeometry() + assert screen.contains(QRect(*winpos)) + self.setGeometry(*winpos) + except: + self.print_error("using default geometry") + self.setGeometry(100, 100, 840, 400) + def watching_only_changed(self): title = 'Electrum %s - %s' % (self.wallet.electrum_version, self.wallet.basename())