Skip to content

imwayland: Include surrounding text in the atomic update after hanling a done

dcz requested to merge dcz/gtk:commit into gtk-3-24

Without it, some properties were updated correctly, and some (surrounding text) were updated together with the next batch due to not being followedby an immediate commit.

Before:

[153745.233] zwp_text_input_v3@35.commit_string("aa")
[153745.320] zwp_text_input_v3@35.done(1)
[153745.647]  -> zwp_text_input_v3@35.set_cursor_rectangle(125, 62, 0, 30)
[153745.808]  -> zwp_text_input_v3@35.commit() // premature commit but ok
[153745.877]  -> zwp_text_input_v3@35.set_surrounding_text("aa", 2, 2)
[153745.992]  -> zwp_text_input_v3@35.set_text_change_cause(0)
----- here should be a commit

After:

[ 26738.498] zwp_text_input_v3@35.commit_string("e")
[ 26738.533] zwp_text_input_v3@35.done(4)
[ 26738.792]  -> zwp_text_input_v3@35.set_cursor_rectangle(45, 36, 0, 420)
[ 26738.838]  -> zwp_text_input_v3@35.set_surrounding_text("wwe", 3, 3)
[ 26738.854]  -> zwp_text_input_v3@35.set_text_change_cause(0)
[ 26738.943]  -> zwp_text_input_v3@35.commit()

I achieved this by having a flag that encompasses the "atomic" part, which seems inelegant, but I'm not sure how to make it more idiomatic within GObject.

Merge request reports