mirror of
https://github.com/brl/mutter.git
synced 2024-11-09 23:46:33 -05:00
clutter/text: Emit cursor-changed right after setting cursor position
ClutterText has a bit of a mess around its signalling of changes to the cursor position: There's the position (deprecated) and cursor-position property, and there's the cursor-changed and cursor-event (deprecated) signal. The two properties are supposed to be notified when the cursor position changes, and the two signals are notified when the cursor position or size changes. Now the properties notifications and the signals get fired in two very different places: The two properties are notified in clutter_text_set_cursor_position(), while the signals are fired during the paint cycle when we figured out the final cursor position. The latter is a pretty bad idea, nobody expects such a signal to be fired during painting, and also changes to the text that are done in the signal handler will only be applied on the next paint. Now StEntry listens to cursor position changes via cursor-changed and invalidates its text shadow, but since the signal is only notified during the paint, the old text shadow will still get applied. To fix this, also emit the cursor-changed signal when we notify the cursor-position property. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1757>
This commit is contained in:
parent
a6df6796dd
commit
ef1f65a013
@ -1416,6 +1416,7 @@ clutter_text_delete_selection (ClutterText *self)
|
||||
/* XXX:2.0 - remove */
|
||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_POSITION]);
|
||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_CURSOR_POSITION]);
|
||||
g_signal_emit (self, text_signals[CURSOR_CHANGED], 0);
|
||||
}
|
||||
|
||||
if (priv->selection_bound != old_selection)
|
||||
@ -6259,6 +6260,7 @@ clutter_text_set_cursor_position (ClutterText *self,
|
||||
/* XXX:2.0 - remove */
|
||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_POSITION]);
|
||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_CURSOR_POSITION]);
|
||||
g_signal_emit (self, text_signals[CURSOR_CHANGED], 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user