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_viewable
gdk_surface_get_state
gdk_surface_iconify
gdk_surface_deiconify
gdk_surface_minimize
gdk_surface_unminimize
gdk_surface_stick
gdk_surface_unstick
gdk_surface_maximize

View File

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

View File

@ -138,7 +138,7 @@ url="http://www.freedesktop.org/standards/">convention</ulink>.
<para>
GTK has functions for asking the window manager to do various things;
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-set-decorated">gtk_window_set_decorated()</link>.
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
gdk_broadway_surface_iconify (GdkSurface *surface)
gdk_broadway_surface_minimize (GdkSurface *surface)
{
if (GDK_SURFACE_DESTROYED (surface) ||
!SURFACE_IS_TOPLEVEL (surface))
@ -718,7 +718,7 @@ gdk_broadway_surface_iconify (GdkSurface *surface)
}
static void
gdk_broadway_surface_deiconify (GdkSurface *surface)
gdk_broadway_surface_unminimize (GdkSurface *surface)
{
if (GDK_SURFACE_DESTROYED (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_icon_list = gdk_broadway_surface_set_icon_list;
impl_class->set_icon_name = gdk_broadway_surface_set_icon_name;
impl_class->iconify = gdk_broadway_surface_iconify;
impl_class->deiconify = gdk_broadway_surface_deiconify;
impl_class->minimize = gdk_broadway_surface_minimize;
impl_class->unminimize = gdk_broadway_surface_unminimize;
impl_class->stick = gdk_broadway_surface_stick;
impl_class->unstick = gdk_broadway_surface_unstick;
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
*
* Asks to iconify (minimize) @surface. The window manager may choose
* to ignore the request, but normally will honor it. Using
* gtk_window_iconify() is preferred, if you have a #GtkWindow widget.
* Asks to minimize the @surface.
*
* 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
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
*
* Attempt to deiconify (unminimize) @surface. On X11 the window manager may
* 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.
* Asks to unminimize the @surface.
*
**/
* 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
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:
* @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_STICKY: the surface is sticky
* @GDK_SURFACE_STATE_FULLSCREEN: the surface is maximized without decorations
@ -384,7 +384,7 @@ struct _GdkGeometry
typedef enum
{
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_STICKY = 1 << 3,
GDK_SURFACE_STATE_FULLSCREEN = 1 << 4,
@ -582,9 +582,9 @@ cairo_surface_t *
GDK_AVAILABLE_IN_ALL
void gdk_surface_beep (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
void gdk_surface_iconify (GdkSurface *surface);
void gdk_surface_minimize (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
void gdk_surface_deiconify (GdkSurface *surface);
void gdk_surface_unminimize (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
void gdk_surface_stick (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL

View File

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

View File

@ -58,8 +58,7 @@
{
GdkSurface *window = [[self contentView] gdkSurface];
gdk_synthesize_surface_state (window, 0,
GDK_SURFACE_STATE_ICONIFIED);
gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_MINIMIZED);
}
-(void)windowDidDeminiaturize:(NSNotification *)aNotification
@ -68,7 +67,7 @@
_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

View File

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

View File

@ -3273,11 +3273,8 @@ gdk_wayland_surface_set_icon_name (GdkSurface *surface,
}
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) ||
!SURFACE_IS_TOPLEVEL (surface))
return;
@ -3285,6 +3282,14 @@ gdk_wayland_surface_iconify (GdkSurface *surface)
if (!is_realized_toplevel (surface))
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));
switch (display_wayland->shell_variant)
{
@ -3297,20 +3302,26 @@ gdk_wayland_surface_iconify (GdkSurface *surface)
default:
g_assert_not_reached ();
}
#endif
}
static void
gdk_wayland_surface_deiconify (GdkSurface *surface)
gdk_wayland_surface_unminimize (GdkSurface *surface)
{
if (GDK_SURFACE_DESTROYED (surface) ||
!SURFACE_IS_TOPLEVEL (surface))
return;
#if 0
if (GDK_SURFACE_IS_MAPPED (surface))
gdk_surface_show (surface);
{
gdk_surface_show (surface);
}
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
@ -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_icon_list = gdk_wayland_surface_set_icon_list;
impl_class->set_icon_name = gdk_wayland_surface_set_icon_name;
impl_class->iconify = gdk_wayland_surface_iconify;
impl_class->deiconify = gdk_wayland_surface_deiconify;
impl_class->minimize = gdk_wayland_surface_minimize;
impl_class->unminimize = gdk_wayland_surface_unminimize;
impl_class->stick = gdk_wayland_surface_stick;
impl_class->unstick = gdk_wayland_surface_unstick;
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 (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)
{
@ -3099,9 +3099,9 @@ gdk_event_translate (MSG *msg,
set_bits |= GDK_SURFACE_STATE_WITHDRAWN;
if (IsIconic (msg->hwnd))
set_bits |= GDK_SURFACE_STATE_ICONIFIED;
set_bits |= GDK_SURFACE_STATE_MINIMIZED;
else
unset_bits |= GDK_SURFACE_STATE_ICONIFIED;
unset_bits |= GDK_SURFACE_STATE_MINIMIZED;
if (IsZoomed (msg->hwnd))
set_bits |= GDK_SURFACE_STATE_MAXIMIZED;
@ -3116,15 +3116,15 @@ gdk_event_translate (MSG *msg,
* change the iconified state in all transient related windows,
* as windows doesn't give icons for transient childrens.
*/
if ((old_state & GDK_SURFACE_STATE_ICONIFIED) !=
(new_state & GDK_SURFACE_STATE_ICONIFIED))
do_show_window (window, (new_state & GDK_SURFACE_STATE_ICONIFIED));
if ((old_state & GDK_SURFACE_STATE_MINIMIZED) !=
(new_state & GDK_SURFACE_STATE_MINIMIZED))
do_show_window (window, (new_state & GDK_SURFACE_STATE_MINIMIZED));
/* When un-minimizing, make sure we're stacked under any
transient-type windows. */
if (!(old_state & GDK_SURFACE_STATE_ICONIFIED) &&
(new_state & GDK_SURFACE_STATE_ICONIFIED))
if (!(old_state & GDK_SURFACE_STATE_MINIMIZED) &&
(new_state & GDK_SURFACE_STATE_MINIMIZED))
{
ensure_stacking_on_unminimize (msg);
restack_children (window);

View File

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

View File

@ -809,8 +809,8 @@ adjust_for_gravity_hints (GdkSurface *window,
static void
show_window_internal (GdkSurface *window,
gboolean already_mapped,
gboolean deiconify)
gboolean already_mapped,
gboolean unminimize)
{
GdkWin32Surface *surface;
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_SURFACE_HWND (window),
_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.
*/
if (!deiconify &&
if (!unminimize &&
!already_mapped &&
(window->state & GDK_SURFACE_STATE_ICONIFIED))
(window->state & GDK_SURFACE_STATE_MINIMIZED))
{
GtkShowWindow (window, SW_SHOWMINNOACTIVE);
return;
}
/* 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;
/* 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
* activate. There are different calls for that.)
*/
if (deiconify && !(window->state & GDK_SURFACE_STATE_ICONIFIED))
if (unminimize && !(window->state & GDK_SURFACE_STATE_MINIMIZED))
return;
/* If asked to show (but not raise) a window that is already
* visible, do nothing.
*/
if (!deiconify && !already_mapped && IsWindowVisible (GDK_SURFACE_HWND (window)))
if (!unminimize && !already_mapped && IsWindowVisible (GDK_SURFACE_HWND (window)))
return;
/* Other cases */
@ -1005,7 +1005,7 @@ show_window_internal (GdkSurface *window,
{
GtkShowWindow (window, SW_MAXIMIZE);
}
else if (window->state & GDK_SURFACE_STATE_ICONIFIED)
else if (window->state & GDK_SURFACE_STATE_MINIMIZED)
{
if (focus_on_map)
GtkShowWindow (window, SW_RESTORE);
@ -2766,7 +2766,7 @@ _gdk_win32_surface_handle_aerosnap (GdkSurface *window,
GdkDisplay *display;
gint n_monitors;
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 halfsnapped;
GdkMonitor *monitor;
@ -2805,7 +2805,7 @@ _gdk_win32_surface_handle_aerosnap (GdkSurface *window,
else if (halfsnapped)
unsnap (window, monitor);
else if (!minimized)
gdk_surface_iconify (window);
gdk_surface_minimize (window);
break;
case GDK_WIN32_AEROSNAP_COMBO_LEFT:
if (maximized)
@ -4502,7 +4502,7 @@ gdk_win32_surface_begin_move_drag (GdkSurface *window,
* Setting window states
*/
static void
gdk_win32_surface_iconify (GdkSurface *window)
gdk_win32_surface_minimize (GdkSurface *window)
{
HWND old_active_window;
@ -4511,7 +4511,7 @@ gdk_win32_surface_iconify (GdkSurface *window)
if (GDK_SURFACE_DESTROYED (window))
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_win32_surface_state_to_string (window->state)));
@ -4525,20 +4525,20 @@ gdk_win32_surface_iconify (GdkSurface *window)
else
{
gdk_synthesize_surface_state (window,
0,
GDK_SURFACE_STATE_ICONIFIED);
0,
GDK_SURFACE_STATE_MINIMIZED);
}
}
static void
gdk_win32_surface_deiconify (GdkSurface *window)
gdk_win32_surface_unminimize (GdkSurface *window)
{
g_return_if_fail (GDK_IS_SURFACE (window));
if (GDK_SURFACE_DESTROYED (window))
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_win32_surface_state_to_string (window->state)));
@ -4549,8 +4549,8 @@ gdk_win32_surface_deiconify (GdkSurface *window)
else
{
gdk_synthesize_surface_state (window,
GDK_SURFACE_STATE_ICONIFIED,
0);
GDK_SURFACE_STATE_MINIMIZED,
0);
}
}
@ -4763,7 +4763,7 @@ gdk_win32_surface_focus (GdkSurface *window,
if (window->state & GDK_SURFACE_STATE_MAXIMIZED)
GtkShowWindow (window, SW_SHOWMAXIMIZED);
else if (window->state & GDK_SURFACE_STATE_ICONIFIED)
else if (window->state & GDK_SURFACE_STATE_MINIMIZED)
GtkShowWindow (window, SW_RESTORE);
else if (!IsWindowVisible (GDK_SURFACE_HWND (window)))
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_icon_list = gdk_win32_surface_set_icon_list;
impl_class->set_icon_name = gdk_win32_surface_set_icon_name;
impl_class->iconify = gdk_win32_surface_iconify;
impl_class->deiconify = gdk_win32_surface_deiconify;
impl_class->minimize = gdk_win32_surface_minimize;
impl_class->unminimize = gdk_win32_surface_unminimize;
impl_class->stick = gdk_win32_surface_stick;
impl_class->unstick = gdk_win32_surface_unstick;
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;
}
if (old_state & GDK_SURFACE_STATE_ICONIFIED)
if (old_state & GDK_SURFACE_STATE_MINIMIZED)
{
if (!toplevel->have_hidden)
unset |= GDK_SURFACE_STATE_ICONIFIED;
unset |= GDK_SURFACE_STATE_MINIMIZED;
}
else
{
if (toplevel->have_hidden)
set |= GDK_SURFACE_STATE_ICONIFIED;
set |= GDK_SURFACE_STATE_MINIMIZED;
}
/* 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
* 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
* the iconified bit off.
* the minimized bit off.
*/
if (GDK_SURFACE_IS_MAPPED (surface))
gdk_synthesize_surface_state (surface,
0,
GDK_SURFACE_STATE_ICONIFIED);
0,
GDK_SURFACE_STATE_MINIMIZED);
}
if (surface_impl->toplevel &&
@ -894,11 +894,11 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
if (surface && !is_substructure)
{
/* Unset iconified if it was set */
if (surface->state & GDK_SURFACE_STATE_ICONIFIED)
/* Unset minimized if it was set */
if (surface->state & GDK_SURFACE_STATE_MINIMIZED)
gdk_synthesize_surface_state (surface,
GDK_SURFACE_STATE_ICONIFIED,
0);
GDK_SURFACE_STATE_MINIMIZED,
0);
if (toplevel)
gdk_surface_thaw_updates (surface);

View File

@ -1033,7 +1033,7 @@ update_wm_hints (GdkSurface *surface,
wm_hints.input = surface->accept_focus ? True : False;
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.initial_state = IconicState;
@ -1154,7 +1154,7 @@ set_initial_hints (GdkSurface *surface)
++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,
"_NET_WM_STATE_HIDDEN");
@ -3034,7 +3034,7 @@ gdk_x11_surface_set_icon_name (GdkSurface *surface,
}
static void
gdk_x11_surface_iconify (GdkSurface *surface)
gdk_x11_surface_minimize (GdkSurface *surface)
{
if (GDK_SURFACE_DESTROYED (surface))
return;
@ -3048,9 +3048,7 @@ gdk_x11_surface_iconify (GdkSurface *surface)
else
{
/* Flip our client side flag, the real work happens on map. */
gdk_synthesize_surface_state (surface,
0,
GDK_SURFACE_STATE_ICONIFIED);
gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_MINIMIZED);
gdk_wmspec_change_state (TRUE, surface,
g_intern_static_string ("_NET_WM_STATE_HIDDEN"),
NULL);
@ -3058,7 +3056,7 @@ gdk_x11_surface_iconify (GdkSurface *surface)
}
static void
gdk_x11_surface_deiconify (GdkSurface *surface)
gdk_x11_surface_unminimize (GdkSurface *surface)
{
if (GDK_SURFACE_DESTROYED (surface))
return;
@ -3073,9 +3071,7 @@ gdk_x11_surface_deiconify (GdkSurface *surface)
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);
gdk_wmspec_change_state (FALSE, surface,
g_intern_static_string ("_NET_WM_STATE_HIDDEN"),
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_icon_list = gdk_x11_surface_set_icon_list;
impl_class->set_icon_name = gdk_x11_surface_set_icon_name;
impl_class->iconify = gdk_x11_surface_iconify;
impl_class->deiconify = gdk_x11_surface_deiconify;
impl_class->minimize = gdk_x11_surface_minimize;
impl_class->unminimize = gdk_x11_surface_unminimize;
impl_class->stick = gdk_x11_surface_stick;
impl_class->unstick = gdk_x11_surface_unstick;
impl_class->maximize = gdk_x11_surface_maximize;

View File

@ -248,7 +248,7 @@ gtk_window_accessible_ref_state_set (AtkObject *accessible)
if (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);
}
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_widget_set_can_focus (button, FALSE);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_window_iconify), window);
G_CALLBACK (gtk_window_minimize), window);
accessible = gtk_widget_get_accessible (button);
if (GTK_IS_ACCESSIBLE (accessible))

View File

@ -248,7 +248,7 @@ typedef struct
guint focus_on_map : 1;
guint fullscreen_initially : 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 maximize_initially : 1;
guint mnemonics_visible : 1;
@ -1339,7 +1339,7 @@ gtk_window_titlebar_action (GtkWindow *window,
else if (g_str_equal (action, "lower"))
gdk_surface_lower (priv->surface);
else if (g_str_equal (action, "minimize"))
gdk_surface_iconify (priv->surface);
gdk_surface_minimize (priv->surface);
else if (g_str_equal (action, "menu"))
gtk_window_do_popup (window, (GdkEventButton*) event);
else
@ -4967,10 +4967,10 @@ gtk_window_map (GtkWidget *widget)
else
gdk_surface_unstick (surface);
if (priv->iconify_initially)
gdk_surface_iconify (surface);
if (priv->minimize_initially)
gdk_surface_minimize (surface);
else
gdk_surface_deiconify (surface);
gdk_surface_unminimize (surface);
if (priv->fullscreen_initially)
{
@ -5042,7 +5042,7 @@ gtk_window_unmap (GtkWidget *widget)
priv->configure_notify_received = FALSE;
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->stick_initially = (state & GDK_SURFACE_STATE_STICKY) != 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);
if (state & GDK_SURFACE_STATE_ICONIFIED)
gtk_window_deiconify (window);
if (state & GDK_SURFACE_STATE_MINIMIZED)
gtk_window_unminimize (window);
}
static void
@ -6645,11 +6645,11 @@ minimize_window_clicked (GtkMenuItem *menuitem,
GtkWindow *window = GTK_WINDOW (user_data);
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)
gtk_window_unmaximize (window);
gtk_window_iconify (window);
gtk_window_minimize (window);
}
static void
@ -6661,8 +6661,8 @@ maximize_window_clicked (GtkMenuItem *menuitem,
state = gtk_window_get_state (window);
if (state & GDK_SURFACE_STATE_ICONIFIED)
gtk_window_deiconify (window);
if (state & GDK_SURFACE_STATE_MINIMIZED)
gtk_window_unminimize (window);
gtk_window_maximize (window);
}
@ -6694,7 +6694,7 @@ gtk_window_do_popup_fallback (GtkWindow *window,
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
GtkWidget *menuitem;
GdkSurfaceState state;
gboolean maximized, iconified;
gboolean maximized, minimized;
GtkWidget *box;
if (priv->popup_menu)
@ -6702,8 +6702,8 @@ gtk_window_do_popup_fallback (GtkWindow *window,
state = gtk_window_get_state (window);
iconified = (state & GDK_SURFACE_STATE_ICONIFIED) == GDK_SURFACE_STATE_ICONIFIED;
maximized = priv->maximized && !iconified;
minimized = (state & GDK_SURFACE_STATE_MINIMIZED) == GDK_SURFACE_STATE_MINIMIZED;
maximized = priv->maximized && !minimized;
priv->popup_menu = gtk_popover_menu_new (priv->title_box);
@ -6721,8 +6721,8 @@ gtk_window_do_popup_fallback (GtkWindow *window,
* - non-normal windows
*/
if ((gtk_widget_is_visible (GTK_WIDGET (window)) &&
!(maximized || iconified)) ||
(!iconified && !priv->resizable) ||
!(maximized || minimized)) ||
(!minimized && !priv->resizable) ||
priv->type_hint != GDK_SURFACE_TYPE_HINT_NORMAL)
gtk_widget_set_sensitive (menuitem, FALSE);
g_signal_connect (G_OBJECT (menuitem), "clicked",
@ -6732,7 +6732,7 @@ gtk_window_do_popup_fallback (GtkWindow *window,
menuitem = gtk_model_button_new ();
g_object_set (menuitem, "text", _("Move"), NULL);
if (maximized || iconified)
if (maximized || minimized)
gtk_widget_set_sensitive (menuitem, FALSE);
g_signal_connect (G_OBJECT (menuitem), "clicked",
G_CALLBACK (move_window_clicked), window);
@ -6741,7 +6741,7 @@ gtk_window_do_popup_fallback (GtkWindow *window,
menuitem = gtk_model_button_new ();
g_object_set (menuitem, "text", _("Resize"), NULL);
if (!priv->resizable || maximized || iconified)
if (!priv->resizable || maximized || minimized)
gtk_widget_set_sensitive (menuitem, FALSE);
g_signal_connect (G_OBJECT (menuitem), "clicked",
G_CALLBACK (resize_window_clicked), window);
@ -6750,7 +6750,7 @@ gtk_window_do_popup_fallback (GtkWindow *window,
menuitem = gtk_model_button_new ();
g_object_set (menuitem, "text", _("Minimize"), NULL);
if (iconified ||
if (minimized ||
priv->type_hint != GDK_SURFACE_TYPE_HINT_NORMAL)
gtk_widget_set_sensitive (menuitem, FALSE);
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
*
* 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
* 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
*
* Asks to iconify (i.e. minimize) the specified @window. Note that
* you shouldnt assume the window is definitely iconified afterward,
* because other entities (e.g. the user or
* [window manager][gtk-X11-arch]) could deiconify it
* again, or there may not be a window manager in which case
* iconification isnt possible, etc. But normally the window will end
* up iconified. Just dont write code that crashes if not.
* Asks to minimize the specified @window.
*
* Note that you shouldnt assume the window is definitely minimized
* afterward, because the windowing system might not support this
* functionality; other entities (e.g. the user or the [window manager][gtk-X11-arch])
* could unminimize it again, or there may not be a window manager in
* which case minimization isnt possible, etc.
*
* 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.
*
* You can track iconification via the #GdkSurface::state property.
* You can track result of this operation via the #GdkSurface:state
* property.
*/
void
gtk_window_iconify (GtkWindow *window)
gtk_window_minimize (GtkWindow *window)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
g_return_if_fail (GTK_IS_WINDOW (window));
priv->iconify_initially = TRUE;
priv->minimize_initially = TRUE;
if (priv->surface)
gdk_surface_iconify (priv->surface);
gdk_surface_minimize (priv->surface);
}
/**
* gtk_window_deiconify:
* gtk_window_unminimize:
* @window: a #GtkWindow
*
* Asks to deiconify (i.e. unminimize) the specified @window. Note
* 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.
* Asks to unminimize the specified @window.
*
* 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
gtk_window_deiconify (GtkWindow *window)
gtk_window_unminimize (GtkWindow *window)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
g_return_if_fail (GTK_IS_WINDOW (window));
priv->iconify_initially = FALSE;
priv->minimize_initially = FALSE;
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.
*
* You can track iconification via the #GdkSurface::state property.
**/
* You can track result of this operation via the #GdkSurface:state
* property.
*/
void
gtk_window_stick (GtkWindow *window)
{
@ -7701,8 +7706,9 @@ gtk_window_stick (GtkWindow *window)
* stick it again. But normally the window will
* 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
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
* initially.
*
* You can track iconification via the #GdkSurface::state property
* or by listening to notifications on the #GtkWindow:is-maximized 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
gtk_window_maximize (GtkWindow *window)
{
@ -7759,8 +7766,10 @@ gtk_window_maximize (GtkWindow *window)
* managers honor requests to unmaximize. But normally the window will
* 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
gtk_window_unmaximize (GtkWindow *window)
{

View File

@ -266,9 +266,9 @@ GDK_AVAILABLE_IN_ALL
void gtk_window_present_with_time (GtkWindow *window,
guint32 timestamp);
GDK_AVAILABLE_IN_ALL
void gtk_window_iconify (GtkWindow *window);
void gtk_window_minimize (GtkWindow *window);
GDK_AVAILABLE_IN_ALL
void gtk_window_deiconify (GtkWindow *window);
void gtk_window_unminimize (GtkWindow *window);
GDK_AVAILABLE_IN_ALL
void gtk_window_stick (GtkWindow *window);
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"), ": ",
(new_state & GDK_SURFACE_STATE_WITHDRAWN) ?
"withdrawn" : "not withdrawn", ", ",
(new_state & GDK_SURFACE_STATE_ICONIFIED) ?
"iconified" : "not iconified", ", ",
(new_state & GDK_SURFACE_STATE_MINIMIZED) ?
"minimized" : "not minimized", ", ",
(new_state & GDK_SURFACE_STATE_STICKY) ?
"sticky" : "not sticky", ", ",
(new_state & GDK_SURFACE_STATE_MAXIMIZED) ?
@ -4924,18 +4924,18 @@ tracking_label (GtkWidget *window)
G_CALLBACK (surface_state_callback),
label);
button = gtk_button_new_with_label ("Deiconify");
button = gtk_button_new_with_label ("Unminimize");
g_signal_connect_object (button,
"clicked",
G_CALLBACK (gtk_window_deiconify),
G_CALLBACK (gtk_window_unminimize),
window,
G_CONNECT_SWAPPED);
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,
"clicked",
G_CALLBACK (gtk_window_iconify),
G_CALLBACK (gtk_window_minimize),
window,
G_CONNECT_SWAPPED);
gtk_container_add (GTK_CONTAINER (hbox), button);
@ -5044,10 +5044,10 @@ get_state_controls (GtkWidget *window)
G_CONNECT_SWAPPED);
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,
"clicked",
G_CALLBACK (gtk_window_iconify),
G_CALLBACK (gtk_window_minimize),
window,
G_CONNECT_SWAPPED);
gtk_container_add (GTK_CONTAINER (vbox), button);
@ -5132,8 +5132,8 @@ create_surface_states (GtkWidget *widget)
G_CALLBACK (gtk_widget_destroy),
window,
G_CONNECT_SWAPPED);
gtk_window_iconify (GTK_WINDOW (iconified));
gtk_window_set_title (GTK_WINDOW (iconified), "Iconified initially");
gtk_window_minimize (GTK_WINDOW (iconified));
gtk_window_set_title (GTK_WINDOW (iconified), "Minimized initially");
controls = get_state_controls (iconified);
gtk_container_add (GTK_CONTAINER (iconified), controls);
@ -5147,7 +5147,7 @@ create_surface_states (GtkWidget *widget)
window,
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);
gtk_container_add (GTK_CONTAINER (normal), controls);