GNOME Bugzilla – Bug 668446
Adding annotation: No input possible until some focus change
Last modified: 2013-11-02 15:54:17 UTC
Originally reported in the Ubuntu bug tracker by Gerd Bavendiek: https://bugs.launchpad.net/ubuntu/+source/evince/+bug/919965 "Adding a new annotion in evince (Oneiric) no input is possible until one switches focus from the input window to the document window and back again. Initially the cursor of the annotation input box is blinking, but no input is possible." I can reproduce the problem (except for the fact that I do not get any blinking cursor in the beginning) under Ubuntu Precise (evince 3.2.1) and in Fedora 16. Maybe an unintended side effect of the fix for Bug #623829?
I have the same issue. certain keys like "n" actually move me away from the annotation window. This is a big efficiency problem when trying to annotate many documents quickly.
I can confirm with evince 3.6.1 and poppler 0.20.5-1ubuntu2
Created attachment 236900 [details] [review] Fix for annotation focus issue
Previous comment contains a patch for this issue, tested against 3.4.0-0ubuntu1.4 from Ubuntu 12.04 (Precise). Should work for newer versions, too.
Created attachment 245425 [details] [review] [PATCH] Fix focus on ev_annotation_window libview/ev-annotation-window.c | 21 --------------------- 1 file changed, 21 deletions(-)
This is like Florian's patch, but it also deletes the notify_enter and notify_leave functions that are not needed anymore... (and we are not getting the events across windows btw)
Thanks for the patch, José - works for me. Would it be possible to tweak it so that the annotation window has focus immediately after creation? As it is now, I still have to click into the annotation once before I can type.
Comment on attachment 245425 [details] [review] [PATCH] Fix focus on ev_annotation_window Great! another patch that fixes a bug just by removing code :-) Pushed to git master, thank you both!
I am re-opening the bug as per c#7. Also, I have to click in different places before I can enter any text in the annotation window.
(In reply to comment #9) > I am re-opening the bug as per c#7. Also, I have to click in different places > before I can enter any text in the annotation window. Comment c#7 still holds regarding to the focus. Forget the remaining, I was trying the wrong branch :-P
Created attachment 249404 [details] [review] Experimental patch for the focusing problem I prepared a working patch for the focusing problem but some points are not clear to me. The function showing the annotation popup window is ev_view_annotation_show_popup_window. So, I added: ev_annotation_window_grab_focus (EV_ANNOTATION_WINDOW(window)); call to the end of this function but I didn't work. Then I had to modify it so that it works for both focusing upon the initial creation of annotation window and focusing upon opening a closed annotation. Other issue is that why are gtk_widget_grab_focus and gtk_widget_send_focus_change used together? I couldn't understand the purpose of using gtk_widget_send_focus_change. Instead of gtk_widget_grab_focus (GTK_WIDGET (window)); send_focus_change (window, TRUE); why don't we use only send_focus_change (window->text_view, TRUE); and directly focus on the text_view?
Created attachment 251569 [details] [review] Fix for bug This patch fixes focusing the text entry after creating or selecting annotation, I also included code to hide the text cursor when the annot window is unfocused(backdrop state) to not give the user the false appearance he can enter text when he really can't (the window is unfocused).
Created attachment 251570 [details] Screencast of after patch behaviour This is a small screencast showing the patch behaviour.
Carlos, Please review Nelson's patch in #12. This could land on 3.10. Otherwise, annotations could become annoying.
Review of attachment 251569 [details] [review]: Thanks for the patch!. I've made a few minor changed and pushed to both branches. ::: libview/ev-annotation-window.c @@ +264,2 @@ { + GtkStateFlags cflags = gtk_widget_get_state_flags (widget); I'm not sure what sflags and cflags mean, I guess c stands for current. I have renamed them as previous_flags and current_flags to make it clearer.