gEDA-dev: Escape key in compselect window
Ivan Stankovic
ivan.stankovic at fer.hr
Sat Jul 7 08:47:54 EDT 2007
On Sat, Jul 07, 2007 at 01:17:10AM +0200, Carlos Nieves Ónega wrote:
> Hi,
> some time ago I was able to close the compselect window just hitting Esc
> key. Now I can't do it that way anymore.
>
> I think this was due to Ivan's patch removing code handling escape key
> in dialogs (since this is already done by GtkDialog):
> http://git.gpleda.org/?p=gaf.git;a=blobdiff;f=gschem/src/x_compselect.c;h=bfce626366f8be467803412c30198c883a0aa75b;hp=ccf9e4b5bf6d8dada25db4e67fa92f55b812a63f;hb=7067e71ef1558ceb94772a703cde1463233460fe;hpb=2a2fa60eee536f48cc27c16f2577106e78250ed6
>
> It seems this is not working for compselect window, so I'm thinking
> about reverting this change (only in x_compselect.c , of course).
>
> Ivan, any thoughts?
This has nothing to do with escape handling code, it seems. The
problem appears to be the call to gtk_widget_grab_focus()
when initializing component selector dialog. GTK is confused
when we try to set the focus to the filter widget, but the
currently displayed tab is the "In Use" tab.
Commenting out the offending line fixes the problem for me (see the
patch below). We should probably remember which tab was last
displayed in the dialog and then set the focus accordingly.
diff --git a/gschem/src/x_compselect.c b/gschem/src/x_compselect.c
index 296c6ca..e1e309a 100644
--- a/gschem/src/x_compselect.c
+++ b/gschem/src/x_compselect.c
@@ -203,7 +203,7 @@ x_compselect_open (TOPLEVEL *toplevel)
gtk_window_present (GTK_WINDOW(toplevel->cswindow));
}
gtk_editable_select_region(GTK_EDITABLE(COMPSELECT(toplevel->cswindow)->entry_filter), 0, -1);
- gtk_widget_grab_focus (GTK_WIDGET(COMPSELECT(toplevel->cswindow)->entry_filter));
+ /* gtk_widget_grab_focus (GTK_WIDGET(COMPSELECT(toplevel->cswindow)->entry_filter)); */
}
/*! \brief Closes the component selection dialog.
--
Ivan Stankovic, ivan.stankovic at fer.hr
"Protect your digital freedom and privacy, eliminate DRM,
learn more at http://www.defectivebydesign.org/what_is_drm"
More information about the geda-dev
mailing list