-
Notifications
You must be signed in to change notification settings - Fork 844
Bug 799538 - Clipboard pastes to wrong field in... #2095
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
base: stable
Are you sure you want to change the base?
Conversation
Fixed Cut, Copy and Paste when focus is not in GnucashSheet.
if (strcmp(name, "GnucashSheet") != 0) { | ||
gtk_editable_cut_clipboard( GTK_EDITABLE(widget)); | ||
|
||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ENTER at the start of the function is followed by LEAVE when you leave the function so you need to add some thing like LEAVE("Not cut from GnucashSheet"); above the return. Also the opening brace is on the wrong line and the indent should be 4 spaces.
This applies to all three functions.
I had a look at this bug and got side tracked so have tested your fix. It is an improvement but there was one thing I found when testing as follows... This is when I ran out of time so did not identify the reason. |
Added LEAVE before return.
I can repeat the bug, but I think it's a different one. When you click on the same field as above in the scheduled editor sheet after going to title, the title doesn't lose focus. You need to press TAB or double-click the scheduled editor sheet field for the title to lose focus. |
Right. This is directly observable: The I-beam cursor remains in the title field. Interestingly clicking in a different field in the register does move the focus. |
After investigating, I found that the scheduled editor sheet loses focus, but not the box indicating that it is being edited. If it doesn't have focus and you click on the box editing, it doesn't gain focus, but if you click on the same field, but in the small space outside the box editing, it does gain focus. The problem I'm having is that I don't know how to get the sheet variable to gain focus every time the "Template Transaction" tab is clicked or run gnucash_sheet_deactivate_cursor_cell(reg->sheet);. If I run gtk_widget_grab_focus(GTK_WIDGET(sxed->embed_window)); or gtk_widget_grab_focus(GTK_WIDGET(sxed->nameEntry)); every time the "Template Transaction" tab is clicked, it does nothing. The "Duplicate" button always has focus. But to test if it works, I run gtk_widget_set_margin_top (GTK_WIDGET(sxed->embed_window), 500); and it does. If you press the TAB key when entering the "Template Transaction" tab Any ideas on how to fix this bug? |
I dug through my saved working on patches and came across one that was looking into the gnucash-item-edit.c line 892
Changing this to TRUE seems to sort of fix this but I can not remember why it was set that way. |
@Bob-IT That line is from 1ed4f3d. In the commit message you wrote
So is the paste supposed to go to the sheet and the sheet figures out what frame to put it into? |
I think the focus can be fixed by adding this to the end of the existing
When the title entry is focused at the top of the dialog, the sheet focus out event is triggered which then triggers a focus out event for the item_edit. Possibly as that can not have focus, it upsets the events. When you click back in the same cell, there is no sheet in focus event so this change makes sure there is. |
Now when the ledger loses focus, turns off editing controls. And when the ledger regains focus, turns on editing controls. Now, when the user clicks on the "Scheduled Transactions" tab, the focus goes to the last edited cell.
LGTM. @Bob-IT ? |
To start with you do not need the I am not sure why there is a need for the
|
@Bob-IT Do you mean Action / Transfer...? On my PC it works. Could you be more specific about why does not work? Sorry, I forgot to delete IdleType. I used before because I needed to pass two parameters. |
Fixed Cut, Copy and Paste when focus is not in GnucashSheet.