forked from AuroraMiddleware/gtk
Merge branch 'x11-props' into 'master'
Drop X11-specific properties See merge request GNOME/gtk!1526
This commit is contained in:
commit
c6cc02637e
@ -681,9 +681,6 @@ gdk_toplevel_set_transient_for
|
||||
gdk_toplevel_set_modal
|
||||
gdk_toplevel_set_icon_list
|
||||
gdk_toplevel_show_window_menu
|
||||
gdk_toplevel_set_sticky
|
||||
gdk_toplevel_set_keep_above
|
||||
gdk_toplevel_set_keep_below
|
||||
gdk_toplevel_set_accept_focus
|
||||
gdk_toplevel_set_focus_on_map
|
||||
gdk_toplevel_set_decorated
|
||||
|
@ -635,8 +635,7 @@ gdk_broadway_surface_focus (GdkSurface *surface,
|
||||
|
||||
g_return_if_fail (GDK_IS_SURFACE (surface));
|
||||
|
||||
if (GDK_SURFACE_DESTROYED (surface) ||
|
||||
!surface->accept_focus)
|
||||
if (GDK_SURFACE_DESTROYED (surface))
|
||||
return;
|
||||
|
||||
impl = GDK_BROADWAY_SURFACE (surface);
|
||||
@ -1494,21 +1493,6 @@ gdk_broadway_toplevel_set_property (GObject *object,
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_ICON_LIST:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_STICKY:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_BELOW:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
|
||||
break;
|
||||
|
||||
@ -1551,21 +1535,6 @@ gdk_broadway_toplevel_get_property (GObject *object,
|
||||
g_value_set_pointer (value, NULL);
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_STICKY:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_BELOW:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
|
||||
break;
|
||||
|
||||
|
@ -385,8 +385,6 @@ gdk_surface_init (GdkSurface *surface)
|
||||
surface->width = 1;
|
||||
surface->height = 1;
|
||||
|
||||
surface->accept_focus = TRUE;
|
||||
surface->focus_on_map = TRUE;
|
||||
surface->alpha = 255;
|
||||
|
||||
surface->device_cursor = g_hash_table_new_full (NULL, NULL,
|
||||
|
@ -70,8 +70,6 @@ struct _GdkSurface
|
||||
|
||||
guint destroyed : 2;
|
||||
|
||||
guint accept_focus : 1;
|
||||
guint focus_on_map : 1;
|
||||
guint support_multidevice : 1;
|
||||
guint viewable : 1; /* mapped and all parents mapped */
|
||||
guint in_update : 1;
|
||||
|
@ -118,36 +118,6 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
|
||||
"Icon List",
|
||||
"The list of icon textures",
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_boolean ("sticky",
|
||||
"Sticky",
|
||||
"Whether the surface is on all workspaces",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_boolean ("keep-above",
|
||||
"Keep above",
|
||||
"Whether the surface is on above all other surfaces",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_boolean ("keep-below",
|
||||
"Keep below",
|
||||
"Whether the surface is below all other surfaces",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_boolean ("accept-focus",
|
||||
"Accept focus",
|
||||
"Whether the surface should accept keyboard focus",
|
||||
TRUE,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_boolean ("focus-on-map",
|
||||
"Focus on map",
|
||||
"Whether the surface should receive keyboard focus on map",
|
||||
TRUE,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_boolean ("decorated",
|
||||
"Decorated",
|
||||
@ -179,11 +149,6 @@ gdk_toplevel_install_properties (GObjectClass *object_class,
|
||||
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_TRANSIENT_FOR, "transient-for");
|
||||
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_MODAL, "modal");
|
||||
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_ICON_LIST, "icon-list");
|
||||
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_STICKY, "sticky");
|
||||
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_KEEP_ABOVE, "keep-above");
|
||||
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_KEEP_BELOW, "keep-below");
|
||||
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS, "accept-focus");
|
||||
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP, "focus-on-map");
|
||||
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_DECORATED, "decorated");
|
||||
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_DELETABLE, "deletable");
|
||||
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_FULLSCREEN_MODE, "fullscreen-mode");
|
||||
@ -422,90 +387,6 @@ gdk_toplevel_show_window_menu (GdkToplevel *toplevel,
|
||||
return GDK_TOPLEVEL_GET_IFACE (toplevel)->show_window_menu (toplevel, event);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_toplevel_set_sticky:
|
||||
* @toplevel: a #GdkToplevel
|
||||
* @sticky: whether to make @toplevel show on all workspaces
|
||||
*
|
||||
* Set if @surface is sticky.
|
||||
**/
|
||||
void
|
||||
gdk_toplevel_set_sticky (GdkToplevel *toplevel,
|
||||
gboolean sticky)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_TOPLEVEL (toplevel));
|
||||
|
||||
g_object_set (toplevel, "sticky", sticky, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_toplevel_set_keep_above:
|
||||
* @toplevel: a #GdkToplevel
|
||||
* @above: whether to keep @toplevel above other surfaces
|
||||
*
|
||||
* Set if @surface must be kept above other surfaces.
|
||||
**/
|
||||
void
|
||||
gdk_toplevel_set_keep_above (GdkToplevel *toplevel,
|
||||
gboolean above)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_TOPLEVEL (toplevel));
|
||||
|
||||
g_object_set (toplevel, "keep-above", above, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_toplevel_set_keep_below:
|
||||
* @toplevel: a #GdkToplevel
|
||||
* @below: whether to keep @toplevel below other surfaces
|
||||
*
|
||||
* Set if @surface must be kept below other surfaces.
|
||||
**/
|
||||
void
|
||||
gdk_toplevel_set_keep_below (GdkToplevel *toplevel,
|
||||
gboolean below)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_TOPLEVEL (toplevel));
|
||||
|
||||
g_object_set (toplevel, "keep-below", below, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_toplevel_set_accept_focus:
|
||||
* @toplevel: a #GdkToplevel
|
||||
* @accept_focus: whether @toplevel should accept keyboard focus
|
||||
*
|
||||
* Setting @accept_focus to %FALSE hints the desktop environment
|
||||
* that the surface doesn’t want to receive input focus.
|
||||
*/
|
||||
void
|
||||
gdk_toplevel_set_accept_focus (GdkToplevel *toplevel,
|
||||
gboolean accept_focus)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_TOPLEVEL (toplevel));
|
||||
|
||||
g_object_set (toplevel, "accept-focus", accept_focus, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_toplevel_set_focus_on_map:
|
||||
* @toplevel: a #GdkToplevel
|
||||
* @focus_on_map: whether @toplevel should receive input focus when mapped
|
||||
*
|
||||
* Setting @focus_on_map to %FALSE hints the desktop environment that the
|
||||
* surface doesn’t want to receive input focus when it is mapped.
|
||||
* focus_on_map should be turned off for surfaces that aren’t triggered
|
||||
* interactively (such as popups from network activity).
|
||||
*/
|
||||
void
|
||||
gdk_toplevel_set_focus_on_map (GdkToplevel *toplevel,
|
||||
gboolean focus_on_map)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_TOPLEVEL (toplevel));
|
||||
|
||||
g_object_set (toplevel, "focus-on-map", focus_on_map, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_toplevel_set_decorated:
|
||||
* @toplevel: a #GdkToplevel
|
||||
|
@ -77,25 +77,6 @@ GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_toplevel_show_window_menu (GdkToplevel *toplevel,
|
||||
GdkEvent *event);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_toplevel_set_sticky (GdkToplevel *toplevel,
|
||||
gboolean sticky);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_toplevel_set_keep_above (GdkToplevel *toplevel,
|
||||
gboolean above);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_toplevel_set_keep_below (GdkToplevel *toplevel,
|
||||
gboolean below);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_toplevel_set_accept_focus (GdkToplevel *toplevel,
|
||||
gboolean accept_focus);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_toplevel_set_focus_on_map (GdkToplevel *toplevel,
|
||||
gboolean focus_on_map);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_toplevel_set_decorated (GdkToplevel *toplevel,
|
||||
gboolean decorated);
|
||||
|
@ -31,11 +31,6 @@ typedef enum
|
||||
GDK_TOPLEVEL_PROP_TRANSIENT_FOR,
|
||||
GDK_TOPLEVEL_PROP_MODAL,
|
||||
GDK_TOPLEVEL_PROP_ICON_LIST,
|
||||
GDK_TOPLEVEL_PROP_STICKY,
|
||||
GDK_TOPLEVEL_PROP_KEEP_ABOVE,
|
||||
GDK_TOPLEVEL_PROP_KEEP_BELOW,
|
||||
GDK_TOPLEVEL_PROP_ACCEPT_FOCUS,
|
||||
GDK_TOPLEVEL_PROP_FOCUS_ON_MAP,
|
||||
GDK_TOPLEVEL_PROP_DECORATED,
|
||||
GDK_TOPLEVEL_PROP_DELETABLE,
|
||||
GDK_TOPLEVEL_PROP_FULLSCREEN_MODE,
|
||||
|
@ -4349,21 +4349,6 @@ gdk_wayland_toplevel_set_property (GObject *object,
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_ICON_LIST:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_STICKY:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_BELOW:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
|
||||
break;
|
||||
|
||||
@ -4416,21 +4401,6 @@ gdk_wayland_toplevel_get_property (GObject *object,
|
||||
g_value_set_pointer (value, NULL);
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_STICKY:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_BELOW:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
|
||||
break;
|
||||
|
||||
|
@ -2837,8 +2837,7 @@ gdk_event_translate (MSG *msg,
|
||||
|
||||
case WM_MOUSEACTIVATE:
|
||||
{
|
||||
if (GDK_IS_DRAG_SURFACE (window)
|
||||
|| !window->accept_focus)
|
||||
if (GDK_IS_DRAG_SURFACE (window))
|
||||
{
|
||||
*ret_valp = MA_NOACTIVATE;
|
||||
return_val = TRUE;
|
||||
|
@ -842,7 +842,6 @@ show_window_internal (GdkSurface *window,
|
||||
gboolean unminimize)
|
||||
{
|
||||
GdkWin32Surface *surface;
|
||||
gboolean focus_on_map = FALSE;
|
||||
DWORD exstyle;
|
||||
|
||||
if (window->destroyed)
|
||||
@ -883,9 +882,6 @@ show_window_internal (GdkSurface *window,
|
||||
|
||||
/* Other cases */
|
||||
|
||||
if (!already_mapped)
|
||||
focus_on_map = window->focus_on_map;
|
||||
|
||||
exstyle = GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE);
|
||||
|
||||
/* Use SetWindowPos to show transparent windows so automatic redraws
|
||||
@ -895,7 +891,7 @@ show_window_internal (GdkSurface *window,
|
||||
{
|
||||
UINT flags = SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER;
|
||||
|
||||
if (GDK_IS_DRAG_SURFACE (window) || !focus_on_map)
|
||||
if (GDK_IS_DRAG_SURFACE (window))
|
||||
flags |= SWP_NOACTIVATE;
|
||||
|
||||
SetWindowPos (GDK_SURFACE_HWND (window),
|
||||
@ -1035,12 +1031,9 @@ show_window_internal (GdkSurface *window,
|
||||
}
|
||||
else if (window->state & GDK_SURFACE_STATE_MINIMIZED)
|
||||
{
|
||||
if (focus_on_map)
|
||||
GtkShowWindow (window, SW_RESTORE);
|
||||
else
|
||||
GtkShowWindow (window, SW_SHOWNOACTIVATE);
|
||||
GtkShowWindow (window, SW_RESTORE);
|
||||
}
|
||||
else if (GDK_IS_DRAG_SURFACE (window) || !focus_on_map)
|
||||
else if (GDK_IS_DRAG_SURFACE (window))
|
||||
{
|
||||
if (!IsWindowVisible (GDK_SURFACE_HWND (window)))
|
||||
GtkShowWindow (window, SW_SHOWNOACTIVATE);
|
||||
@ -1387,16 +1380,12 @@ gdk_win32_surface_raise (GdkSurface *window)
|
||||
API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), HWND_TOPMOST,
|
||||
0, 0, 0, 0,
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER));
|
||||
else if (window->accept_focus)
|
||||
else
|
||||
/* Do not wrap this in an API_CALL macro as SetForegroundWindow might
|
||||
* fail when for example dragging a window belonging to a different
|
||||
* application at the time of a gtk_window_present() call due to focus
|
||||
* stealing prevention. */
|
||||
SetForegroundWindow (GDK_SURFACE_HWND (window));
|
||||
else
|
||||
API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), HWND_TOP,
|
||||
0, 0, 0, 0,
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER));
|
||||
}
|
||||
}
|
||||
|
||||
@ -4907,21 +4896,6 @@ gdk_win32_toplevel_set_property (GObject *object,
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_ICON_LIST:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_STICKY:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_BELOW:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
|
||||
break;
|
||||
|
||||
@ -4969,21 +4943,6 @@ gdk_win32_toplevel_get_property (GObject *object,
|
||||
g_value_set_pointer (value, NULL);
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_STICKY:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_BELOW:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
|
||||
break;
|
||||
|
||||
|
@ -382,20 +382,6 @@ do_net_wm_state_changes (GdkSurface *surface)
|
||||
|
||||
set = unset = 0;
|
||||
|
||||
/* For found_sticky to remain TRUE, we have to also be on desktop
|
||||
* 0xFFFFFFFF
|
||||
*/
|
||||
if (old_state & GDK_SURFACE_STATE_STICKY)
|
||||
{
|
||||
if (!(toplevel->have_sticky && toplevel->on_all_desktops))
|
||||
unset |= GDK_SURFACE_STATE_STICKY;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (toplevel->have_sticky && toplevel->on_all_desktops)
|
||||
set |= GDK_SURFACE_STATE_STICKY;
|
||||
}
|
||||
|
||||
if (old_state & GDK_SURFACE_STATE_FULLSCREEN)
|
||||
{
|
||||
if (!toplevel->have_fullscreen)
|
||||
@ -499,9 +485,6 @@ gdk_check_wm_state_changed (GdkSurface *surface)
|
||||
Atom *atoms = NULL;
|
||||
gulong i;
|
||||
|
||||
gboolean had_sticky = toplevel->have_sticky;
|
||||
|
||||
toplevel->have_sticky = FALSE;
|
||||
toplevel->have_maxvert = FALSE;
|
||||
toplevel->have_maxhorz = FALSE;
|
||||
toplevel->have_fullscreen = FALSE;
|
||||
@ -518,7 +501,6 @@ gdk_check_wm_state_changed (GdkSurface *surface)
|
||||
|
||||
if (type != None)
|
||||
{
|
||||
Atom sticky_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_STICKY");
|
||||
Atom maxvert_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_MAXIMIZED_VERT");
|
||||
Atom maxhorz_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_MAXIMIZED_HORZ");
|
||||
Atom fullscreen_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_FULLSCREEN");
|
||||
@ -530,9 +512,7 @@ gdk_check_wm_state_changed (GdkSurface *surface)
|
||||
i = 0;
|
||||
while (i < nitems)
|
||||
{
|
||||
if (atoms[i] == sticky_atom)
|
||||
toplevel->have_sticky = TRUE;
|
||||
else if (atoms[i] == maxvert_atom)
|
||||
if (atoms[i] == maxvert_atom)
|
||||
toplevel->have_maxvert = TRUE;
|
||||
else if (atoms[i] == maxhorz_atom)
|
||||
toplevel->have_maxhorz = TRUE;
|
||||
@ -553,13 +533,7 @@ gdk_check_wm_state_changed (GdkSurface *surface)
|
||||
g_intern_static_string ("_NET_WM_STATE_FOCUSED")))
|
||||
toplevel->have_focused = TRUE;
|
||||
|
||||
/* When have_sticky is turned on, we have to check the DESKTOP property
|
||||
* as well.
|
||||
*/
|
||||
if (toplevel->have_sticky && !had_sticky)
|
||||
gdk_check_wm_desktop_changed (surface);
|
||||
else
|
||||
do_net_wm_state_changes (surface);
|
||||
do_net_wm_state_changes (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1299,7 +1273,7 @@ _gdk_wm_protocols_filter (const XEvent *xevent,
|
||||
/* There is no way of knowing reliably whether we are viewable;
|
||||
* so trap errors asynchronously around the XSetInputFocus call
|
||||
*/
|
||||
if (toplevel && win->accept_focus)
|
||||
if (toplevel)
|
||||
{
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
XSetInputFocus (GDK_DISPLAY_XDISPLAY (display),
|
||||
|
@ -733,9 +733,7 @@ setup_toplevel_window (GdkSurface *surface,
|
||||
XA_WINDOW, 32, PropModeReplace,
|
||||
(guchar *) &toplevel->focus_window, 1);
|
||||
|
||||
if (!surface->focus_on_map)
|
||||
gdk_x11_surface_set_user_time (surface, 0);
|
||||
else if (GDK_X11_DISPLAY (x11_screen->display)->user_time != 0)
|
||||
if (GDK_X11_DISPLAY (x11_screen->display)->user_time != 0)
|
||||
gdk_x11_surface_set_user_time (surface, GDK_X11_DISPLAY (x11_screen->display)->user_time);
|
||||
|
||||
ensure_sync_counter (surface);
|
||||
@ -1071,7 +1069,7 @@ update_wm_hints (GdkSurface *surface,
|
||||
return;
|
||||
|
||||
wm_hints.flags = StateHint | InputHint;
|
||||
wm_hints.input = surface->accept_focus ? True : False;
|
||||
wm_hints.input = True;
|
||||
wm_hints.initial_state = NormalState;
|
||||
|
||||
if (surface->state & GDK_SURFACE_STATE_MINIMIZED)
|
||||
@ -1158,14 +1156,6 @@ set_initial_hints (GdkSurface *surface)
|
||||
++i;
|
||||
}
|
||||
|
||||
if (surface->state & GDK_SURFACE_STATE_STICKY)
|
||||
{
|
||||
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_WM_STATE_STICKY");
|
||||
++i;
|
||||
toplevel->have_sticky = TRUE;
|
||||
}
|
||||
|
||||
if (surface->state & GDK_SURFACE_STATE_FULLSCREEN)
|
||||
{
|
||||
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
@ -2639,37 +2629,6 @@ gdk_x11_surface_set_input_region (GdkSurface *surface,
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_x11_surface_set_accept_focus (GdkSurface *surface,
|
||||
gboolean accept_focus)
|
||||
{
|
||||
accept_focus = accept_focus != FALSE;
|
||||
|
||||
if (surface->accept_focus != accept_focus)
|
||||
{
|
||||
surface->accept_focus = accept_focus;
|
||||
|
||||
if (!GDK_SURFACE_DESTROYED (surface))
|
||||
update_wm_hints (surface, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_x11_surface_set_focus_on_map (GdkSurface *surface,
|
||||
gboolean focus_on_map)
|
||||
{
|
||||
focus_on_map = focus_on_map != FALSE;
|
||||
|
||||
if (surface->focus_on_map != focus_on_map)
|
||||
{
|
||||
surface->focus_on_map = focus_on_map;
|
||||
|
||||
if (!GDK_SURFACE_DESTROYED (surface) &&
|
||||
!surface->focus_on_map)
|
||||
gdk_x11_surface_set_user_time (surface, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_surface_set_user_time:
|
||||
* @surface: (type GdkX11Surface): A toplevel #GdkSurface
|
||||
@ -3057,78 +3016,6 @@ gdk_x11_surface_unminimize (GdkSurface *surface)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_x11_surface_stick (GdkSurface *surface)
|
||||
{
|
||||
if (GDK_SURFACE_DESTROYED (surface))
|
||||
return;
|
||||
|
||||
if (GDK_SURFACE_IS_MAPPED (surface))
|
||||
{
|
||||
/* "stick" means stick to all desktops _and_ do not scroll with the
|
||||
* viewport. i.e. glue to the monitor glass in all cases.
|
||||
*/
|
||||
|
||||
XClientMessageEvent xclient;
|
||||
|
||||
/* Request stick during viewport scroll */
|
||||
gdk_wmspec_change_state (TRUE, surface,
|
||||
"_NET_WM_STATE_STICKY",
|
||||
NULL);
|
||||
|
||||
/* Request desktop 0xFFFFFFFF */
|
||||
memset (&xclient, 0, sizeof (xclient));
|
||||
xclient.type = ClientMessage;
|
||||
xclient.window = GDK_SURFACE_XID (surface);
|
||||
xclient.display = GDK_SURFACE_XDISPLAY (surface);
|
||||
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (surface),
|
||||
"_NET_WM_DESKTOP");
|
||||
xclient.format = 32;
|
||||
|
||||
xclient.data.l[0] = 0xFFFFFFFF;
|
||||
xclient.data.l[1] = 0;
|
||||
xclient.data.l[2] = 0;
|
||||
xclient.data.l[3] = 0;
|
||||
xclient.data.l[4] = 0;
|
||||
|
||||
XSendEvent (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XROOTWIN (surface), False,
|
||||
SubstructureRedirectMask | SubstructureNotifyMask,
|
||||
(XEvent *)&xclient);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Flip our client side flag, the real work happens on map. */
|
||||
gdk_synthesize_surface_state (surface,
|
||||
0,
|
||||
GDK_SURFACE_STATE_STICKY);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_x11_surface_unstick (GdkSurface *surface)
|
||||
{
|
||||
if (GDK_SURFACE_DESTROYED (surface))
|
||||
return;
|
||||
|
||||
if (GDK_SURFACE_IS_MAPPED (surface))
|
||||
{
|
||||
/* Request unstick from viewport */
|
||||
gdk_wmspec_change_state (FALSE, surface,
|
||||
"_NET_WM_STATE_STICKY",
|
||||
NULL);
|
||||
|
||||
move_to_current_desktop (surface);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Flip our client side flag, the real work happens on map. */
|
||||
gdk_synthesize_surface_state (surface,
|
||||
GDK_SURFACE_STATE_STICKY,
|
||||
0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_x11_surface_maximize (GdkSurface *surface)
|
||||
{
|
||||
@ -3309,55 +3196,6 @@ gdk_x11_surface_unfullscreen (GdkSurface *surface)
|
||||
0);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_x11_surface_set_keep_above (GdkSurface *surface,
|
||||
gboolean setting)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_SURFACE (surface));
|
||||
|
||||
if (GDK_SURFACE_DESTROYED (surface))
|
||||
return;
|
||||
|
||||
if (GDK_SURFACE_IS_MAPPED (surface))
|
||||
{
|
||||
if (setting)
|
||||
gdk_wmspec_change_state (FALSE, surface,
|
||||
"_NET_WM_STATE_BELOW",
|
||||
NULL);
|
||||
gdk_wmspec_change_state (setting, surface,
|
||||
"_NET_WM_STATE_ABOVE",
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
gdk_synthesize_surface_state (surface,
|
||||
setting ? GDK_SURFACE_STATE_BELOW : GDK_SURFACE_STATE_ABOVE,
|
||||
setting ? GDK_SURFACE_STATE_ABOVE : 0);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_x11_surface_set_keep_below (GdkSurface *surface, gboolean setting)
|
||||
{
|
||||
g_return_if_fail (GDK_IS_SURFACE (surface));
|
||||
|
||||
if (GDK_SURFACE_DESTROYED (surface))
|
||||
return;
|
||||
|
||||
if (GDK_SURFACE_IS_MAPPED (surface))
|
||||
{
|
||||
if (setting)
|
||||
gdk_wmspec_change_state (FALSE, surface,
|
||||
"_NET_WM_STATE_ABOVE",
|
||||
NULL);
|
||||
gdk_wmspec_change_state (setting, surface,
|
||||
"_NET_WM_STATE_BELOW",
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
gdk_synthesize_surface_state (surface,
|
||||
setting ? GDK_SURFACE_STATE_ABOVE : GDK_SURFACE_STATE_BELOW,
|
||||
setting ? GDK_SURFACE_STATE_BELOW : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_surface_get_group:
|
||||
* @surface: The #GdkSurface
|
||||
@ -4871,34 +4709,6 @@ gdk_wayland_toplevel_set_property (GObject *object,
|
||||
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_STICKY:
|
||||
if (g_value_get_boolean (value))
|
||||
gdk_x11_surface_stick (surface);
|
||||
else
|
||||
gdk_x11_surface_unstick (surface);
|
||||
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE:
|
||||
gdk_x11_surface_set_keep_above (surface, g_value_get_boolean (value));
|
||||
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_BELOW:
|
||||
gdk_x11_surface_set_keep_below (surface, g_value_get_boolean (value));
|
||||
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
|
||||
gdk_x11_surface_set_accept_focus (surface, g_value_get_boolean (value));
|
||||
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
|
||||
gdk_x11_surface_set_focus_on_map (surface, g_value_get_boolean (value));
|
||||
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
|
||||
gdk_x11_surface_set_decorations (surface, g_value_get_boolean (value) ? GDK_DECOR_ALL : 0);
|
||||
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
|
||||
@ -4928,7 +4738,6 @@ gdk_wayland_toplevel_get_property (GObject *object,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GdkSurface *surface = GDK_SURFACE (object);
|
||||
GdkX11Surface *impl = GDK_X11_SURFACE (surface);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
@ -4956,24 +4765,6 @@ gdk_wayland_toplevel_get_property (GObject *object,
|
||||
g_value_set_pointer (value, NULL);
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_STICKY:
|
||||
g_value_set_boolean (value, impl->toplevel->have_sticky);
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE:
|
||||
g_value_set_boolean (value, (surface->state & GDK_SURFACE_STATE_ABOVE) != 0);
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_BELOW:
|
||||
g_value_set_boolean (value, (surface->state & GDK_SURFACE_STATE_BELOW) != 0);
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
|
||||
{
|
||||
GdkWMDecoration decorations = GDK_DECOR_ALL;
|
||||
@ -5008,7 +4799,7 @@ gdk_x11_toplevel_class_init (GdkX11ToplevelClass *class)
|
||||
object_class->get_property = gdk_wayland_toplevel_get_property;
|
||||
object_class->set_property = gdk_wayland_toplevel_set_property;
|
||||
|
||||
gdk_toplevel_install_properties (object_class, 1);
|
||||
gdk_toplevel_install_properties (object_class, LAST_PROP);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -116,7 +116,6 @@ struct _GdkToplevelX11
|
||||
|
||||
guint on_all_desktops : 1; /* _NET_WM_STICKY == 0xFFFFFFFF */
|
||||
|
||||
guint have_sticky : 1; /* _NET_WM_STATE_STICKY */
|
||||
guint have_maxvert : 1; /* _NET_WM_STATE_MAXIMIZED_VERT */
|
||||
guint have_maxhorz : 1; /* _NET_WM_STATE_MAXIMIZED_HORZ */
|
||||
guint have_fullscreen : 1; /* _NET_WM_STATE_FULLSCREEN */
|
||||
|
295
gtk/gtkwindow.c
295
gtk/gtkwindow.c
@ -230,15 +230,11 @@ typedef struct
|
||||
*/
|
||||
guint need_default_size : 1;
|
||||
|
||||
guint above_initially : 1;
|
||||
guint accept_focus : 1;
|
||||
guint below_initially : 1;
|
||||
guint builder_visible : 1;
|
||||
guint configure_notify_received : 1;
|
||||
guint decorated : 1;
|
||||
guint deletable : 1;
|
||||
guint destroy_with_parent : 1;
|
||||
guint focus_on_map : 1;
|
||||
guint fullscreen_initially : 1;
|
||||
guint has_user_ref_count : 1;
|
||||
guint minimize_initially : 1;
|
||||
@ -248,7 +244,6 @@ typedef struct
|
||||
guint focus_visible : 1;
|
||||
guint modal : 1;
|
||||
guint resizable : 1;
|
||||
guint stick_initially : 1;
|
||||
guint transient_parent_group : 1;
|
||||
guint gravity : 5; /* GdkGravity */
|
||||
guint csd_requested : 1;
|
||||
@ -303,8 +298,6 @@ enum {
|
||||
PROP_HIDE_ON_CLOSE,
|
||||
PROP_ICON_NAME,
|
||||
PROP_DISPLAY,
|
||||
PROP_ACCEPT_FOCUS,
|
||||
PROP_FOCUS_ON_MAP,
|
||||
PROP_DECORATED,
|
||||
PROP_DELETABLE,
|
||||
PROP_TRANSIENT_FOR,
|
||||
@ -931,30 +924,6 @@ gtk_window_class_init (GtkWindowClass *klass)
|
||||
FALSE,
|
||||
GTK_PARAM_READABLE);
|
||||
|
||||
/**
|
||||
* GtkWindow:accept-focus:
|
||||
*
|
||||
* Whether the window should receive the input focus.
|
||||
*/
|
||||
window_props[PROP_ACCEPT_FOCUS] =
|
||||
g_param_spec_boolean ("accept-focus",
|
||||
P_("Accept focus"),
|
||||
P_("TRUE if the window should receive the input focus."),
|
||||
TRUE,
|
||||
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
||||
|
||||
/**
|
||||
* GtkWindow:focus-on-map:
|
||||
*
|
||||
* Whether the window should receive the input focus when mapped.
|
||||
*/
|
||||
window_props[PROP_FOCUS_ON_MAP] =
|
||||
g_param_spec_boolean ("focus-on-map",
|
||||
P_("Focus on map"),
|
||||
P_("TRUE if the window should receive the input focus when mapped."),
|
||||
TRUE,
|
||||
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
||||
|
||||
/**
|
||||
* GtkWindow:decorated:
|
||||
*
|
||||
@ -1778,8 +1747,6 @@ gtk_window_init (GtkWindow *window)
|
||||
|
||||
priv->state = GDK_SURFACE_STATE_WITHDRAWN;
|
||||
|
||||
priv->accept_focus = TRUE;
|
||||
priv->focus_on_map = TRUE;
|
||||
priv->deletable = TRUE;
|
||||
priv->startup_id = NULL;
|
||||
priv->initial_timestamp = GDK_CURRENT_TIME;
|
||||
@ -1929,14 +1896,6 @@ gtk_window_set_property (GObject *object,
|
||||
case PROP_DISPLAY:
|
||||
gtk_window_set_display (window, g_value_get_object (value));
|
||||
break;
|
||||
case PROP_ACCEPT_FOCUS:
|
||||
gtk_window_set_accept_focus (window,
|
||||
g_value_get_boolean (value));
|
||||
break;
|
||||
case PROP_FOCUS_ON_MAP:
|
||||
gtk_window_set_focus_on_map (window,
|
||||
g_value_get_boolean (value));
|
||||
break;
|
||||
case PROP_DECORATED:
|
||||
gtk_window_set_decorated (window, g_value_get_boolean (value));
|
||||
break;
|
||||
@ -2017,14 +1976,6 @@ gtk_window_get_property (GObject *object,
|
||||
case PROP_IS_ACTIVE:
|
||||
g_value_set_boolean (value, priv->is_active);
|
||||
break;
|
||||
case PROP_ACCEPT_FOCUS:
|
||||
g_value_set_boolean (value,
|
||||
gtk_window_get_accept_focus (window));
|
||||
break;
|
||||
case PROP_FOCUS_ON_MAP:
|
||||
g_value_set_boolean (value,
|
||||
gtk_window_get_focus_on_map (window));
|
||||
break;
|
||||
case PROP_DECORATED:
|
||||
g_value_set_boolean (value, gtk_window_get_decorated (window));
|
||||
break;
|
||||
@ -3227,98 +3178,6 @@ gtk_window_set_application (GtkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_window_set_accept_focus:
|
||||
* @window: a #GtkWindow
|
||||
* @setting: %TRUE to let this window receive input focus
|
||||
*
|
||||
* Windows may set a hint asking the desktop environment not to receive
|
||||
* the input focus. This function sets this hint.
|
||||
**/
|
||||
void
|
||||
gtk_window_set_accept_focus (GtkWindow *window,
|
||||
gboolean setting)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
g_return_if_fail (GTK_IS_WINDOW (window));
|
||||
|
||||
setting = setting != FALSE;
|
||||
|
||||
if (priv->accept_focus != setting)
|
||||
{
|
||||
priv->accept_focus = setting;
|
||||
if (_gtk_widget_get_realized (GTK_WIDGET (window)))
|
||||
gdk_toplevel_set_accept_focus (GDK_TOPLEVEL (priv->surface), priv->accept_focus);
|
||||
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_ACCEPT_FOCUS]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_window_get_accept_focus:
|
||||
* @window: a #GtkWindow
|
||||
*
|
||||
* Gets the value set by gtk_window_set_accept_focus().
|
||||
*
|
||||
* Returns: %TRUE if window should receive the input focus
|
||||
**/
|
||||
gboolean
|
||||
gtk_window_get_accept_focus (GtkWindow *window)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
|
||||
|
||||
return priv->accept_focus;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_window_set_focus_on_map:
|
||||
* @window: a #GtkWindow
|
||||
* @setting: %TRUE to let this window receive input focus on map
|
||||
*
|
||||
* Windows may set a hint asking the desktop environment not to receive
|
||||
* the input focus when the window is mapped. This function sets this
|
||||
* hint.
|
||||
**/
|
||||
void
|
||||
gtk_window_set_focus_on_map (GtkWindow *window,
|
||||
gboolean setting)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
g_return_if_fail (GTK_IS_WINDOW (window));
|
||||
|
||||
setting = setting != FALSE;
|
||||
|
||||
if (priv->focus_on_map != setting)
|
||||
{
|
||||
priv->focus_on_map = setting;
|
||||
if (_gtk_widget_get_realized (GTK_WIDGET (window)))
|
||||
gdk_toplevel_set_focus_on_map (GDK_TOPLEVEL (priv->surface), priv->focus_on_map);
|
||||
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_FOCUS_ON_MAP]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_window_get_focus_on_map:
|
||||
* @window: a #GtkWindow
|
||||
*
|
||||
* Gets the value set by gtk_window_set_focus_on_map().
|
||||
*
|
||||
* Returns: %TRUE if window should receive the input focus when
|
||||
* mapped.
|
||||
**/
|
||||
gboolean
|
||||
gtk_window_get_focus_on_map (GtkWindow *window)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
|
||||
|
||||
return priv->focus_on_map;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_window_set_destroy_with_parent:
|
||||
* @window: a #GtkWindow
|
||||
@ -4790,10 +4649,6 @@ gtk_window_map (GtkWidget *widget)
|
||||
gtk_widget_get_child_visible (priv->title_box))
|
||||
gtk_widget_map (priv->title_box);
|
||||
|
||||
gdk_toplevel_set_sticky (GDK_TOPLEVEL (priv->surface), priv->stick_initially);
|
||||
gdk_toplevel_set_keep_above (GDK_TOPLEVEL (priv->surface), priv->above_initially);
|
||||
gdk_toplevel_set_keep_below (GDK_TOPLEVEL (priv->surface), priv->below_initially);
|
||||
|
||||
layout = gdk_toplevel_layout_new (1, 1);
|
||||
gdk_toplevel_layout_set_resizable (layout, priv->resizable);
|
||||
gdk_toplevel_layout_set_maximized (layout, priv->maximize_initially);
|
||||
@ -4863,9 +4718,6 @@ gtk_window_unmap (GtkWidget *widget)
|
||||
state = gdk_toplevel_get_state (GDK_TOPLEVEL (priv->surface));
|
||||
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;
|
||||
priv->below_initially = (state & GDK_SURFACE_STATE_BELOW) != 0;
|
||||
|
||||
if (priv->title_box != NULL)
|
||||
gtk_widget_unmap (priv->title_box);
|
||||
@ -5408,10 +5260,6 @@ gtk_window_realize (GtkWidget *widget)
|
||||
gdk_wayland_surface_announce_csd (surface);
|
||||
#endif
|
||||
|
||||
gdk_toplevel_set_accept_focus (GDK_TOPLEVEL (surface),
|
||||
gtk_window_get_accept_focus (window));
|
||||
gdk_toplevel_set_focus_on_map (GDK_TOPLEVEL (surface),
|
||||
gtk_window_get_focus_on_map (window));
|
||||
gdk_toplevel_set_modal (GDK_TOPLEVEL (surface), priv->modal);
|
||||
|
||||
if (priv->startup_id)
|
||||
@ -6593,7 +6441,6 @@ ontop_window_clicked (GtkModelButton *button,
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
gtk_popover_popdown (GTK_POPOVER (priv->popup_menu));
|
||||
gtk_window_set_keep_above (window, !priv->above_initially);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -6690,7 +6537,6 @@ gtk_window_do_popup_fallback (GtkWindow *window,
|
||||
g_object_set (menuitem,
|
||||
"text", _("Always on Top"),
|
||||
"role", GTK_BUTTON_ROLE_CHECK,
|
||||
"active", priv->above_initially,
|
||||
NULL);
|
||||
|
||||
if (maximized)
|
||||
@ -7559,63 +7405,6 @@ gtk_window_unminimize (GtkWindow *window)
|
||||
gtk_window_update_toplevel (window);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_window_stick:
|
||||
* @window: a #GtkWindow
|
||||
*
|
||||
* Asks to stick @window, which means that it will appear on all user
|
||||
* desktops. Note that you shouldn’t assume the window is definitely
|
||||
* stuck afterward, because other entities (e.g. the user or
|
||||
* [window manager][gtk-X11-arch] could unstick it
|
||||
* again, and some window managers do not support sticking
|
||||
* windows. But normally the window will end up stuck. Just don't
|
||||
* write code that crashes if not.
|
||||
*
|
||||
* It’s permitted to call this function before showing a window.
|
||||
*
|
||||
* You can track result of this operation via the #GdkSurface:state
|
||||
* property.
|
||||
*/
|
||||
void
|
||||
gtk_window_stick (GtkWindow *window)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
g_return_if_fail (GTK_IS_WINDOW (window));
|
||||
|
||||
priv->stick_initially = TRUE;
|
||||
|
||||
if (priv->surface)
|
||||
gdk_toplevel_set_sticky (GDK_TOPLEVEL (priv->surface), TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_window_unstick:
|
||||
* @window: a #GtkWindow
|
||||
*
|
||||
* Asks to unstick @window, which means that it will appear on only
|
||||
* one of the user’s desktops. Note that you shouldn’t assume the
|
||||
* window is definitely unstuck afterward, because other entities
|
||||
* (e.g. the user or [window manager][gtk-X11-arch]) could
|
||||
* stick it again. But normally the window will
|
||||
* end up stuck. Just don’t write code that crashes if not.
|
||||
*
|
||||
* You can track result of this operation via the #GdkSurface:state
|
||||
* property.
|
||||
*/
|
||||
void
|
||||
gtk_window_unstick (GtkWindow *window)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
g_return_if_fail (GTK_IS_WINDOW (window));
|
||||
|
||||
priv->stick_initially = FALSE;
|
||||
|
||||
if (priv->surface)
|
||||
gdk_toplevel_set_sticky (GDK_TOPLEVEL (priv->surface), FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_window_maximize:
|
||||
* @window: a #GtkWindow
|
||||
@ -7774,90 +7563,6 @@ gtk_window_unfullscreen (GtkWindow *window)
|
||||
gtk_window_update_toplevel (window);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_window_set_keep_above:
|
||||
* @window: a #GtkWindow
|
||||
* @setting: whether to keep @window above other windows
|
||||
*
|
||||
* Asks to keep @window above, so that it stays on top. Note that
|
||||
* you shouldn’t assume the window is definitely above afterward,
|
||||
* because other entities (e.g. the user or
|
||||
* [window manager][gtk-X11-arch]) could not keep it above,
|
||||
* and not all window managers support keeping windows above. But
|
||||
* normally the window will end kept above. Just don’t write code
|
||||
* that crashes if not.
|
||||
*
|
||||
* It’s permitted to call this function before showing a window,
|
||||
* in which case the window will be kept above when it appears onscreen
|
||||
* initially.
|
||||
*
|
||||
* You can track iconification via the #GdkSurface::state property
|
||||
*
|
||||
* Note that, according to the
|
||||
* [Extended Window Manager Hints Specification](http://www.freedesktop.org/Standards/wm-spec),
|
||||
* the above state is mainly meant for user preferences and should not
|
||||
* be used by applications e.g. for drawing attention to their
|
||||
* dialogs.
|
||||
**/
|
||||
void
|
||||
gtk_window_set_keep_above (GtkWindow *window,
|
||||
gboolean setting)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
g_return_if_fail (GTK_IS_WINDOW (window));
|
||||
|
||||
setting = setting != FALSE;
|
||||
|
||||
priv->above_initially = setting;
|
||||
priv->below_initially &= !setting;
|
||||
|
||||
if (priv->surface)
|
||||
gdk_toplevel_set_keep_above (GDK_TOPLEVEL (priv->surface), setting);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_window_set_keep_below:
|
||||
* @window: a #GtkWindow
|
||||
* @setting: whether to keep @window below other windows
|
||||
*
|
||||
* Asks to keep @window below, so that it stays in bottom. Note that
|
||||
* you shouldn’t assume the window is definitely below afterward,
|
||||
* because other entities (e.g. the user or
|
||||
* [window manager][gtk-X11-arch]) could not keep it below,
|
||||
* and not all window managers support putting windows below. But
|
||||
* normally the window will be kept below. Just don’t write code
|
||||
* that crashes if not.
|
||||
*
|
||||
* It’s permitted to call this function before showing a window,
|
||||
* in which case the window will be kept below when it appears onscreen
|
||||
* initially.
|
||||
*
|
||||
* You can track iconification via the #GdkSurface::state property
|
||||
*
|
||||
* Note that, according to the
|
||||
* [Extended Window Manager Hints Specification](http://www.freedesktop.org/Standards/wm-spec),
|
||||
* the above state is mainly meant for user preferences and should not
|
||||
* be used by applications e.g. for drawing attention to their
|
||||
* dialogs.
|
||||
**/
|
||||
void
|
||||
gtk_window_set_keep_below (GtkWindow *window,
|
||||
gboolean setting)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
g_return_if_fail (GTK_IS_WINDOW (window));
|
||||
|
||||
setting = setting != FALSE;
|
||||
|
||||
priv->below_initially = setting;
|
||||
priv->above_initially &= !setting;
|
||||
|
||||
if (priv->surface)
|
||||
gdk_toplevel_set_keep_below (GDK_TOPLEVEL (priv->surface), setting);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_window_set_resizable:
|
||||
* @window: a #GtkWindow
|
||||
|
@ -119,16 +119,6 @@ void gtk_window_set_transient_for (GtkWindow *window,
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GtkWindow *gtk_window_get_transient_for (GtkWindow *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_window_set_accept_focus (GtkWindow *window,
|
||||
gboolean setting);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gtk_window_get_accept_focus (GtkWindow *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_window_set_focus_on_map (GtkWindow *window,
|
||||
gboolean setting);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gtk_window_get_focus_on_map (GtkWindow *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_window_set_destroy_with_parent (GtkWindow *window,
|
||||
gboolean setting);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
@ -235,10 +225,6 @@ void gtk_window_minimize (GtkWindow *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_window_unminimize (GtkWindow *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_window_stick (GtkWindow *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_window_unstick (GtkWindow *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_window_maximize (GtkWindow *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_window_unmaximize (GtkWindow *window);
|
||||
@ -251,10 +237,6 @@ void gtk_window_fullscreen_on_monitor (GtkWindow *window,
|
||||
GdkMonitor *monitor);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_window_close (GtkWindow *window);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_window_set_keep_above (GtkWindow *window, gboolean setting);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_window_set_keep_below (GtkWindow *window, gboolean setting);
|
||||
|
||||
/* Set initial default size of the window (does not constrain user
|
||||
* resize operations)
|
||||
|
@ -4830,57 +4830,14 @@ tracking_label (GtkWidget *window)
|
||||
return hbox;
|
||||
}
|
||||
|
||||
static void
|
||||
keep_window_above (GtkToggleButton *togglebutton, gpointer data)
|
||||
{
|
||||
GtkWidget *button = g_object_get_data (G_OBJECT (togglebutton), "radio");
|
||||
|
||||
gtk_window_set_keep_above (GTK_WINDOW (data),
|
||||
gtk_toggle_button_get_active (togglebutton));
|
||||
|
||||
if (gtk_toggle_button_get_active (togglebutton))
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
keep_window_below (GtkToggleButton *togglebutton, gpointer data)
|
||||
{
|
||||
GtkWidget *button = g_object_get_data (G_OBJECT (togglebutton), "radio");
|
||||
|
||||
gtk_window_set_keep_below (GTK_WINDOW (data),
|
||||
gtk_toggle_button_get_active (togglebutton));
|
||||
|
||||
if (gtk_toggle_button_get_active (togglebutton))
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), FALSE);
|
||||
}
|
||||
|
||||
|
||||
static GtkWidget*
|
||||
get_state_controls (GtkWidget *window)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GtkWidget *button_above;
|
||||
GtkWidget *button_below;
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
|
||||
button = gtk_button_new_with_label ("Stick");
|
||||
g_signal_connect_object (button,
|
||||
"clicked",
|
||||
G_CALLBACK (gtk_window_stick),
|
||||
window,
|
||||
G_CONNECT_SWAPPED);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), button);
|
||||
|
||||
button = gtk_button_new_with_label ("Unstick");
|
||||
g_signal_connect_object (button,
|
||||
"clicked",
|
||||
G_CALLBACK (gtk_window_unstick),
|
||||
window,
|
||||
G_CONNECT_SWAPPED);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), button);
|
||||
|
||||
button = gtk_button_new_with_label ("Maximize");
|
||||
g_signal_connect_object (button,
|
||||
"clicked",
|
||||
@ -4921,23 +4878,6 @@ get_state_controls (GtkWidget *window)
|
||||
G_CONNECT_SWAPPED);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), button);
|
||||
|
||||
button_above = gtk_toggle_button_new_with_label ("Keep above");
|
||||
g_signal_connect (button_above,
|
||||
"toggled",
|
||||
G_CALLBACK (keep_window_above),
|
||||
window);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), button_above);
|
||||
|
||||
button_below = gtk_toggle_button_new_with_label ("Keep below");
|
||||
g_signal_connect (button_below,
|
||||
"toggled",
|
||||
G_CALLBACK (keep_window_below),
|
||||
window);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), button_below);
|
||||
|
||||
g_object_set_data (G_OBJECT (button_above), "radio", button_below);
|
||||
g_object_set_data (G_OBJECT (button_below), "radio", button_above);
|
||||
|
||||
button = gtk_button_new_with_label ("Hide (withdraw)");
|
||||
g_signal_connect_object (button,
|
||||
"clicked",
|
||||
|
Loading…
Reference in New Issue
Block a user