koordinates / kart-qgis-plugin

A QGIS integration plugin for Kart repositories. Distributed version-control for geospatial and tabular data.
https://kartproject.org
GNU General Public License v2.0
37 stars 16 forks source link

Clone: fix issue with dialog hiding #99

Closed rcoup closed 1 year ago

rcoup commented 1 year ago

When selecting a source/destination folder during cloning, after the OS browser dialog was closed the clone dialog isn't re-focused and ended up hiding behind the main QGIS window.

CleanShot 2023-04-20 at 12 41 09 (at the end I hit ⌘` to bring the clone dialog back to the foreground)

Fix this by calling self.raise_() & self.activateWindow() after the folder is selected

@nyalldawson there are other places in the plugin which don't use this pattern, still use QFileDialog in the same way, and the plugin dialog doesn't end up in the background... any idea why the clone dialog is different?

nyalldawson commented 1 year ago

there are other places in the plugin which don't use this pattern, still use QFileDialog in the same way, and the plugin dialog doesn't end up in the background... any idea why the clone dialog is different?

Might be related to the modality flags set on those dialogs. FWIW, this issue is specific to Qt on MacOS.

There's actually 4(!) commands necessary to ensure that a window is focused and raised in ALL situations:

self.show()
self.raise_()
self.setWindowState( self.windowState() & ~Qt.WindowMinimized )
self.activateWindow()

:upside_down_face: