implement GtkWidget::hide() and set the the focus widget to NULL, so a
2006-01-07 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpdialog.c: implement GtkWidget::hide() and set the the focus widget to NULL, so a focussed entry emits focus_out and its callbacks are invoked immediately (before the call to gtk_widget_hide() returns). Fixes crashes and warnings in tool dialogs when hitting escape while a spinbutton is being edited. * app/tools/gimptransformtool.c (gimp_transform_tool_force_expose_preview): return silently instead of warning when being called while the draw tool is not active (same scenario as above).
This commit is contained in:
parent
c2b2573550
commit
55cc42339b
3 changed files with 30 additions and 1 deletions
13
ChangeLog
13
ChangeLog
|
|
@ -1,3 +1,16 @@
|
|||
2006-01-07 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* libgimpwidgets/gimpdialog.c: implement GtkWidget::hide() and set
|
||||
the the focus widget to NULL, so a focussed entry emits focus_out
|
||||
and its callbacks are invoked immediately (before the call to
|
||||
gtk_widget_hide() returns). Fixes crashes and warnings in tool
|
||||
dialogs when hitting escape while a spinbutton is being edited.
|
||||
|
||||
* app/tools/gimptransformtool.c
|
||||
(gimp_transform_tool_force_expose_preview): return silently
|
||||
instead of warning when being called while the draw tool is not
|
||||
active (same scenario as above).
|
||||
|
||||
2006-01-07 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/base/siox.c: applied patch from Tobias Lenz that plugs a
|
||||
|
|
|
|||
|
|
@ -1144,7 +1144,12 @@ gimp_transform_tool_force_expose_preview (GimpTransformTool *tr_tool)
|
|||
if (! tr_tool->use_grid)
|
||||
return;
|
||||
|
||||
g_return_if_fail (gimp_draw_tool_is_active (GIMP_DRAW_TOOL (tr_tool)));
|
||||
/* we might be called as the result of cancelling the transform
|
||||
* tool dialog, return silently because the draw tool may have
|
||||
* already been stopped by gimp_transform_tool_halt()
|
||||
*/
|
||||
if (! gimp_draw_tool_is_active (GIMP_DRAW_TOOL (tr_tool)))
|
||||
return;
|
||||
|
||||
shell = GIMP_DISPLAY_SHELL (GIMP_DRAW_TOOL (tr_tool)->gdisp->shell);
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ static void gimp_dialog_get_property (GObject *object,
|
|||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
static void gimp_dialog_hide (GtkWidget *widget);
|
||||
static gboolean gimp_dialog_delete_event (GtkWidget *widget,
|
||||
GdkEventAny *event);
|
||||
static void gimp_dialog_close (GtkDialog *dialog);
|
||||
|
|
@ -79,6 +80,7 @@ gimp_dialog_class_init (GimpDialogClass *klass)
|
|||
object_class->set_property = gimp_dialog_set_property;
|
||||
object_class->get_property = gimp_dialog_get_property;
|
||||
|
||||
widget_class->hide = gimp_dialog_hide;
|
||||
widget_class->delete_event = gimp_dialog_delete_event;
|
||||
|
||||
dialog_class->close = gimp_dialog_close;
|
||||
|
|
@ -217,6 +219,15 @@ gimp_dialog_get_property (GObject *object,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_dialog_hide (GtkWidget *widget)
|
||||
{
|
||||
/* set focus to NULL so focus_out callbacks are invoked synchronously */
|
||||
gtk_window_set_focus (GTK_WINDOW (widget), NULL);
|
||||
|
||||
GTK_WIDGET_CLASS (parent_class)->hide (widget);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_dialog_delete_event (GtkWidget *widget,
|
||||
GdkEventAny *event)
|
||||
|
|
|
|||
Loading…
Reference in a new issue