Incorrect scroll when pasting in multiple views



Folks,

The following patch seems wrong to me:

commit 1a7c0ed0996997fc45cbd71ea4eb6809b11ed89f
Author: Paolo Borelli <pborelli katamail com>
Date:   Mon Jan 12 17:07:35 2009 +0000

    Bug 492794 – Pasting external text at end of view yields wrong scrolling

    2009-01-12  Paolo Borelli  <pborelli katamail com>

        Bug 492794 – Pasting external text at end of view yields wrong
        scrolling to mark

        * gtk/gtktextbuffer.[ch]:
        * gtk/gtktextview.c:
        Add a "paste-done" signal and use it to propelry scroll the
        view at the end of the pasted text in the case of an async
        paste. Patch by Ignacio Casal Quintero based on a patch by
        Yevgen Muntyan.


What happens is the following:

If you have multiple views of the same file side by side, and paste (through
gtk_text_buffer_paste_clipboard) text in one of them, the buffer emits the
signal "paste-done". As a result, gtk_text_view_paste_done_handler will
unconditionally scroll the view to make the cursor visible. The effect is that
the second view is also scrolled to show the cursor, which is unexpected.

I think we should modify gtk_text_view_paste_done_handler so that it does not
scroll if the cursor is currently invisible in the view (which is the case since
the second view had a focus_out event at some point in time previously).

regards,

Emmanuel


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]