gEDA-dev: Patch to fix file-choosers after closing save dialog with "Escape"

Peter Clifton pcjc2 at cam.ac.uk
Tue Sep 5 13:05:35 EDT 2006


On Tue, 2006-09-05 at 17:57 +0100, Peter Clifton wrote:
> Attached is a patch against CVS HEAD (before my other two patches to
> x_fileselect.c), which fixes a bug where the file-choosers fail to work
> after closing a file-saveas chooser with the "Escape" key.
> 
> When you close a file-chooser with "Escape", the
> GTK_RESPONSE_DELETE_EVENT signal was being sent (which is odd, since
> from reading the GTK+ sourcecode, I expected it to be sending the
> default GTK_RESPONSE_CANCEL event). This wasn't caught in the response
> code switch statement.
> 
> I've added a default catch to the switch statement which handles the
> saveas choosers, so that any unidentified return code will act as
> "Cancel". I left the "case GTK_RESPONSE_CANCEL:" and added a "case
> GTK_RESPONSE_DELETE_EVENT:" for clarity.
> 
> The file-open chooser catches unknown response codes with an "else".
> 
> Regards
> 
> Peter Clifton

Just noticed that I'd left a TODO in that... sorry.

The gtk file choosers don't appear to return with an empty filename, so
the "else" should never get executed, but still... if by some means it
did, we need to call x_fileselect_close( NULL, f_current ).

See latest patch attached.

Peter C.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cvs_geda.save_escape_bug.patch
Type: text/x-patch
Size: 1315 bytes
Desc: not available
Url : http://www.seul.org/pipermail/geda-dev/attachments/20060905/7334c57e/cvs_geda.save_escape_bug.bin


More information about the geda-dev mailing list