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 643328 - "editing-canceled" signal not emitted when focusing out
"editing-canceled" signal not emitted when focusing out
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
: 642039 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-02-25 19:33 UTC by Cosimo Cecchi
Modified: 2018-02-10 03:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Cosimo Cecchi 2011-02-25 19:33:49 UTC
This appears to be a regression from GTK+ 2.x

If you are editing e.g. a GtkCellRendererText, and you dismiss editing just with clicking in another area of the treeview (i.e. moving the focus out of the renderer entry), you won't get any signal.
There's code in GtkCellRendererText to handle this (see gtk_cell_renderer_text_focus_out_event()), but AFAICS what happens is:

- gtk_tree_view_button_press() calls gtk_tree_view_stop_editing (cancel_editing = FALSE) first thing
- that in turns calls gtk_cell_area_stop_editing (cancel_editing = FALSE)
- that calls gtk_cell_renderer_stop_editing (canceled = FALSE)
- gtk_cell_renderer_stop_editing() does this

  if (priv->editing)
    {
      priv->editing = FALSE;
      if (canceled)
	g_signal_emit (cell, cell_renderer_signals[EDITING_CANCELED], 0);
    }

resetting this way its 'editing' property [1].

- later on, from gtk_tree_view_button_press(), the focus-out handler of the renderer is called
- the focus-out handler will call gtk_cell_renderer_stop_editing (canceled = TRUE), which will not emit the signal because priv->editing is FALSE already.

[1] the fact that it does so directly without calling g_object_notify() for the property might be considered as another separate bug.
Comment 1 Cosimo Cecchi 2011-02-25 19:34:50 UTC
Note that I'm not at all sure how to best fix this, as the code is very convoluted between GtkCellArea, GtkTreeView and GtkCellRenderer, and I don't know all the assumptions those functions are run under.
Comment 2 Cosimo Cecchi 2011-02-25 19:36:18 UTC
*** Bug 642039 has been marked as a duplicate of this bug. ***
Comment 3 Murray Cumming 2011-06-23 22:52:10 UTC
Bug #653289 might be related.
Comment 4 Krzesimir Nowak 2011-09-05 09:35:23 UTC
You should receive "edited" signal when focusing out from GtkCellRendererText by clicking on other area of the treeview. To get "editing-canceled" signal you for example press ESC.

Please try a patch I attached in bug #653289:
https://bugzilla.gnome.org/attachment.cgi?id=195377&action=edit
Comment 5 Murray Cumming 2011-10-05 09:22:47 UTC
Cosimo, is this still an issue even with the fix that was pushed as part of bug #653289 ?
Comment 6 Matthias Clasen 2018-02-10 03:27:08 UTC
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and
still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue
for it.