After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 612505 - Entry layout not updated when underlying buffer changes
Entry layout not updated when underlying buffer changes
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkEntry
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-03-10 21:45 UTC by Tristan Van Berkom
Modified: 2010-03-14 20:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to update entry layout and visual state at buffer change time (407 bytes, patch)
2010-03-10 21:45 UTC, Tristan Van Berkom
none Details | Review
Saner patch to nullify buffer in dispose (1.52 KB, patch)
2010-03-13 21:35 UTC, Tristan Van Berkom
committed Details | Review

Description Tristan Van Berkom 2010-03-10 21:45:08 UTC
Created attachment 155790 [details] [review]
Patch to update entry layout and visual state at buffer change time

Im attaching a short patch that fixes this problem.

It also includes resetting the cursor position in _set_buffer(),
since without that we get an assertion while calling pango_layout_get_cursor_pos()
(i.e. the cursor is skewed into the old buffer space and needs resetting).

Currently it sets the cursor position to 0.

but it could hypothetically be set to:
    cursor = MIN (cursor, new_buffer_length)
instead... I think 0 is sane though....
Comment 1 Matthias Clasen 2010-03-12 21:10:50 UTC
Thanks, fixed
Comment 2 Tristan Van Berkom 2010-03-13 21:35:29 UTC
Created attachment 156076 [details] [review]
Saner patch to nullify buffer in dispose

This one:
  a.) Updates the display when the buffer is set to NULL
  b.) Breaks the reference to the buffer in dispose instead of finalize
Comment 3 Tristan Van Berkom 2010-03-13 21:35:55 UTC
Reopening...
Comment 4 Matthias Clasen 2010-03-14 00:22:05 UTC
Looks ok, assuming the tests work.
Comment 5 Tristan Van Berkom 2010-03-14 20:36:36 UTC
Review of attachment 156076 [details] [review]:

Thanks, committing and closing bug.