Skip to content
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/vdigit: fix map window focus after starting edits #2525

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

tmszi
Copy link
Member

@tmszi tmszi commented Aug 14, 2022

Describe the bug
After start editing some vector map, Map window doesn't have automatic focus, keyboard shortcut for activating Digitizer Point/Line tool doesn't work. First, it is necessary to focus Map window with the left mouse button.

To Reproduce
Steps to reproduce the behavior:

  1. Launch wxGUI
  2. Activate Vector Digitizer from Map window toolbar ComboBox widget, choose Vector digitizer item
  3. From Vector Digitizer toolbar ComboBox choose New vector map
  4. Set new vector map e.g. vdigit on the Create new vector map dialog and hit OK button
  5. Vector Attribute Table Manager window is opened
  6. Close Vector Attribute Table Manager window
  7. Try activate Vector Digitizer Point tool via keyboard shortcut Ctrl + P or Line tool Ctrl + L
  8. Tool is not activated, because Map window doesn't have automatic focus (before you activate tool via keyboard shortcut you have to mouse left click on Map window to get focus)

or

  1. Add some vector map e.g. d.vect census
  2. Activate Vector Digitizer from the Layers tree, right mouse click on the vector layer census to invoke layer menu and choose Start editing item
  3. Try activate Vector Digitizer Point tool via keyboard shortcut Ctrl + P or Line tool Ctrl + L
  4. Tool is not activated, because Map window doesn't have automatic focus (before you activate tool via keyboard shortcut you have to mouse left click on Map window to get focus)

Expected behavior
After start editing some vector map, Map window should be have automatic focus and keyboard shortcut for activating Digitizer Point/Line tool work immediately.

System description:

  • Operating System: all
  • GRASS GIS version: all

@tmszi tmszi added bug Something isn't working backport_needed GUI wxGUI related labels Aug 14, 2022
@tmszi tmszi added this to the 8.2.1 milestone Aug 14, 2022
Copy link
Contributor

@petrasovaa petrasovaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The part in OnCloseWindow would set focus on window in every case, even when you are not using digitizer, so that doesn't seem to be a good solution, it's not particularly elegant anyway. You could implement some sort of callback that would be registered only for cases when db manager is called from digitizer, but that seems unnecessarily complex for the benefit.
Unless you have some idea what to do with this, I suggest to leave only the change in toolbars.py.

@neteler neteler modified the milestones: 8.2.1, 8.2.2 Jan 22, 2023
@wenzeslaus wenzeslaus modified the milestones: 8.2.2, 8.3.1 Jun 6, 2023
@tmszi tmszi modified the milestones: 8.3.1, 8.3.2 Sep 27, 2023
@neteler neteler modified the milestones: 8.3.2, 8.3.3 Feb 20, 2024
@echoix echoix force-pushed the wxgui-vdigit-fix-win-focus branch from ef7a151 to d9ed3ab Compare May 23, 2024 02:01
@echoix echoix modified the milestones: 8.3.3, Future May 23, 2024
@github-actions github-actions bot added the Python Related code is in Python label May 23, 2024
@petrasovaa petrasovaa modified the milestones: Future, 8.5.0 Nov 8, 2024
@petrasovaa petrasovaa merged commit 8716ba5 into OSGeo:main Nov 8, 2024
26 checks passed
a0x8o pushed a commit to a0x8o/grass that referenced this pull request Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GUI wxGUI related Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants