GMC needs help with search dialog


I'm currently working on preparing the next release of GNU Midnight
Commander.  It may be the last release suporting the GNOME frontend
(further referred to as GMC), so it's important to get it right.

It is shame that the GMC doesn't have a functional file search.  I have
made some fixes to the "Find File" dialog, but I have no time to improve
it beyond bugfixing.  There is one important bug in that dialog that I
would like to have fixed before the next release.

GMC uses Gtk idle handler for the search.  The handler scans files for
data (or just checks their names) and shows its status by changing text on
a label (file gnome/gfind.c, function status_update).  Something is wrong
with changing the label from the idle handler, because after some time GMC
starts printing messages like:

Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget
with width 65316 and height 1

If I interrupt search by pressing Escape, I'm getting another message:

Gtk-WARNING **: invalid cast from `(unknown)' to `GtkLabel'

Gtk-CRITICAL **: file gtklabel.c: line 261 (gtk_label_set_text): assertion
`GTK_IS_LABEL (label)' failed.

It looks like that in this case gtk_label_set_text() is called after the
dialog has been destroyed.

It seems logical that changing the label should only be done while some
kind of lock is held, so that the dialog doesn't go away in the meantime.

Unfortunalely, the Gtk documentation is less than helpful (maybe I didn't
look in the right place).

Anybody with minimal knowledge of GNOME programming should be able to fix
this bug.  Please use the CVS version or the snapshot made by "make dist"
from, since the "Find File" dialog has
been heavily modified (this problem can be reproduced in mc-4.5.54, but
the code is in a different file and static widgets have been made part of
a structure).

How to reproduce:
1) Invoke "Commands"->"Find File" from the menu.
2) Search from "/", mask "*", contents "".

Thank you in advance!

Pavel Roskin

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]