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 107889 - gtk-demo segfaults when Ctrl-A is pressed in source browser window
gtk-demo segfaults when Ctrl-A is pressed in source browser window
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
2.2.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 111411 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-03-08 23:15 UTC by Doug Quale
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (3.15 KB, patch)
2003-03-09 20:27 UTC, Matthias Clasen
none Details | Review
gtk-demo crash backtrace (178.56 KB, text/plain)
2003-03-10 05:43 UTC, Doug Quale
  Details

Description Doug Quale 2003-03-08 23:15:43 UTC
Also crashes in garnome-0.21.2. Running gtk-demo, picking the Source tab
and pressing Ctrl-A dumps core.
Comment 1 Matthias Clasen 2003-03-09 20:03:44 UTC
Hmm, I don't see the crash on the stable branch; it probably got fixed
by the following commit:

2003-02-14  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktextview.c (popup_targets_received): Remove bogus
	GTK_OBJECT cast. Hopefully got it right now...
	(gtk_text_view_move_cursor_internal): Add a default: to avoid
	compiler warnings.

But even if it doesn't crash, C-a is not working if the cursor is not
visible. This got broken by my changes to switch move_cursor_internal
to viewport-based movements when the cursor is not visible. I guess
the right fix is to introduce a separate binding signal for select_all.
Comment 2 Matthias Clasen 2003-03-09 20:27:25 UTC
Created attachment 14875 [details] [review]
patch
Comment 3 Matthias Clasen 2003-03-09 20:29:04 UTC
Here is a patch for 2.2. For head, it will have to be combined with
the viewport-movement patch for 2.4, which is attached to bug 78669.
Comment 4 Doug Quale 2003-03-10 05:43:17 UTC
Created attachment 14884 [details]
gtk-demo crash backtrace
Comment 5 Doug Quale 2003-03-10 05:48:37 UTC
I have attached a backtrace in case that might be useful.
Comment 6 Matthias Clasen 2003-03-11 11:53:04 UTC
I'd like to get this fix into 2.2.2 to avoid the regression on C-a.
What do you think, 
Havoc ?
Comment 7 Owen Taylor 2003-03-28 22:28:08 UTC
It's not clear to me what the above has to do with the crash...

But as for not working, well, it makes me a bit sad to
see the "elegant" approach of composing select-all out
of multiple primitive operations, but yeah, this change
is probably right.

I don't see any problem with adding a new binding signal
for 2.2.2.

The "select" parameter, however confuses me:

 What's the meaning of this parameter?
 If select all from the menu or from the keyboard has
  different effects on the primary selection, that's
  broken.
 I doubt the explicit call to gtk_text_buffer_copy_clipboard()
  in select_all_cb was needed, since change the selection
  should automatically update the primary selection.
 You probably can use append_action_signal() for select_all
  with this change if the select paramter isn't needed?. 
 (No big win, but increases consistency of the code a bit.)
  of the code a bit?)
Comment 8 Matthias Clasen 2003-03-30 23:09:13 UTC
The crash was caused by a missing default: clause which I added on
2003-02-14. The patch we're discussing here has nothing to do with the
crash; it is about restoring the functionality of C-a in invisible
cursor mode.
The "select" parameter is about select-all vs. unselect-all. Note that
gtk_text_view_select_all (..., FALSE) is used for C-\
Comment 9 Matthias Clasen 2003-04-23 08:49:02 UTC
*** Bug 111411 has been marked as a duplicate of this bug. ***
Comment 10 Owen Taylor 2003-06-05 16:19:56 UTC
A bit weird to have a 'select-all' callback be able to
also unselect-all, but not completely ridiculous.

The patch looks OK to me, though my comment about
gtk_text_buffer_copy_clipboard() still stands.
Comment 11 Matthias Clasen 2003-06-05 19:24:19 UTC
You were right, the copy_clipboard call was unnecessary. Committed to
both branches.