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

Fix copy-to-clipboard key binding for console (trac#3008) #393

Merged
merged 1 commit into from
Mar 24, 2020

Conversation

nilason
Copy link
Contributor

@nilason nilason commented Mar 2, 2020

This PR addresses the trac#3008 issue, where cmd+c on macOS presently clear the output console instead of the (on macOS) expected outcome: copy-to-clipboard of selected text.

Tested on Windows and Mac.

Update: this also addresses trac#3592.

@petrasovaa petrasovaa self-requested a review March 2, 2020 14:29
* fixes trac issue https://trac.osgeo.org/grass/ticket/3008,
binding cmd+c to copy-to-clipboard in output console and
python shell

* fixes trac issue https://trac.osgeo.org/grass/ticket/3592,
binding cmd+c to copy-to-clipboard import/export dialogs
@petrasovaa
Copy link
Contributor

Hi, unfortunately I am unable to test this on mac, but I felt this solution seems like too much workaround. Were you able to identify the actual cause of the problem? Is this something specifically in GRASS or it's more wx issue? For example, is that caused by some default bindings in wx.stc widget? If yes, there might be ways to address it directly using their methods (https://wxpython.org/Phoenix/docs/html/wx.stc.StyledTextCtrl.html). If it's related to wx, using the wx demo can sometimes help to find the issue.

Also, the same workaround would be probably needed in forms.py for module dialogs.

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.

see comment

@nilason
Copy link
Contributor Author

nilason commented Mar 23, 2020

This is an old and still standing wxWidgets issue for mac, see: http://trac.wxwidgets.org/ticket/15678 and wxWidgets/Phoenix#1134.

Presently, as far as I know, only a workaround can fix this and the solution I suggested is the least invasive I could think up. The added code can also be easily disposed of if fixed upstream.

So far I could only observe this problem with import_export.py and layer manager (the console and the python tab) which this PR addresses. Generated forms seems to behave correctly as is.

@petrasovaa petrasovaa self-requested a review March 23, 2020 15:00
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.

Thanks for more info. Then I guess we will have to go with this.

@petrasovaa petrasovaa merged commit 69148c8 into OSGeo:master Mar 24, 2020
petrasovaa pushed a commit that referenced this pull request Mar 24, 2020
* fixes trac issue https://trac.osgeo.org/grass/ticket/3008,
binding cmd+c to copy-to-clipboard in output console and
python shell

* fixes trac issue https://trac.osgeo.org/grass/ticket/3592,
binding cmd+c to copy-to-clipboard import/export dialogs
@nilason
Copy link
Contributor Author

nilason commented Mar 24, 2020

Great, thanks!

@nilason nilason deleted the fix-trac-3008 branch March 24, 2020 14:20
nilason added a commit to nilason/grass that referenced this pull request Jul 15, 2020
With wxPython 4.1.0 previous fixes (OSGeo#393) turned insufficient. This is a
workaround for a still unresolved wxWidgets issue. It also reinstates
the ESCAPE key as a way to close the window/dialog.

Fixes OSGeo#785
nilason added a commit to nilason/grass that referenced this pull request Jul 15, 2020
With wxPython 4.1.0 previous fixes (OSGeo#393) turned insufficient. This is a
workaround for a still unresolved wxWidgets issue. It also reinstates
the ESCAPE key as a way to close the window/dialog.

Fixes OSGeo#785
@neteler neteler added this to the 8.0.0 milestone Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants