Merge branch 'issue-67' into 'master'

Rename "iconify" to "minimize"

Closes #67

See merge request GNOME/gtk!1190
This commit is contained in:
Matthias Clasen 2019-11-18 00:52:53 +00:00
commit c296101a2f
20 changed files with 200 additions and 181 deletions

View File

@ -192,8 +192,8 @@ gdk_surface_is_destroyed
gdk_surface_is_visible gdk_surface_is_visible
gdk_surface_is_viewable gdk_surface_is_viewable
gdk_surface_get_state gdk_surface_get_state
gdk_surface_iconify gdk_surface_minimize
gdk_surface_deiconify gdk_surface_unminimize
gdk_surface_stick gdk_surface_stick
gdk_surface_unstick gdk_surface_unstick
gdk_surface_maximize gdk_surface_maximize

View File

@ -4740,8 +4740,8 @@ gtk_window_set_default_widget
gtk_window_present gtk_window_present
gtk_window_present_with_time gtk_window_present_with_time
gtk_window_close gtk_window_close
gtk_window_iconify gtk_window_minimize
gtk_window_deiconify gtk_window_unminimize
gtk_window_stick gtk_window_stick
gtk_window_unstick gtk_window_unstick
gtk_window_maximize gtk_window_maximize

View File

@ -138,7 +138,7 @@ url="http://www.freedesktop.org/standards/">convention</ulink>.
<para> <para>
GTK has functions for asking the window manager to do various things; GTK has functions for asking the window manager to do various things;
see for example <link see for example <link
linkend="gtk-window-iconify">gtk_window_iconify()</link> or <link linkend="gtk-window-minimize">gtk_window_minimize()</link> or <link
linkend="gtk-window-maximize">gtk_window_maximize()</link> or <link linkend="gtk-window-maximize">gtk_window_maximize()</link> or <link
linkend="gtk-window-set-decorated">gtk_window_set_decorated()</link>. linkend="gtk-window-set-decorated">gtk_window_set_decorated()</link>.
Keep in mind that most window managers <emphasis>will</emphasis> ignore Keep in mind that most window managers <emphasis>will</emphasis> ignore

View File

@ -710,7 +710,7 @@ gdk_broadway_surface_set_icon_name (GdkSurface *surface,
} }
static void static void
gdk_broadway_surface_iconify (GdkSurface *surface) gdk_broadway_surface_minimize (GdkSurface *surface)
{ {
if (GDK_SURFACE_DESTROYED (surface) || if (GDK_SURFACE_DESTROYED (surface) ||
!SURFACE_IS_TOPLEVEL (surface)) !SURFACE_IS_TOPLEVEL (surface))
@ -718,7 +718,7 @@ gdk_broadway_surface_iconify (GdkSurface *surface)
} }
static void static void
gdk_broadway_surface_deiconify (GdkSurface *surface) gdk_broadway_surface_unminimize (GdkSurface *surface)
{ {
if (GDK_SURFACE_DESTROYED (surface) || if (GDK_SURFACE_DESTROYED (surface) ||
!SURFACE_IS_TOPLEVEL (surface)) !SURFACE_IS_TOPLEVEL (surface))
@ -1413,8 +1413,8 @@ gdk_broadway_surface_class_init (GdkBroadwaySurfaceClass *klass)
impl_class->set_focus_on_map = gdk_broadway_surface_set_focus_on_map; impl_class->set_focus_on_map = gdk_broadway_surface_set_focus_on_map;
impl_class->set_icon_list = gdk_broadway_surface_set_icon_list; impl_class->set_icon_list = gdk_broadway_surface_set_icon_list;
impl_class->set_icon_name = gdk_broadway_surface_set_icon_name; impl_class->set_icon_name = gdk_broadway_surface_set_icon_name;
impl_class->iconify = gdk_broadway_surface_iconify; impl_class->minimize = gdk_broadway_surface_minimize;
impl_class->deiconify = gdk_broadway_surface_deiconify; impl_class->unminimize = gdk_broadway_surface_unminimize;
impl_class->stick = gdk_broadway_surface_stick; impl_class->stick = gdk_broadway_surface_stick;
impl_class->unstick = gdk_broadway_surface_unstick; impl_class->unstick = gdk_broadway_surface_unstick;
impl_class->maximize = gdk_broadway_surface_maximize; impl_class->maximize = gdk_broadway_surface_maximize;

View File

@ -3048,37 +3048,45 @@ gdk_surface_set_icon_name (GdkSurface *surface,
} }
/** /**
* gdk_surface_iconify: * gdk_surface_minimize:
* @surface: a toplevel #GdkSurface * @surface: a toplevel #GdkSurface
* *
* Asks to iconify (minimize) @surface. The window manager may choose * Asks to minimize the @surface.
* to ignore the request, but normally will honor it. Using *
* gtk_window_iconify() is preferred, if you have a #GtkWindow widget. * The windowing system may choose to ignore the request.
*
* You can track the result of this request by using the #GdkSurface:state
* property.
* *
* This function only makes sense when @surface is a toplevel surface. * This function only makes sense when @surface is a toplevel surface.
* */
**/
void void
gdk_surface_iconify (GdkSurface *surface) gdk_surface_minimize (GdkSurface *surface)
{ {
GDK_SURFACE_GET_CLASS (surface)->iconify (surface); g_return_if_fail (GDK_IS_SURFACE (surface));
GDK_SURFACE_GET_CLASS (surface)->minimize (surface);
} }
/** /**
* gdk_surface_deiconify: * gdk_surface_unminimize:
* @surface: a toplevel #GdkSurface * @surface: a toplevel #GdkSurface
* *
* Attempt to deiconify (unminimize) @surface. On X11 the window manager may * Asks to unminimize the @surface.
* choose to ignore the request to deiconify. When using GTK,
* use gtk_window_deiconify() instead of the #GdkSurface variant. Or better yet,
* you probably want to use gtk_window_present_with_time(), which raises the surface, focuses it,
* unminimizes it, and puts it on the current desktop.
* *
**/ * The windowing system may choose to ignore the request.
*
* You can track the result of this request by using the #GdkSurface:state
* property.
*
* This function only makes sense when @surface is a toplevel surface.
*/
void void
gdk_surface_deiconify (GdkSurface *surface) gdk_surface_unminimize (GdkSurface *surface)
{ {
GDK_SURFACE_GET_CLASS (surface)->deiconify (surface); g_return_if_fail (GDK_IS_SURFACE (surface));
GDK_SURFACE_GET_CLASS (surface)->unminimize (surface);
} }
/** /**

View File

@ -357,7 +357,7 @@ struct _GdkGeometry
/** /**
* GdkSurfaceState: * GdkSurfaceState:
* @GDK_SURFACE_STATE_WITHDRAWN: the surface is not shown * @GDK_SURFACE_STATE_WITHDRAWN: the surface is not shown
* @GDK_SURFACE_STATE_ICONIFIED: the surface is minimized * @GDK_SURFACE_STATE_MINIMIZED: the surface is minimized
* @GDK_SURFACE_STATE_MAXIMIZED: the surface is maximized * @GDK_SURFACE_STATE_MAXIMIZED: the surface is maximized
* @GDK_SURFACE_STATE_STICKY: the surface is sticky * @GDK_SURFACE_STATE_STICKY: the surface is sticky
* @GDK_SURFACE_STATE_FULLSCREEN: the surface is maximized without decorations * @GDK_SURFACE_STATE_FULLSCREEN: the surface is maximized without decorations
@ -384,7 +384,7 @@ struct _GdkGeometry
typedef enum typedef enum
{ {
GDK_SURFACE_STATE_WITHDRAWN = 1 << 0, GDK_SURFACE_STATE_WITHDRAWN = 1 << 0,
GDK_SURFACE_STATE_ICONIFIED = 1 << 1, GDK_SURFACE_STATE_MINIMIZED = 1 << 1,
GDK_SURFACE_STATE_MAXIMIZED = 1 << 2, GDK_SURFACE_STATE_MAXIMIZED = 1 << 2,
GDK_SURFACE_STATE_STICKY = 1 << 3, GDK_SURFACE_STATE_STICKY = 1 << 3,
GDK_SURFACE_STATE_FULLSCREEN = 1 << 4, GDK_SURFACE_STATE_FULLSCREEN = 1 << 4,
@ -582,9 +582,9 @@ cairo_surface_t *
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_surface_beep (GdkSurface *surface); void gdk_surface_beep (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_surface_iconify (GdkSurface *surface); void gdk_surface_minimize (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_surface_deiconify (GdkSurface *surface); void gdk_surface_unminimize (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_surface_stick (GdkSurface *surface); void gdk_surface_stick (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL

View File

@ -186,8 +186,8 @@ struct _GdkSurfaceClass
GList *pixbufs); GList *pixbufs);
void (* set_icon_name) (GdkSurface *surface, void (* set_icon_name) (GdkSurface *surface,
const gchar *name); const gchar *name);
void (* iconify) (GdkSurface *surface); void (* minimize) (GdkSurface *surface);
void (* deiconify) (GdkSurface *surface); void (* unminimize) (GdkSurface *surface);
void (* stick) (GdkSurface *surface); void (* stick) (GdkSurface *surface);
void (* unstick) (GdkSurface *surface); void (* unstick) (GdkSurface *surface);
void (* maximize) (GdkSurface *surface); void (* maximize) (GdkSurface *surface);

View File

@ -58,8 +58,7 @@
{ {
GdkSurface *window = [[self contentView] gdkSurface]; GdkSurface *window = [[self contentView] gdkSurface];
gdk_synthesize_surface_state (window, 0, gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_MINIMIZED);
GDK_SURFACE_STATE_ICONIFIED);
} }
-(void)windowDidDeminiaturize:(NSNotification *)aNotification -(void)windowDidDeminiaturize:(NSNotification *)aNotification
@ -68,7 +67,7 @@
_gdk_quartz_surface_attach_to_parent (window); _gdk_quartz_surface_attach_to_parent (window);
gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_ICONIFIED, 0); gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_MINIMIZED, 0);
} }
-(void)windowDidBecomeKey:(NSNotification *)aNotification -(void)windowDidBecomeKey:(NSNotification *)aNotification

View File

@ -960,8 +960,8 @@ gdk_surface_quartz_show (GdkSurface *window, gboolean already_mapped)
if (window->state & GDK_SURFACE_STATE_MAXIMIZED) if (window->state & GDK_SURFACE_STATE_MAXIMIZED)
gdk_surface_maximize (window); gdk_surface_maximize (window);
if (window->state & GDK_SURFACE_STATE_ICONIFIED) if (window->state & GDK_SURFACE_STATE_MINIMIZED)
gdk_surface_iconify (window); gdk_surface_minimize (window);
if (impl->transient_for && !GDK_SURFACE_DESTROYED (impl->transient_for)) if (impl->transient_for && !GDK_SURFACE_DESTROYED (impl->transient_for))
_gdk_quartz_surface_attach_to_parent (window); _gdk_quartz_surface_attach_to_parent (window);
@ -2353,7 +2353,7 @@ gdk_quartz_surface_unmaximize (GdkSurface *window)
} }
static void static void
gdk_quartz_surface_iconify (GdkSurface *window) gdk_quartz_surface_minimize (GdkSurface *window)
{ {
GdkSurfaceImplQuartz *impl; GdkSurfaceImplQuartz *impl;
@ -2374,14 +2374,12 @@ gdk_quartz_surface_iconify (GdkSurface *window)
} }
else else
{ {
gdk_synthesize_surface_state (window, gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_MINIMIZED);
0,
GDK_SURFACE_STATE_ICONIFIED);
} }
} }
static void static void
gdk_quartz_surface_deiconify (GdkSurface *window) gdk_quartz_surface_unminimize (GdkSurface *window)
{ {
GdkSurfaceImplQuartz *impl; GdkSurfaceImplQuartz *impl;
@ -2402,9 +2400,7 @@ gdk_quartz_surface_deiconify (GdkSurface *window)
} }
else else
{ {
gdk_synthesize_surface_state (window, gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_MINIMIZED, 0);
GDK_SURFACE_STATE_ICONIFIED,
0);
} }
} }
@ -2701,8 +2697,8 @@ gdk_surface_impl_quartz_class_init (GdkSurfaceImplQuartzClass *klass)
impl_class->set_focus_on_map = gdk_quartz_surface_set_focus_on_map; impl_class->set_focus_on_map = gdk_quartz_surface_set_focus_on_map;
impl_class->set_icon_list = gdk_quartz_surface_set_icon_list; impl_class->set_icon_list = gdk_quartz_surface_set_icon_list;
impl_class->set_icon_name = gdk_quartz_surface_set_icon_name; impl_class->set_icon_name = gdk_quartz_surface_set_icon_name;
impl_class->iconify = gdk_quartz_surface_iconify; impl_class->minimize = gdk_quartz_surface_minimize;
impl_class->deiconify = gdk_quartz_surface_deiconify; impl_class->unminimize = gdk_quartz_surface_unminimize;
impl_class->stick = gdk_quartz_surface_stick; impl_class->stick = gdk_quartz_surface_stick;
impl_class->unstick = gdk_quartz_surface_unstick; impl_class->unstick = gdk_quartz_surface_unstick;
impl_class->maximize = gdk_quartz_surface_maximize; impl_class->maximize = gdk_quartz_surface_maximize;

View File

@ -3273,11 +3273,8 @@ gdk_wayland_surface_set_icon_name (GdkSurface *surface,
} }
static void static void
gdk_wayland_surface_iconify (GdkSurface *surface) gdk_wayland_surface_minimize (GdkSurface *surface)
{ {
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
GdkWaylandDisplay *display_wayland;
if (GDK_SURFACE_DESTROYED (surface) || if (GDK_SURFACE_DESTROYED (surface) ||
!SURFACE_IS_TOPLEVEL (surface)) !SURFACE_IS_TOPLEVEL (surface))
return; return;
@ -3285,6 +3282,14 @@ gdk_wayland_surface_iconify (GdkSurface *surface)
if (!is_realized_toplevel (surface)) if (!is_realized_toplevel (surface))
return; return;
#if 0
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
GdkWaylandDisplay *display_wayland;
/* We cannot use set_minimized() because it does not come with a
* minimized state that we can query or get notified of. This means
* we cannot implement the full GdkSurface API
*/
display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface)); display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
switch (display_wayland->shell_variant) switch (display_wayland->shell_variant)
{ {
@ -3297,20 +3302,26 @@ gdk_wayland_surface_iconify (GdkSurface *surface)
default: default:
g_assert_not_reached (); g_assert_not_reached ();
} }
#endif
} }
static void static void
gdk_wayland_surface_deiconify (GdkSurface *surface) gdk_wayland_surface_unminimize (GdkSurface *surface)
{ {
if (GDK_SURFACE_DESTROYED (surface) || if (GDK_SURFACE_DESTROYED (surface) ||
!SURFACE_IS_TOPLEVEL (surface)) !SURFACE_IS_TOPLEVEL (surface))
return; return;
#if 0
if (GDK_SURFACE_IS_MAPPED (surface)) if (GDK_SURFACE_IS_MAPPED (surface))
{
gdk_surface_show (surface); gdk_surface_show (surface);
}
else else
/* Flip our client side flag, the real work happens on map. */ {
gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_ICONIFIED, 0); gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_MINIMIZED, 0);
}
#endif
} }
static void static void
@ -3834,8 +3845,8 @@ gdk_wayland_surface_class_init (GdkWaylandSurfaceClass *klass)
impl_class->set_focus_on_map = gdk_wayland_surface_set_focus_on_map; impl_class->set_focus_on_map = gdk_wayland_surface_set_focus_on_map;
impl_class->set_icon_list = gdk_wayland_surface_set_icon_list; impl_class->set_icon_list = gdk_wayland_surface_set_icon_list;
impl_class->set_icon_name = gdk_wayland_surface_set_icon_name; impl_class->set_icon_name = gdk_wayland_surface_set_icon_name;
impl_class->iconify = gdk_wayland_surface_iconify; impl_class->minimize = gdk_wayland_surface_minimize;
impl_class->deiconify = gdk_wayland_surface_deiconify; impl_class->unminimize = gdk_wayland_surface_unminimize;
impl_class->stick = gdk_wayland_surface_stick; impl_class->stick = gdk_wayland_surface_stick;
impl_class->unstick = gdk_wayland_surface_unstick; impl_class->unstick = gdk_wayland_surface_unstick;
impl_class->maximize = gdk_wayland_surface_maximize; impl_class->maximize = gdk_wayland_surface_maximize;

View File

@ -1014,7 +1014,7 @@ show_window_recurse (GdkSurface *window, gboolean hide_window)
{ {
if (!hide_window) if (!hide_window)
{ {
if (gdk_surface_get_state (window) & GDK_SURFACE_STATE_ICONIFIED) if (gdk_surface_get_state (window) & GDK_SURFACE_STATE_MINIMIZED)
{ {
if (gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED) if (gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED)
{ {
@ -3099,9 +3099,9 @@ gdk_event_translate (MSG *msg,
set_bits |= GDK_SURFACE_STATE_WITHDRAWN; set_bits |= GDK_SURFACE_STATE_WITHDRAWN;
if (IsIconic (msg->hwnd)) if (IsIconic (msg->hwnd))
set_bits |= GDK_SURFACE_STATE_ICONIFIED; set_bits |= GDK_SURFACE_STATE_MINIMIZED;
else else
unset_bits |= GDK_SURFACE_STATE_ICONIFIED; unset_bits |= GDK_SURFACE_STATE_MINIMIZED;
if (IsZoomed (msg->hwnd)) if (IsZoomed (msg->hwnd))
set_bits |= GDK_SURFACE_STATE_MAXIMIZED; set_bits |= GDK_SURFACE_STATE_MAXIMIZED;
@ -3116,15 +3116,15 @@ gdk_event_translate (MSG *msg,
* change the iconified state in all transient related windows, * change the iconified state in all transient related windows,
* as windows doesn't give icons for transient childrens. * as windows doesn't give icons for transient childrens.
*/ */
if ((old_state & GDK_SURFACE_STATE_ICONIFIED) != if ((old_state & GDK_SURFACE_STATE_MINIMIZED) !=
(new_state & GDK_SURFACE_STATE_ICONIFIED)) (new_state & GDK_SURFACE_STATE_MINIMIZED))
do_show_window (window, (new_state & GDK_SURFACE_STATE_ICONIFIED)); do_show_window (window, (new_state & GDK_SURFACE_STATE_MINIMIZED));
/* When un-minimizing, make sure we're stacked under any /* When un-minimizing, make sure we're stacked under any
transient-type windows. */ transient-type windows. */
if (!(old_state & GDK_SURFACE_STATE_ICONIFIED) && if (!(old_state & GDK_SURFACE_STATE_MINIMIZED) &&
(new_state & GDK_SURFACE_STATE_ICONIFIED)) (new_state & GDK_SURFACE_STATE_MINIMIZED))
{ {
ensure_stacking_on_unminimize (msg); ensure_stacking_on_unminimize (msg);
restack_children (window); restack_children (window);

View File

@ -296,7 +296,7 @@ _gdk_win32_surface_state_to_string (GdkSurfaceState state)
(bufp += sprintf (bufp, "MAPPED"), s = "|"); (bufp += sprintf (bufp, "MAPPED"), s = "|");
BIT (WITHDRAWN); BIT (WITHDRAWN);
BIT (ICONIFIED); BIT (MINIMIZED);
BIT (MAXIMIZED); BIT (MAXIMIZED);
BIT (STICKY); BIT (STICKY);
#undef BIT #undef BIT

View File

@ -810,7 +810,7 @@ adjust_for_gravity_hints (GdkSurface *window,
static void static void
show_window_internal (GdkSurface *window, show_window_internal (GdkSurface *window,
gboolean already_mapped, gboolean already_mapped,
gboolean deiconify) gboolean unminimize)
{ {
GdkWin32Surface *surface; GdkWin32Surface *surface;
gboolean focus_on_map = FALSE; gboolean focus_on_map = FALSE;
@ -822,34 +822,34 @@ show_window_internal (GdkSurface *window,
GDK_NOTE (MISC, g_print ("show_window_internal: %p: %s%s\n", GDK_NOTE (MISC, g_print ("show_window_internal: %p: %s%s\n",
GDK_SURFACE_HWND (window), GDK_SURFACE_HWND (window),
_gdk_win32_surface_state_to_string (window->state), _gdk_win32_surface_state_to_string (window->state),
(deiconify ? " deiconify" : ""))); (unminimize ? " unminimize" : "")));
/* If asked to show (not deiconify) a withdrawn and iconified /* If asked to show (not unminimize) a withdrawn and iconified
* window, do that. * window, do that.
*/ */
if (!deiconify && if (!unminimize &&
!already_mapped && !already_mapped &&
(window->state & GDK_SURFACE_STATE_ICONIFIED)) (window->state & GDK_SURFACE_STATE_MINIMIZED))
{ {
GtkShowWindow (window, SW_SHOWMINNOACTIVE); GtkShowWindow (window, SW_SHOWMINNOACTIVE);
return; return;
} }
/* If asked to just show an iconified window, do nothing. */ /* If asked to just show an iconified window, do nothing. */
if (!deiconify && (window->state & GDK_SURFACE_STATE_ICONIFIED)) if (!unminimize && (window->state & GDK_SURFACE_STATE_MINIMIZED))
return; return;
/* If asked to deiconify an already noniconified window, do /* If asked to unminimize an already noniconified window, do
* nothing. (Especially, don't cause the window to rise and * nothing. (Especially, don't cause the window to rise and
* activate. There are different calls for that.) * activate. There are different calls for that.)
*/ */
if (deiconify && !(window->state & GDK_SURFACE_STATE_ICONIFIED)) if (unminimize && !(window->state & GDK_SURFACE_STATE_MINIMIZED))
return; return;
/* If asked to show (but not raise) a window that is already /* If asked to show (but not raise) a window that is already
* visible, do nothing. * visible, do nothing.
*/ */
if (!deiconify && !already_mapped && IsWindowVisible (GDK_SURFACE_HWND (window))) if (!unminimize && !already_mapped && IsWindowVisible (GDK_SURFACE_HWND (window)))
return; return;
/* Other cases */ /* Other cases */
@ -1005,7 +1005,7 @@ show_window_internal (GdkSurface *window,
{ {
GtkShowWindow (window, SW_MAXIMIZE); GtkShowWindow (window, SW_MAXIMIZE);
} }
else if (window->state & GDK_SURFACE_STATE_ICONIFIED) else if (window->state & GDK_SURFACE_STATE_MINIMIZED)
{ {
if (focus_on_map) if (focus_on_map)
GtkShowWindow (window, SW_RESTORE); GtkShowWindow (window, SW_RESTORE);
@ -2766,7 +2766,7 @@ _gdk_win32_surface_handle_aerosnap (GdkSurface *window,
GdkDisplay *display; GdkDisplay *display;
gint n_monitors; gint n_monitors;
GdkSurfaceState surface_state = gdk_surface_get_state (window); GdkSurfaceState surface_state = gdk_surface_get_state (window);
gboolean minimized = surface_state & GDK_SURFACE_STATE_ICONIFIED; gboolean minimized = surface_state & GDK_SURFACE_STATE_MINIMIZED;
gboolean maximized = surface_state & GDK_SURFACE_STATE_MAXIMIZED; gboolean maximized = surface_state & GDK_SURFACE_STATE_MAXIMIZED;
gboolean halfsnapped; gboolean halfsnapped;
GdkMonitor *monitor; GdkMonitor *monitor;
@ -2805,7 +2805,7 @@ _gdk_win32_surface_handle_aerosnap (GdkSurface *window,
else if (halfsnapped) else if (halfsnapped)
unsnap (window, monitor); unsnap (window, monitor);
else if (!minimized) else if (!minimized)
gdk_surface_iconify (window); gdk_surface_minimize (window);
break; break;
case GDK_WIN32_AEROSNAP_COMBO_LEFT: case GDK_WIN32_AEROSNAP_COMBO_LEFT:
if (maximized) if (maximized)
@ -4502,7 +4502,7 @@ gdk_win32_surface_begin_move_drag (GdkSurface *window,
* Setting window states * Setting window states
*/ */
static void static void
gdk_win32_surface_iconify (GdkSurface *window) gdk_win32_surface_minimize (GdkSurface *window)
{ {
HWND old_active_window; HWND old_active_window;
@ -4511,7 +4511,7 @@ gdk_win32_surface_iconify (GdkSurface *window)
if (GDK_SURFACE_DESTROYED (window)) if (GDK_SURFACE_DESTROYED (window))
return; return;
GDK_NOTE (MISC, g_print ("gdk_surface_iconify: %p: %s\n", GDK_NOTE (MISC, g_print ("gdk_surface_minimize: %p: %s\n",
GDK_SURFACE_HWND (window), GDK_SURFACE_HWND (window),
_gdk_win32_surface_state_to_string (window->state))); _gdk_win32_surface_state_to_string (window->state)));
@ -4526,19 +4526,19 @@ gdk_win32_surface_iconify (GdkSurface *window)
{ {
gdk_synthesize_surface_state (window, gdk_synthesize_surface_state (window,
0, 0,
GDK_SURFACE_STATE_ICONIFIED); GDK_SURFACE_STATE_MINIMIZED);
} }
} }
static void static void
gdk_win32_surface_deiconify (GdkSurface *window) gdk_win32_surface_unminimize (GdkSurface *window)
{ {
g_return_if_fail (GDK_IS_SURFACE (window)); g_return_if_fail (GDK_IS_SURFACE (window));
if (GDK_SURFACE_DESTROYED (window)) if (GDK_SURFACE_DESTROYED (window))
return; return;
GDK_NOTE (MISC, g_print ("gdk_surface_deiconify: %p: %s\n", GDK_NOTE (MISC, g_print ("gdk_surface_unminimize: %p: %s\n",
GDK_SURFACE_HWND (window), GDK_SURFACE_HWND (window),
_gdk_win32_surface_state_to_string (window->state))); _gdk_win32_surface_state_to_string (window->state)));
@ -4549,7 +4549,7 @@ gdk_win32_surface_deiconify (GdkSurface *window)
else else
{ {
gdk_synthesize_surface_state (window, gdk_synthesize_surface_state (window,
GDK_SURFACE_STATE_ICONIFIED, GDK_SURFACE_STATE_MINIMIZED,
0); 0);
} }
} }
@ -4763,7 +4763,7 @@ gdk_win32_surface_focus (GdkSurface *window,
if (window->state & GDK_SURFACE_STATE_MAXIMIZED) if (window->state & GDK_SURFACE_STATE_MAXIMIZED)
GtkShowWindow (window, SW_SHOWMAXIMIZED); GtkShowWindow (window, SW_SHOWMAXIMIZED);
else if (window->state & GDK_SURFACE_STATE_ICONIFIED) else if (window->state & GDK_SURFACE_STATE_MINIMIZED)
GtkShowWindow (window, SW_RESTORE); GtkShowWindow (window, SW_RESTORE);
else if (!IsWindowVisible (GDK_SURFACE_HWND (window))) else if (!IsWindowVisible (GDK_SURFACE_HWND (window)))
GtkShowWindow (window, SW_SHOWNORMAL); GtkShowWindow (window, SW_SHOWNORMAL);
@ -5185,8 +5185,8 @@ gdk_win32_surface_class_init (GdkWin32SurfaceClass *klass)
impl_class->set_focus_on_map = gdk_win32_surface_set_focus_on_map; impl_class->set_focus_on_map = gdk_win32_surface_set_focus_on_map;
impl_class->set_icon_list = gdk_win32_surface_set_icon_list; impl_class->set_icon_list = gdk_win32_surface_set_icon_list;
impl_class->set_icon_name = gdk_win32_surface_set_icon_name; impl_class->set_icon_name = gdk_win32_surface_set_icon_name;
impl_class->iconify = gdk_win32_surface_iconify; impl_class->minimize = gdk_win32_surface_minimize;
impl_class->deiconify = gdk_win32_surface_deiconify; impl_class->unminimize = gdk_win32_surface_unminimize;
impl_class->stick = gdk_win32_surface_stick; impl_class->stick = gdk_win32_surface_stick;
impl_class->unstick = gdk_win32_surface_unstick; impl_class->unstick = gdk_win32_surface_unstick;
impl_class->maximize = gdk_win32_surface_maximize; impl_class->maximize = gdk_win32_surface_maximize;

View File

@ -416,15 +416,15 @@ do_net_wm_state_changes (GdkSurface *surface)
set |= GDK_SURFACE_STATE_FOCUSED; set |= GDK_SURFACE_STATE_FOCUSED;
} }
if (old_state & GDK_SURFACE_STATE_ICONIFIED) if (old_state & GDK_SURFACE_STATE_MINIMIZED)
{ {
if (!toplevel->have_hidden) if (!toplevel->have_hidden)
unset |= GDK_SURFACE_STATE_ICONIFIED; unset |= GDK_SURFACE_STATE_MINIMIZED;
} }
else else
{ {
if (toplevel->have_hidden) if (toplevel->have_hidden)
set |= GDK_SURFACE_STATE_ICONIFIED; set |= GDK_SURFACE_STATE_MINIMIZED;
} }
/* Update edge constraints and tiling */ /* Update edge constraints and tiling */
@ -862,12 +862,12 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
/* If we are shown (not withdrawn) and get an unmap, it means we were /* If we are shown (not withdrawn) and get an unmap, it means we were
* iconified in the X sense. If we are withdrawn, and get an unmap, it * iconified in the X sense. If we are withdrawn, and get an unmap, it
* means we hid the window ourselves, so we will have already flipped * means we hid the window ourselves, so we will have already flipped
* the iconified bit off. * the minimized bit off.
*/ */
if (GDK_SURFACE_IS_MAPPED (surface)) if (GDK_SURFACE_IS_MAPPED (surface))
gdk_synthesize_surface_state (surface, gdk_synthesize_surface_state (surface,
0, 0,
GDK_SURFACE_STATE_ICONIFIED); GDK_SURFACE_STATE_MINIMIZED);
} }
if (surface_impl->toplevel && if (surface_impl->toplevel &&
@ -894,10 +894,10 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
if (surface && !is_substructure) if (surface && !is_substructure)
{ {
/* Unset iconified if it was set */ /* Unset minimized if it was set */
if (surface->state & GDK_SURFACE_STATE_ICONIFIED) if (surface->state & GDK_SURFACE_STATE_MINIMIZED)
gdk_synthesize_surface_state (surface, gdk_synthesize_surface_state (surface,
GDK_SURFACE_STATE_ICONIFIED, GDK_SURFACE_STATE_MINIMIZED,
0); 0);
if (toplevel) if (toplevel)

View File

@ -1033,7 +1033,7 @@ update_wm_hints (GdkSurface *surface,
wm_hints.input = surface->accept_focus ? True : False; wm_hints.input = surface->accept_focus ? True : False;
wm_hints.initial_state = NormalState; wm_hints.initial_state = NormalState;
if (surface->state & GDK_SURFACE_STATE_ICONIFIED) if (surface->state & GDK_SURFACE_STATE_MINIMIZED)
{ {
wm_hints.flags |= StateHint; wm_hints.flags |= StateHint;
wm_hints.initial_state = IconicState; wm_hints.initial_state = IconicState;
@ -1154,7 +1154,7 @@ set_initial_hints (GdkSurface *surface)
++i; ++i;
} }
if (surface->state & GDK_SURFACE_STATE_ICONIFIED) if (surface->state & GDK_SURFACE_STATE_MINIMIZED)
{ {
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display, atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_STATE_HIDDEN"); "_NET_WM_STATE_HIDDEN");
@ -3034,7 +3034,7 @@ gdk_x11_surface_set_icon_name (GdkSurface *surface,
} }
static void static void
gdk_x11_surface_iconify (GdkSurface *surface) gdk_x11_surface_minimize (GdkSurface *surface)
{ {
if (GDK_SURFACE_DESTROYED (surface)) if (GDK_SURFACE_DESTROYED (surface))
return; return;
@ -3048,9 +3048,7 @@ gdk_x11_surface_iconify (GdkSurface *surface)
else else
{ {
/* Flip our client side flag, the real work happens on map. */ /* Flip our client side flag, the real work happens on map. */
gdk_synthesize_surface_state (surface, gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_MINIMIZED);
0,
GDK_SURFACE_STATE_ICONIFIED);
gdk_wmspec_change_state (TRUE, surface, gdk_wmspec_change_state (TRUE, surface,
g_intern_static_string ("_NET_WM_STATE_HIDDEN"), g_intern_static_string ("_NET_WM_STATE_HIDDEN"),
NULL); NULL);
@ -3058,7 +3056,7 @@ gdk_x11_surface_iconify (GdkSurface *surface)
} }
static void static void
gdk_x11_surface_deiconify (GdkSurface *surface) gdk_x11_surface_unminimize (GdkSurface *surface)
{ {
if (GDK_SURFACE_DESTROYED (surface)) if (GDK_SURFACE_DESTROYED (surface))
return; return;
@ -3073,9 +3071,7 @@ gdk_x11_surface_deiconify (GdkSurface *surface)
else else
{ {
/* Flip our client side flag, the real work happens on map. */ /* Flip our client side flag, the real work happens on map. */
gdk_synthesize_surface_state (surface, gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_MINIMIZED, 0);
GDK_SURFACE_STATE_ICONIFIED,
0);
gdk_wmspec_change_state (FALSE, surface, gdk_wmspec_change_state (FALSE, surface,
g_intern_static_string ("_NET_WM_STATE_HIDDEN"), g_intern_static_string ("_NET_WM_STATE_HIDDEN"),
NULL); NULL);
@ -4676,8 +4672,8 @@ gdk_x11_surface_class_init (GdkX11SurfaceClass *klass)
impl_class->set_focus_on_map = gdk_x11_surface_set_focus_on_map; impl_class->set_focus_on_map = gdk_x11_surface_set_focus_on_map;
impl_class->set_icon_list = gdk_x11_surface_set_icon_list; impl_class->set_icon_list = gdk_x11_surface_set_icon_list;
impl_class->set_icon_name = gdk_x11_surface_set_icon_name; impl_class->set_icon_name = gdk_x11_surface_set_icon_name;
impl_class->iconify = gdk_x11_surface_iconify; impl_class->minimize = gdk_x11_surface_minimize;
impl_class->deiconify = gdk_x11_surface_deiconify; impl_class->unminimize = gdk_x11_surface_unminimize;
impl_class->stick = gdk_x11_surface_stick; impl_class->stick = gdk_x11_surface_stick;
impl_class->unstick = gdk_x11_surface_unstick; impl_class->unstick = gdk_x11_surface_unstick;
impl_class->maximize = gdk_x11_surface_maximize; impl_class->maximize = gdk_x11_surface_maximize;

View File

@ -248,7 +248,7 @@ gtk_window_accessible_ref_state_set (AtkObject *accessible)
if (gdk_surface) if (gdk_surface)
{ {
state = gdk_surface_get_state (gdk_surface); state = gdk_surface_get_state (gdk_surface);
if (state & GDK_SURFACE_STATE_ICONIFIED) if (state & GDK_SURFACE_STATE_MINIMIZED)
atk_state_set_add_state (state_set, ATK_STATE_ICONIFIED); atk_state_set_add_state (state_set, ATK_STATE_ICONIFIED);
} }
if (gtk_window_get_modal (window)) if (gtk_window_get_modal (window))

View File

@ -434,7 +434,7 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
gtk_container_add (GTK_CONTAINER (button), image); gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_set_can_focus (button, FALSE); gtk_widget_set_can_focus (button, FALSE);
g_signal_connect_swapped (button, "clicked", g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_window_iconify), window); G_CALLBACK (gtk_window_minimize), window);
accessible = gtk_widget_get_accessible (button); accessible = gtk_widget_get_accessible (button);
if (GTK_IS_ACCESSIBLE (accessible)) if (GTK_IS_ACCESSIBLE (accessible))

View File

@ -248,7 +248,7 @@ typedef struct
guint focus_on_map : 1; guint focus_on_map : 1;
guint fullscreen_initially : 1; guint fullscreen_initially : 1;
guint has_user_ref_count : 1; guint has_user_ref_count : 1;
guint iconify_initially : 1; /* gtk_window_iconify() called before realization */ guint minimize_initially : 1;
guint is_active : 1; guint is_active : 1;
guint maximize_initially : 1; guint maximize_initially : 1;
guint mnemonics_visible : 1; guint mnemonics_visible : 1;
@ -1339,7 +1339,7 @@ gtk_window_titlebar_action (GtkWindow *window,
else if (g_str_equal (action, "lower")) else if (g_str_equal (action, "lower"))
gdk_surface_lower (priv->surface); gdk_surface_lower (priv->surface);
else if (g_str_equal (action, "minimize")) else if (g_str_equal (action, "minimize"))
gdk_surface_iconify (priv->surface); gdk_surface_minimize (priv->surface);
else if (g_str_equal (action, "menu")) else if (g_str_equal (action, "menu"))
gtk_window_do_popup (window, (GdkEventButton*) event); gtk_window_do_popup (window, (GdkEventButton*) event);
else else
@ -4967,10 +4967,10 @@ gtk_window_map (GtkWidget *widget)
else else
gdk_surface_unstick (surface); gdk_surface_unstick (surface);
if (priv->iconify_initially) if (priv->minimize_initially)
gdk_surface_iconify (surface); gdk_surface_minimize (surface);
else else
gdk_surface_deiconify (surface); gdk_surface_unminimize (surface);
if (priv->fullscreen_initially) if (priv->fullscreen_initially)
{ {
@ -5042,7 +5042,7 @@ gtk_window_unmap (GtkWidget *widget)
priv->configure_notify_received = FALSE; priv->configure_notify_received = FALSE;
state = gdk_surface_get_state (priv->surface); state = gdk_surface_get_state (priv->surface);
priv->iconify_initially = (state & GDK_SURFACE_STATE_ICONIFIED) != 0; priv->minimize_initially = (state & GDK_SURFACE_STATE_MINIMIZED) != 0;
priv->maximize_initially = (state & GDK_SURFACE_STATE_MAXIMIZED) != 0; priv->maximize_initially = (state & GDK_SURFACE_STATE_MAXIMIZED) != 0;
priv->stick_initially = (state & GDK_SURFACE_STATE_STICKY) != 0; priv->stick_initially = (state & GDK_SURFACE_STATE_STICKY) != 0;
priv->above_initially = (state & GDK_SURFACE_STATE_ABOVE) != 0; priv->above_initially = (state & GDK_SURFACE_STATE_ABOVE) != 0;
@ -6609,8 +6609,8 @@ restore_window_clicked (GtkMenuItem *menuitem,
state = gtk_window_get_state (window); state = gtk_window_get_state (window);
if (state & GDK_SURFACE_STATE_ICONIFIED) if (state & GDK_SURFACE_STATE_MINIMIZED)
gtk_window_deiconify (window); gtk_window_unminimize (window);
} }
static void static void
@ -6645,11 +6645,11 @@ minimize_window_clicked (GtkMenuItem *menuitem,
GtkWindow *window = GTK_WINDOW (user_data); GtkWindow *window = GTK_WINDOW (user_data);
GtkWindowPrivate *priv = gtk_window_get_instance_private (window); GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
/* Turns out, we can't iconify a maximized window */ /* Turns out, we can't minimize a maximized window */
if (priv->maximized) if (priv->maximized)
gtk_window_unmaximize (window); gtk_window_unmaximize (window);
gtk_window_iconify (window); gtk_window_minimize (window);
} }
static void static void
@ -6661,8 +6661,8 @@ maximize_window_clicked (GtkMenuItem *menuitem,
state = gtk_window_get_state (window); state = gtk_window_get_state (window);
if (state & GDK_SURFACE_STATE_ICONIFIED) if (state & GDK_SURFACE_STATE_MINIMIZED)
gtk_window_deiconify (window); gtk_window_unminimize (window);
gtk_window_maximize (window); gtk_window_maximize (window);
} }
@ -6694,7 +6694,7 @@ gtk_window_do_popup_fallback (GtkWindow *window,
GtkWindowPrivate *priv = gtk_window_get_instance_private (window); GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
GtkWidget *menuitem; GtkWidget *menuitem;
GdkSurfaceState state; GdkSurfaceState state;
gboolean maximized, iconified; gboolean maximized, minimized;
GtkWidget *box; GtkWidget *box;
if (priv->popup_menu) if (priv->popup_menu)
@ -6702,8 +6702,8 @@ gtk_window_do_popup_fallback (GtkWindow *window,
state = gtk_window_get_state (window); state = gtk_window_get_state (window);
iconified = (state & GDK_SURFACE_STATE_ICONIFIED) == GDK_SURFACE_STATE_ICONIFIED; minimized = (state & GDK_SURFACE_STATE_MINIMIZED) == GDK_SURFACE_STATE_MINIMIZED;
maximized = priv->maximized && !iconified; maximized = priv->maximized && !minimized;
priv->popup_menu = gtk_popover_menu_new (priv->title_box); priv->popup_menu = gtk_popover_menu_new (priv->title_box);
@ -6721,8 +6721,8 @@ gtk_window_do_popup_fallback (GtkWindow *window,
* - non-normal windows * - non-normal windows
*/ */
if ((gtk_widget_is_visible (GTK_WIDGET (window)) && if ((gtk_widget_is_visible (GTK_WIDGET (window)) &&
!(maximized || iconified)) || !(maximized || minimized)) ||
(!iconified && !priv->resizable) || (!minimized && !priv->resizable) ||
priv->type_hint != GDK_SURFACE_TYPE_HINT_NORMAL) priv->type_hint != GDK_SURFACE_TYPE_HINT_NORMAL)
gtk_widget_set_sensitive (menuitem, FALSE); gtk_widget_set_sensitive (menuitem, FALSE);
g_signal_connect (G_OBJECT (menuitem), "clicked", g_signal_connect (G_OBJECT (menuitem), "clicked",
@ -6732,7 +6732,7 @@ gtk_window_do_popup_fallback (GtkWindow *window,
menuitem = gtk_model_button_new (); menuitem = gtk_model_button_new ();
g_object_set (menuitem, "text", _("Move"), NULL); g_object_set (menuitem, "text", _("Move"), NULL);
if (maximized || iconified) if (maximized || minimized)
gtk_widget_set_sensitive (menuitem, FALSE); gtk_widget_set_sensitive (menuitem, FALSE);
g_signal_connect (G_OBJECT (menuitem), "clicked", g_signal_connect (G_OBJECT (menuitem), "clicked",
G_CALLBACK (move_window_clicked), window); G_CALLBACK (move_window_clicked), window);
@ -6741,7 +6741,7 @@ gtk_window_do_popup_fallback (GtkWindow *window,
menuitem = gtk_model_button_new (); menuitem = gtk_model_button_new ();
g_object_set (menuitem, "text", _("Resize"), NULL); g_object_set (menuitem, "text", _("Resize"), NULL);
if (!priv->resizable || maximized || iconified) if (!priv->resizable || maximized || minimized)
gtk_widget_set_sensitive (menuitem, FALSE); gtk_widget_set_sensitive (menuitem, FALSE);
g_signal_connect (G_OBJECT (menuitem), "clicked", g_signal_connect (G_OBJECT (menuitem), "clicked",
G_CALLBACK (resize_window_clicked), window); G_CALLBACK (resize_window_clicked), window);
@ -6750,7 +6750,7 @@ gtk_window_do_popup_fallback (GtkWindow *window,
menuitem = gtk_model_button_new (); menuitem = gtk_model_button_new ();
g_object_set (menuitem, "text", _("Minimize"), NULL); g_object_set (menuitem, "text", _("Minimize"), NULL);
if (iconified || if (minimized ||
priv->type_hint != GDK_SURFACE_TYPE_HINT_NORMAL) priv->type_hint != GDK_SURFACE_TYPE_HINT_NORMAL)
gtk_widget_set_sensitive (menuitem, FALSE); gtk_widget_set_sensitive (menuitem, FALSE);
g_signal_connect (G_OBJECT (menuitem), "clicked", g_signal_connect (G_OBJECT (menuitem), "clicked",
@ -7542,7 +7542,7 @@ gtk_window_present (GtkWindow *window)
* button or key press event) which triggered this call * button or key press event) which triggered this call
* *
* Presents a window to the user. This may mean raising the window * Presents a window to the user. This may mean raising the window
* in the stacking order, deiconifying it, moving it to the current * in the stacking order, unminimizing it, moving it to the current
* desktop, and/or giving it the keyboard focus, possibly dependent * desktop, and/or giving it the keyboard focus, possibly dependent
* on the users platform, window manager, and preferences. * on the users platform, window manager, and preferences.
* *
@ -7606,59 +7606,63 @@ gtk_window_present_with_time (GtkWindow *window,
} }
/** /**
* gtk_window_iconify: * gtk_window_minimize:
* @window: a #GtkWindow * @window: a #GtkWindow
* *
* Asks to iconify (i.e. minimize) the specified @window. Note that * Asks to minimize the specified @window.
* you shouldnt assume the window is definitely iconified afterward, *
* because other entities (e.g. the user or * Note that you shouldnt assume the window is definitely minimized
* [window manager][gtk-X11-arch]) could deiconify it * afterward, because the windowing system might not support this
* again, or there may not be a window manager in which case * functionality; other entities (e.g. the user or the [window manager][gtk-X11-arch])
* iconification isnt possible, etc. But normally the window will end * could unminimize it again, or there may not be a window manager in
* up iconified. Just dont write code that crashes if not. * which case minimization isnt possible, etc.
* *
* Its permitted to call this function before showing a window, * Its permitted to call this function before showing a window,
* in which case the window will be iconified before it ever appears * in which case the window will be minimized before it ever appears
* onscreen. * onscreen.
* *
* You can track iconification via the #GdkSurface::state property. * You can track result of this operation via the #GdkSurface:state
* property.
*/ */
void void
gtk_window_iconify (GtkWindow *window) gtk_window_minimize (GtkWindow *window)
{ {
GtkWindowPrivate *priv = gtk_window_get_instance_private (window); GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
g_return_if_fail (GTK_IS_WINDOW (window)); g_return_if_fail (GTK_IS_WINDOW (window));
priv->iconify_initially = TRUE; priv->minimize_initially = TRUE;
if (priv->surface) if (priv->surface)
gdk_surface_iconify (priv->surface); gdk_surface_minimize (priv->surface);
} }
/** /**
* gtk_window_deiconify: * gtk_window_unminimize:
* @window: a #GtkWindow * @window: a #GtkWindow
* *
* Asks to deiconify (i.e. unminimize) the specified @window. Note * Asks to unminimize the specified @window.
* that you shouldnt assume the window is definitely deiconified
* afterward, because other entities (e.g. the user or
* [window manager][gtk-X11-arch])) could iconify it
* again before your code which assumes deiconification gets to run.
* *
* You can track iconification via the #GdkSurface::state property. * Note that you shouldnt assume the window is definitely unminimized
**/ * afterward, because the windowing system might not support this
* functionality; other entities (e.g. the user or the [window manager][gtk-X11-arch])
* could minimize it again, or there may not be a window manager in
* which case minimization isnt possible, etc.
*
* You can track result of this operation via the #GdkSurface:state
* property.
*/
void void
gtk_window_deiconify (GtkWindow *window) gtk_window_unminimize (GtkWindow *window)
{ {
GtkWindowPrivate *priv = gtk_window_get_instance_private (window); GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
g_return_if_fail (GTK_IS_WINDOW (window)); g_return_if_fail (GTK_IS_WINDOW (window));
priv->iconify_initially = FALSE; priv->minimize_initially = FALSE;
if (priv->surface) if (priv->surface)
gdk_surface_deiconify (priv->surface); gdk_surface_unminimize (priv->surface);
} }
/** /**
@ -7675,8 +7679,9 @@ gtk_window_deiconify (GtkWindow *window)
* *
* Its permitted to call this function before showing a window. * Its permitted to call this function before showing a window.
* *
* You can track iconification via the #GdkSurface::state property. * You can track result of this operation via the #GdkSurface:state
**/ * property.
*/
void void
gtk_window_stick (GtkWindow *window) gtk_window_stick (GtkWindow *window)
{ {
@ -7701,8 +7706,9 @@ gtk_window_stick (GtkWindow *window)
* stick it again. But normally the window will * stick it again. But normally the window will
* end up stuck. Just dont write code that crashes if not. * end up stuck. Just dont write code that crashes if not.
* *
* You can track iconification via the #GdkSurface::state property. * You can track result of this operation via the #GdkSurface:state
**/ * property.
*/
void void
gtk_window_unstick (GtkWindow *window) gtk_window_unstick (GtkWindow *window)
{ {
@ -7732,9 +7738,10 @@ gtk_window_unstick (GtkWindow *window)
* in which case the window will be maximized when it appears onscreen * in which case the window will be maximized when it appears onscreen
* initially. * initially.
* *
* You can track iconification via the #GdkSurface::state property * You can track the result of this operation via the #GdkSurface:state
* or by listening to notifications on the #GtkWindow:is-maximized property. * property, or by listening to notifications on the #GtkWindow:is-maximized
**/ * property.
*/
void void
gtk_window_maximize (GtkWindow *window) gtk_window_maximize (GtkWindow *window)
{ {
@ -7759,8 +7766,10 @@ gtk_window_maximize (GtkWindow *window)
* managers honor requests to unmaximize. But normally the window will * managers honor requests to unmaximize. But normally the window will
* end up unmaximized. Just dont write code that crashes if not. * end up unmaximized. Just dont write code that crashes if not.
* *
* You can track iconification via the #GdkSurface::state property * You can track the result of this operation via the #GdkSurface:state
**/ * property, or by listening to notifications on the #GtkWindow:is-maximized
* property.
*/
void void
gtk_window_unmaximize (GtkWindow *window) gtk_window_unmaximize (GtkWindow *window)
{ {

View File

@ -266,9 +266,9 @@ GDK_AVAILABLE_IN_ALL
void gtk_window_present_with_time (GtkWindow *window, void gtk_window_present_with_time (GtkWindow *window,
guint32 timestamp); guint32 timestamp);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_window_iconify (GtkWindow *window); void gtk_window_minimize (GtkWindow *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_window_deiconify (GtkWindow *window); void gtk_window_unminimize (GtkWindow *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_window_stick (GtkWindow *window); void gtk_window_stick (GtkWindow *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL

View File

@ -4881,8 +4881,8 @@ surface_state_callback (GdkSurface *window,
msg = g_strconcat ((const char *)g_object_get_data (G_OBJECT (label), "title"), ": ", msg = g_strconcat ((const char *)g_object_get_data (G_OBJECT (label), "title"), ": ",
(new_state & GDK_SURFACE_STATE_WITHDRAWN) ? (new_state & GDK_SURFACE_STATE_WITHDRAWN) ?
"withdrawn" : "not withdrawn", ", ", "withdrawn" : "not withdrawn", ", ",
(new_state & GDK_SURFACE_STATE_ICONIFIED) ? (new_state & GDK_SURFACE_STATE_MINIMIZED) ?
"iconified" : "not iconified", ", ", "minimized" : "not minimized", ", ",
(new_state & GDK_SURFACE_STATE_STICKY) ? (new_state & GDK_SURFACE_STATE_STICKY) ?
"sticky" : "not sticky", ", ", "sticky" : "not sticky", ", ",
(new_state & GDK_SURFACE_STATE_MAXIMIZED) ? (new_state & GDK_SURFACE_STATE_MAXIMIZED) ?
@ -4924,18 +4924,18 @@ tracking_label (GtkWidget *window)
G_CALLBACK (surface_state_callback), G_CALLBACK (surface_state_callback),
label); label);
button = gtk_button_new_with_label ("Deiconify"); button = gtk_button_new_with_label ("Unminimize");
g_signal_connect_object (button, g_signal_connect_object (button,
"clicked", "clicked",
G_CALLBACK (gtk_window_deiconify), G_CALLBACK (gtk_window_unminimize),
window, window,
G_CONNECT_SWAPPED); G_CONNECT_SWAPPED);
gtk_container_add (GTK_CONTAINER (hbox), button); gtk_container_add (GTK_CONTAINER (hbox), button);
button = gtk_button_new_with_label ("Iconify"); button = gtk_button_new_with_label ("Minimize");
g_signal_connect_object (button, g_signal_connect_object (button,
"clicked", "clicked",
G_CALLBACK (gtk_window_iconify), G_CALLBACK (gtk_window_minimize),
window, window,
G_CONNECT_SWAPPED); G_CONNECT_SWAPPED);
gtk_container_add (GTK_CONTAINER (hbox), button); gtk_container_add (GTK_CONTAINER (hbox), button);
@ -5044,10 +5044,10 @@ get_state_controls (GtkWidget *window)
G_CONNECT_SWAPPED); G_CONNECT_SWAPPED);
gtk_container_add (GTK_CONTAINER (vbox), button); gtk_container_add (GTK_CONTAINER (vbox), button);
button = gtk_button_new_with_label ("Iconify"); button = gtk_button_new_with_label ("Minimize");
g_signal_connect_object (button, g_signal_connect_object (button,
"clicked", "clicked",
G_CALLBACK (gtk_window_iconify), G_CALLBACK (gtk_window_minimize),
window, window,
G_CONNECT_SWAPPED); G_CONNECT_SWAPPED);
gtk_container_add (GTK_CONTAINER (vbox), button); gtk_container_add (GTK_CONTAINER (vbox), button);
@ -5132,8 +5132,8 @@ create_surface_states (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy), G_CALLBACK (gtk_widget_destroy),
window, window,
G_CONNECT_SWAPPED); G_CONNECT_SWAPPED);
gtk_window_iconify (GTK_WINDOW (iconified)); gtk_window_minimize (GTK_WINDOW (iconified));
gtk_window_set_title (GTK_WINDOW (iconified), "Iconified initially"); gtk_window_set_title (GTK_WINDOW (iconified), "Minimized initially");
controls = get_state_controls (iconified); controls = get_state_controls (iconified);
gtk_container_add (GTK_CONTAINER (iconified), controls); gtk_container_add (GTK_CONTAINER (iconified), controls);
@ -5147,7 +5147,7 @@ create_surface_states (GtkWidget *widget)
window, window,
G_CONNECT_SWAPPED); G_CONNECT_SWAPPED);
gtk_window_set_title (GTK_WINDOW (normal), "Deiconified initially"); gtk_window_set_title (GTK_WINDOW (normal), "Unminimized initially");
controls = get_state_controls (normal); controls = get_state_controls (normal);
gtk_container_add (GTK_CONTAINER (normal), controls); gtk_container_add (GTK_CONTAINER (normal), controls);