app: Introduce GIMP_DIALOG_VISIBILITY_HIDDEN
Introduce GIMP_DIALOG_VISIBILITY_HIDDEN because it is a bit counter-intuitive to call gtk_widget_hide() on a dialog and then set GIMP_DIALOG_VISIBILITY_VISIBLE on it. No change in program flow has been (deliberately) introduced.
This commit is contained in:
@ -1364,9 +1364,8 @@ gimp_dialog_factory_hide (GimpDialogFactory *factory)
|
|||||||
|
|
||||||
if (gtk_widget_get_visible (widget))
|
if (gtk_widget_get_visible (widget))
|
||||||
{
|
{
|
||||||
visibility = GIMP_DIALOG_VISIBILITY_VISIBLE;
|
|
||||||
|
|
||||||
gtk_widget_hide (widget);
|
gtk_widget_hide (widget);
|
||||||
|
visibility = GIMP_DIALOG_VISIBILITY_HIDDEN;
|
||||||
|
|
||||||
GIMP_LOG (WM, "Hiding '%s' [%p]",
|
GIMP_LOG (WM, "Hiding '%s' [%p]",
|
||||||
gtk_window_get_title (GTK_WINDOW (widget)),
|
gtk_window_get_title (GTK_WINDOW (widget)),
|
||||||
@ -1402,7 +1401,7 @@ gimp_dialog_factory_show (GimpDialogFactory *factory)
|
|||||||
GIMP_DIALOG_VISIBILITY_KEY));
|
GIMP_DIALOG_VISIBILITY_KEY));
|
||||||
|
|
||||||
if (! gtk_widget_get_visible (widget) &&
|
if (! gtk_widget_get_visible (widget) &&
|
||||||
visibility == GIMP_DIALOG_VISIBILITY_VISIBLE)
|
visibility == GIMP_DIALOG_VISIBILITY_HIDDEN)
|
||||||
{
|
{
|
||||||
GIMP_LOG (WM, "Showing '%s' [%p]",
|
GIMP_LOG (WM, "Showing '%s' [%p]",
|
||||||
gtk_window_get_title (GTK_WINDOW (widget)),
|
gtk_window_get_title (GTK_WINDOW (widget)),
|
||||||
@ -1412,6 +1411,9 @@ gimp_dialog_factory_show (GimpDialogFactory *factory)
|
|||||||
* keyboard focus to move.
|
* keyboard focus to move.
|
||||||
*/
|
*/
|
||||||
gtk_widget_show (widget);
|
gtk_widget_show (widget);
|
||||||
|
g_object_set_data (G_OBJECT (widget),
|
||||||
|
GIMP_DIALOG_VISIBILITY_KEY,
|
||||||
|
GINT_TO_POINTER (GIMP_DIALOG_VISIBILITY_VISIBLE));
|
||||||
|
|
||||||
if (gtk_widget_get_visible (widget))
|
if (gtk_widget_get_visible (widget))
|
||||||
gdk_window_raise (gtk_widget_get_window (widget));
|
gdk_window_raise (gtk_widget_get_window (widget));
|
||||||
|
@ -30,7 +30,8 @@ typedef enum
|
|||||||
{
|
{
|
||||||
GIMP_DIALOG_VISIBILITY_UNKNOWN = 0,
|
GIMP_DIALOG_VISIBILITY_UNKNOWN = 0,
|
||||||
GIMP_DIALOG_VISIBILITY_INVISIBLE,
|
GIMP_DIALOG_VISIBILITY_INVISIBLE,
|
||||||
GIMP_DIALOG_VISIBILITY_VISIBLE
|
GIMP_DIALOG_VISIBILITY_VISIBLE,
|
||||||
|
GIMP_DIALOG_VISIBILITY_HIDDEN
|
||||||
} GimpDialogVisibilityState;
|
} GimpDialogVisibilityState;
|
||||||
|
|
||||||
|
|
||||||
|
@ -654,7 +654,12 @@ gimp_session_info_read_geometry (GimpSessionInfo *info)
|
|||||||
info->p->open = FALSE;
|
info->p->open = FALSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GIMP_DIALOG_VISIBILITY_HIDDEN:
|
||||||
case GIMP_DIALOG_VISIBILITY_VISIBLE:
|
case GIMP_DIALOG_VISIBILITY_VISIBLE:
|
||||||
|
/* Even if a dialog is hidden (with Windows->Hide docks) it
|
||||||
|
* is still considered open. It will be restored the next
|
||||||
|
* time GIMP starts
|
||||||
|
*/
|
||||||
info->p->open = TRUE;
|
info->p->open = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user