-
-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wxGUI/psmap: fix close vector map properties dialog after hit OK button #3085
wxGUI/psmap: fix close vector map properties dialog after hit OK button #3085
Conversation
c6d2f44
to
9763ed3
Compare
Has this been merged yet? Doesn't look like it. |
Not yet. I looked at it briefly some time ago and I had some issues reproducing it. Can you confirm this PR actually fixes it? |
The bug is still reproducible following the steps in the reported issue #3084 and this PR fixes it. I carefully tested each of my PRs before creating them. |
Unfortunately, this does not fix the bug. I compiled this PR and it is still there. It behaves as if closing the vector settings dialog does not relinquish the focus, even though the window is closed. No other windows (cartographic composer layer window, main cartographic composer window, main GUI window) are responsive as if another dialog was waiting for a response. |
Sorry it took so long, but finally I got to this. @tmszi yes, I can reproduce it on Ubuntu and I agree with the fix. The problem is ShowModal is not called the standard way with this dialog (testing outcome of ShowModal and then destroying the dialog would be better, but would require larger changes). @cmbarton since this seems to fix it for Ubuntu (and I assume @tmszi tested it on linux as well, no?), could you make sure the patch is correctly applied? But it sounds like maybe the behavior with this fix is different? It could be something Mac specific. |
My complex debug info: Problematic is line vector map props dialog only, especially grass/gui/wxpython/psmap/dialogs.py Lines 2927 to 2929 in 69dd324
If you try comment code lines 2927-2960, confirming line vector map props dialog Ok button widget works as expected. Others vector map props dialog (point and area type), confirming Ok button widget works as expected. Because doesn't use Another bug (new PR) is in
grass/gui/wxpython/psmap/dialogs.py Lines 182 to 192 in 69dd324
I tested this PR under wxGTK and wxMSW. |
I can confirm that the problem persists on Mac even with this present solution, using |
The vector property window, once opened cannot be closed. By simply open it, doing nothing, then close (via cancel button), only puts the window behind all other windows, but the window doesn't close nor the modal state cannot be terminated. Only solution is to force quit gui (wxPython). |
I tried commenting out the lines 2927-2960, but it didn't do any difference. |
Could someone on Mac try using this in the OnOK method? |
I missed that suggestion, yes it seems to work! Now, only cancel remain the same (problematic). |
Following works for me: def OnCancel(self, event):
self.EndModal(wx.ID_CANCEL)
def OnOK(self, event):
self.update()
event.Skip()
self.EndModal(wx.ID_OK) One (rather trivial, but still) problem remains, after closing "Vector Properties" window, the "Map settings" window looses focus and is placed behind "Cartographic Composer" window. |
This problem seems to be pervasive in the custom-designed interfaces that wrap GRASS commands (e.g., the raster and vector import tools). Trivial but annoying. In class today, I needed to show a student why they could not import a file. After selecting the file in the raster import tool, the import window disappears behind the main GRASS GUI window. They did not know this and wondered what happened. |
Yes, now with the single window mode it is particularly annoying because it is virtually impossible to see (if the main window fills the screen). I was fooled by this several times testing this PR. |
I decided to slightly refactor this, the dialog is now derived from standard wx dialog, so the hack above is not needed. Testing welcome. I did have some issues with a validator, so I removed it, it's not very important anyway, |
That looks Mac-specific, you could try calling But some of these problems with single window are general, we could explore some window settings like 'wx.FRAME_FLOAT_ON_PARENT'. |
Successfully tested on wxGTK, wxMSW. |
That works fine! |
I found what I believe a better solution. In |
If this is committed I can test too. |
That makes sense. I assume you tested it, does this solve the problem with hiding the dialog on Mac? |
Yes |
This solves all reported problem with the cartographic composer. Thanks to all! Can we add the fix to the hidden window to the raster and vector import tools too? Probably some other places need it, but I don't know which right now. |
👍
I looked for similar problems in the import tools, but I couldn't find any. Please, take a closer look and report in an another ticket. |
OK. Thanks again to you, Thomas, and Anna for fixing this.
Michael
…____________________
Michael Barton
On Sep 15, 2023, at 12:23 PM, Nicklas Larsson ***@***.***> wrote:
This solves all reported problem with the cartographic composer. Thanks to all!
👍
Can we add the fix to the hidden window to the raster and vector import tools too? Probably some other places need it, but I don't know which right now.
I looked for similar problems in the import tools, but I couldn't find any. Please, take a closer look and report in an another ticket.
—
Reply to this email directly, view it on GitHub <#3085 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACENLLYZRVHUKMYEOIMSOTLX2STLBANCNFSM6AAAAAA2KF56ZA>.
You are receiving this because you were mentioned.
|
…on (OSGeo#3085) * make VPropertiesDialog behave like standard dialog, don't inherit from PsmapDialog * accept suggestion about parent to prevent hiding the dialog on wxMAC --------- Co-authored-by: Anna Petrasova <[email protected]>
…on (OSGeo#3085) * make VPropertiesDialog behave like standard dialog, don't inherit from PsmapDialog * accept suggestion about parent to prevent hiding the dialog on wxMAC --------- Co-authored-by: Anna Petrasova <[email protected]>
…on (OSGeo#3085) * make VPropertiesDialog behave like standard dialog, don't inherit from PsmapDialog * accept suggestion about parent to prevent hiding the dialog on wxMAC --------- Co-authored-by: Anna Petrasova <[email protected]>
…on (OSGeo#3085) * make VPropertiesDialog behave like standard dialog, don't inherit from PsmapDialog * accept suggestion about parent to prevent hiding the dialog on wxMAC --------- Co-authored-by: Anna Petrasova <[email protected]>
Fixes #3084.