From 73d258eb3d5f9be3fa8d18bc5470171824c31d32 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 21 Jan 2004 11:16:57 +0000 Subject: [PATCH] renamed info_dialog_popdown() to info_dialog_hide() and 2004-01-21 Michael Natterer * app/gui/info-dialog.[ch]: renamed info_dialog_popdown() to info_dialog_hide() and info_dialog_popup() to info_dialog_present(). Added info_dialog_show() which just shows the dialog without calling gtk_window_present(). * app/gui/info-window.c * app/gui/view-commands.c * app/tools/gimptransformtool.c: changed accordingly. * app/tools/gimpcroptool.c * app/tools/gimpperspectivetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c: use info_dialog_show() so the dialog doesn't grab the focus away from the canvas. Fixes bug #132041. --- ChangeLog | 18 ++++++++++++++++++ app/actions/view-commands.c | 2 +- app/dialogs/info-dialog.c | 15 +++++++++++++-- app/dialogs/info-dialog.h | 5 +++-- app/dialogs/info-window.c | 4 ++-- app/gui/info-dialog.c | 15 +++++++++++++-- app/gui/info-dialog.h | 5 +++-- app/gui/info-window.c | 4 ++-- app/gui/view-commands.c | 2 +- app/tools/gimpcroptool.c | 4 ++-- app/tools/gimpperspectivetool.c | 2 +- app/tools/gimprotatetool.c | 2 +- app/tools/gimpscaletool.c | 2 +- app/tools/gimpsheartool.c | 2 +- app/tools/gimptransformtool.c | 2 +- 15 files changed, 63 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1346e9841f..fbbe76d08e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2004-01-21 Michael Natterer + + * app/gui/info-dialog.[ch]: renamed info_dialog_popdown() to + info_dialog_hide() and info_dialog_popup() to info_dialog_present(). + Added info_dialog_show() which just shows the dialog without + calling gtk_window_present(). + + * app/gui/info-window.c + * app/gui/view-commands.c + * app/tools/gimptransformtool.c: changed accordingly. + + * app/tools/gimpcroptool.c + * app/tools/gimpperspectivetool.c + * app/tools/gimprotatetool.c + * app/tools/gimpscaletool.c + * app/tools/gimpsheartool.c: use info_dialog_show() so the dialog + doesn't grab the focus away from the canvas. Fixes bug #132041. + 2004-01-21 Simon Budig * app/core/gimpscanconvert.c: removed the call to diff --git a/app/actions/view-commands.c b/app/actions/view-commands.c index 1b789f673e..3624b74a57 100644 --- a/app/actions/view-commands.c +++ b/app/actions/view-commands.c @@ -173,7 +173,7 @@ view_info_window_cmd_callback (GtkWidget *widget, if (! shell->info_dialog) shell->info_dialog = info_window_create (gdisp); - info_dialog_popup (shell->info_dialog); + info_dialog_present (shell->info_dialog); } else { diff --git a/app/dialogs/info-dialog.c b/app/dialogs/info-dialog.c index 02f231c9af..2ad3ca626a 100644 --- a/app/dialogs/info-dialog.c +++ b/app/dialogs/info-dialog.c @@ -106,7 +106,18 @@ info_dialog_free (InfoDialog *idialog) } void -info_dialog_popup (InfoDialog *idialog) +info_dialog_show (InfoDialog *idialog) +{ + g_return_if_fail (idialog != NULL); + + if (GTK_WIDGET_VISIBLE (idialog->shell)) + gdk_window_show (idialog->shell->window); + else + gtk_widget_show (idialog->shell); +} + +void +info_dialog_present (InfoDialog *idialog) { g_return_if_fail (idialog != NULL); @@ -114,7 +125,7 @@ info_dialog_popup (InfoDialog *idialog) } void -info_dialog_popdown (InfoDialog *idialog) +info_dialog_hide (InfoDialog *idialog) { g_return_if_fail (idialog != NULL); diff --git a/app/dialogs/info-dialog.h b/app/dialogs/info-dialog.h index a20eaf2320..e3aade90fd 100644 --- a/app/dialogs/info-dialog.h +++ b/app/dialogs/info-dialog.h @@ -75,8 +75,9 @@ InfoDialog *info_dialog_notebook_new (GimpViewable *viewable, gpointer help_data); void info_dialog_free (InfoDialog *idialog); -void info_dialog_popup (InfoDialog *idialog); -void info_dialog_popdown (InfoDialog *idialog); +void info_dialog_show (InfoDialog *idialog); +void info_dialog_present (InfoDialog *idialog); +void info_dialog_hide (InfoDialog *idialog); void info_dialog_update (InfoDialog *idialog); diff --git a/app/dialogs/info-window.c b/app/dialogs/info-window.c index eb4b7319c0..a5bf69a025 100644 --- a/app/dialogs/info-window.c +++ b/app/dialogs/info-window.c @@ -95,7 +95,7 @@ info_window_response (GtkWidget *widget, gint response_id, InfoDialog *info_win) { - info_dialog_popdown (info_win); + info_dialog_hide (info_win); } static void @@ -331,7 +331,7 @@ info_window_follow_auto (Gimp *gimp) info_window_update (gdisp); } - info_dialog_popup (info_window_auto); + info_dialog_present (info_window_auto); } diff --git a/app/gui/info-dialog.c b/app/gui/info-dialog.c index 02f231c9af..2ad3ca626a 100644 --- a/app/gui/info-dialog.c +++ b/app/gui/info-dialog.c @@ -106,7 +106,18 @@ info_dialog_free (InfoDialog *idialog) } void -info_dialog_popup (InfoDialog *idialog) +info_dialog_show (InfoDialog *idialog) +{ + g_return_if_fail (idialog != NULL); + + if (GTK_WIDGET_VISIBLE (idialog->shell)) + gdk_window_show (idialog->shell->window); + else + gtk_widget_show (idialog->shell); +} + +void +info_dialog_present (InfoDialog *idialog) { g_return_if_fail (idialog != NULL); @@ -114,7 +125,7 @@ info_dialog_popup (InfoDialog *idialog) } void -info_dialog_popdown (InfoDialog *idialog) +info_dialog_hide (InfoDialog *idialog) { g_return_if_fail (idialog != NULL); diff --git a/app/gui/info-dialog.h b/app/gui/info-dialog.h index a20eaf2320..e3aade90fd 100644 --- a/app/gui/info-dialog.h +++ b/app/gui/info-dialog.h @@ -75,8 +75,9 @@ InfoDialog *info_dialog_notebook_new (GimpViewable *viewable, gpointer help_data); void info_dialog_free (InfoDialog *idialog); -void info_dialog_popup (InfoDialog *idialog); -void info_dialog_popdown (InfoDialog *idialog); +void info_dialog_show (InfoDialog *idialog); +void info_dialog_present (InfoDialog *idialog); +void info_dialog_hide (InfoDialog *idialog); void info_dialog_update (InfoDialog *idialog); diff --git a/app/gui/info-window.c b/app/gui/info-window.c index eb4b7319c0..a5bf69a025 100644 --- a/app/gui/info-window.c +++ b/app/gui/info-window.c @@ -95,7 +95,7 @@ info_window_response (GtkWidget *widget, gint response_id, InfoDialog *info_win) { - info_dialog_popdown (info_win); + info_dialog_hide (info_win); } static void @@ -331,7 +331,7 @@ info_window_follow_auto (Gimp *gimp) info_window_update (gdisp); } - info_dialog_popup (info_window_auto); + info_dialog_present (info_window_auto); } diff --git a/app/gui/view-commands.c b/app/gui/view-commands.c index 1b789f673e..3624b74a57 100644 --- a/app/gui/view-commands.c +++ b/app/gui/view-commands.c @@ -173,7 +173,7 @@ view_info_window_cmd_callback (GtkWidget *widget, if (! shell->info_dialog) shell->info_dialog = info_window_create (gdisp); - info_dialog_popup (shell->info_dialog); + info_dialog_present (shell->info_dialog); } else { diff --git a/app/tools/gimpcroptool.c b/app/tools/gimpcroptool.c index 9398251926..29b96e9e6e 100644 --- a/app/tools/gimpcroptool.c +++ b/app/tools/gimpcroptool.c @@ -1055,7 +1055,7 @@ crop_info_update (GimpCropTool *crop) crop->size_vals[1] = crop->y2 - crop->y1; info_dialog_update (crop->crop_info); - info_dialog_popup (crop->crop_info); + info_dialog_show (crop->crop_info); } static void @@ -1070,7 +1070,7 @@ crop_response (GtkWidget *widget, options = GIMP_CROP_OPTIONS (tool->tool_info->tool_options); if (crop->crop_info) - info_dialog_popdown (crop->crop_info); + info_dialog_hide (crop->crop_info); switch (response_id) { diff --git a/app/tools/gimpperspectivetool.c b/app/tools/gimpperspectivetool.c index 0e395346fd..4737378000 100644 --- a/app/tools/gimpperspectivetool.c +++ b/app/tools/gimpperspectivetool.c @@ -254,5 +254,5 @@ perspective_info_update (GimpTransformTool *tr_tool) } info_dialog_update (tr_tool->info_dialog); - info_dialog_popup (tr_tool->info_dialog); + info_dialog_show (tr_tool->info_dialog); } diff --git a/app/tools/gimprotatetool.c b/app/tools/gimprotatetool.c index fb4bbf98b5..25f729d04c 100644 --- a/app/tools/gimprotatetool.c +++ b/app/tools/gimprotatetool.c @@ -356,7 +356,7 @@ rotate_info_update (GimpTransformTool *tr_tool) center_vals[1] = tr_tool->trans_info[CENTER_Y]; info_dialog_update (tr_tool->info_dialog); - info_dialog_popup (tr_tool->info_dialog); + info_dialog_show (tr_tool->info_dialog); } static void diff --git a/app/tools/gimpscaletool.c b/app/tools/gimpscaletool.c index eddb5e1826..5ccb3fc160 100644 --- a/app/tools/gimpscaletool.c +++ b/app/tools/gimpscaletool.c @@ -471,7 +471,7 @@ gimp_scale_tool_info_update (GimpTransformTool *tr_tool) g_snprintf (y_ratio_buf, sizeof (y_ratio_buf), "%0.2f", ratio_y); info_dialog_update (tr_tool->info_dialog); - info_dialog_popup (tr_tool->info_dialog); + info_dialog_show (tr_tool->info_dialog); } static void diff --git a/app/tools/gimpsheartool.c b/app/tools/gimpsheartool.c index 9d8a2cf5fe..3700b47587 100644 --- a/app/tools/gimpsheartool.c +++ b/app/tools/gimpsheartool.c @@ -299,7 +299,7 @@ shear_info_update (GimpTransformTool *tr_tool) yshear_val = tr_tool->trans_info[YSHEAR]; info_dialog_update (tr_tool->info_dialog); - info_dialog_popup (tr_tool->info_dialog); + info_dialog_show (tr_tool->info_dialog); } static void diff --git a/app/tools/gimptransformtool.c b/app/tools/gimptransformtool.c index 86f4382f73..dc85da1ae8 100644 --- a/app/tools/gimptransformtool.c +++ b/app/tools/gimptransformtool.c @@ -1099,7 +1099,7 @@ gimp_transform_tool_halt (GimpTransformTool *tr_tool) gimp_draw_tool_stop (GIMP_DRAW_TOOL (tr_tool)); if (tr_tool->info_dialog) - info_dialog_popdown (tr_tool->info_dialog); + info_dialog_hide (tr_tool->info_dialog); tool->gdisp = NULL; tool->drawable = NULL;