forked from AuroraMiddleware/gtk
gdk: Rename GdkSurfaceState to GdkToplevelState
That is what it is. Fixes: #2790
This commit is contained in:
parent
cee275980a
commit
93078e52c0
@ -472,11 +472,11 @@ static void
|
||||
surface_state_changed (GtkWidget *widget)
|
||||
{
|
||||
DemoApplicationWindow *window = (DemoApplicationWindow *)widget;
|
||||
GdkSurfaceState new_state;
|
||||
GdkToplevelState new_state;
|
||||
|
||||
new_state = gdk_toplevel_get_state (GDK_TOPLEVEL (gtk_native_get_surface (GTK_NATIVE (widget))));
|
||||
window->maximized = (new_state & GDK_SURFACE_STATE_MAXIMIZED) != 0;
|
||||
window->fullscreen = (new_state & GDK_SURFACE_STATE_FULLSCREEN) != 0;
|
||||
window->maximized = (new_state & GDK_TOPLEVEL_STATE_MAXIMIZED) != 0;
|
||||
window->fullscreen = (new_state & GDK_TOPLEVEL_STATE_FULLSCREEN) != 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -172,7 +172,6 @@ gdk_rgba_get_type
|
||||
GdkSurface
|
||||
GdkGravity
|
||||
GdkSurfaceEdge
|
||||
GdkSurfaceState
|
||||
gdk_surface_new_toplevel
|
||||
gdk_surface_new_popup
|
||||
gdk_surface_destroy
|
||||
@ -224,7 +223,7 @@ GDK_TYPE_SURFACE_TYPE
|
||||
GDK_TYPE_SURFACE_TYPE_HINT
|
||||
GDK_TYPE_WM_DECORATION
|
||||
GDK_TYPE_WM_FUNCTION
|
||||
GDK_TYPE_SURFACE_STATE
|
||||
GDK_TYPE_TOPLEVEL_STATE
|
||||
|
||||
<SUBSECTION Private>
|
||||
gdk_surface_get_type
|
||||
@ -655,6 +654,7 @@ gdk_toplevel_size_get_type
|
||||
<FILE>gdktoplevel</FILE>
|
||||
<TITLE>GdkToplevel</TITLE>
|
||||
GdkToplevel
|
||||
GdkToplevelState
|
||||
GdkFullscreenMode
|
||||
gdk_toplevel_present
|
||||
gdk_toplevel_minimize
|
||||
|
@ -274,8 +274,8 @@ gdk_toplevel_begin_resize().
|
||||
|
||||
### The "iconified" window state has been renamed to "minimized"
|
||||
|
||||
The %GDK_SURFACE_STATE_ICONIFIED value of the
|
||||
#GdkSurfaceState enumeration is now %GDK_SURFACE_STATE_MINIMIZED.
|
||||
The %GDK_TOPLEVEL_STATE_ICONIFIED value of the #GdkSurfaceState enumeration
|
||||
is now %GDK_TOPLEVEL_STATE_MINIMIZED in the #GdkToplevelState enumeration.
|
||||
|
||||
The #GdkWindow functions <function>gdk_window_iconify()</function>
|
||||
and <function>gdk_window_deiconify()</function> have been renamed to
|
||||
|
@ -596,7 +596,7 @@ gdk_broadway_surface_layout_popup (GdkSurface *surface,
|
||||
static void
|
||||
show_popup (GdkSurface *surface)
|
||||
{
|
||||
gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_WITHDRAWN, 0);
|
||||
gdk_synthesize_surface_state (surface, GDK_TOPLEVEL_STATE_WITHDRAWN, 0);
|
||||
gdk_broadway_surface_show (surface, FALSE);
|
||||
gdk_surface_invalidate_rect (surface, NULL);
|
||||
}
|
||||
@ -797,7 +797,7 @@ gdk_broadway_surface_maximize (GdkSurface *surface)
|
||||
|
||||
impl->maximized = TRUE;
|
||||
|
||||
gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_MAXIMIZED);
|
||||
gdk_synthesize_surface_state (surface, 0, GDK_TOPLEVEL_STATE_MAXIMIZED);
|
||||
|
||||
impl->pre_maximize_x = surface->x;
|
||||
impl->pre_maximize_y = surface->y;
|
||||
@ -827,7 +827,7 @@ gdk_broadway_surface_unmaximize (GdkSurface *surface)
|
||||
|
||||
impl->maximized = FALSE;
|
||||
|
||||
gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_MAXIMIZED, 0);
|
||||
gdk_synthesize_surface_state (surface, GDK_TOPLEVEL_STATE_MAXIMIZED, 0);
|
||||
|
||||
gdk_broadway_surface_move_resize (surface,
|
||||
impl->pre_maximize_x,
|
||||
@ -1513,7 +1513,7 @@ show_surface (GdkSurface *surface)
|
||||
was_mapped = GDK_SURFACE_IS_MAPPED (surface);
|
||||
|
||||
if (!was_mapped)
|
||||
gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_WITHDRAWN, 0);
|
||||
gdk_synthesize_surface_state (surface, GDK_TOPLEVEL_STATE_WITHDRAWN, 0);
|
||||
|
||||
gdk_broadway_surface_show (surface, FALSE);
|
||||
|
||||
|
@ -462,7 +462,7 @@ gdk_surface_init (GdkSurface *surface)
|
||||
{
|
||||
/* 0-initialization is good for all other fields. */
|
||||
|
||||
surface->state = GDK_SURFACE_STATE_WITHDRAWN;
|
||||
surface->state = GDK_TOPLEVEL_STATE_WITHDRAWN;
|
||||
surface->fullscreen_mode = GDK_FULLSCREEN_ON_CURRENT_MONITOR;
|
||||
surface->width = 1;
|
||||
surface->height = 1;
|
||||
@ -730,7 +730,7 @@ gdk_surface_set_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
#define GDK_SURFACE_IS_STICKY(surface) (((surface)->state & GDK_SURFACE_STATE_STICKY))
|
||||
#define GDK_SURFACE_IS_STICKY(surface) (((surface)->state & GDK_TOPLEVEL_STATE_STICKY))
|
||||
|
||||
static void
|
||||
gdk_surface_get_property (GObject *object,
|
||||
@ -935,7 +935,7 @@ _gdk_surface_destroy_hierarchy (GdkSurface *surface,
|
||||
|
||||
_gdk_surface_clear_update_area (surface);
|
||||
|
||||
surface->state |= GDK_SURFACE_STATE_WITHDRAWN;
|
||||
surface->state |= GDK_TOPLEVEL_STATE_WITHDRAWN;
|
||||
surface->destroyed = TRUE;
|
||||
|
||||
surface_remove_from_pointer_info (surface, surface->display);
|
||||
@ -1686,7 +1686,7 @@ gdk_surface_hide (GdkSurface *surface)
|
||||
was_mapped = GDK_SURFACE_IS_MAPPED (surface);
|
||||
|
||||
if (GDK_SURFACE_IS_MAPPED (surface))
|
||||
gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_WITHDRAWN);
|
||||
gdk_synthesize_surface_state (surface, 0, GDK_TOPLEVEL_STATE_WITHDRAWN);
|
||||
|
||||
if (was_mapped)
|
||||
{
|
||||
@ -2632,7 +2632,7 @@ gdk_surface_set_shadow_width (GdkSurface *surface,
|
||||
|
||||
void
|
||||
gdk_surface_set_state (GdkSurface *surface,
|
||||
GdkSurfaceState new_state)
|
||||
GdkToplevelState new_state)
|
||||
{
|
||||
gboolean was_mapped, mapped;
|
||||
gboolean was_sticky, sticky;
|
||||
@ -2665,9 +2665,9 @@ gdk_surface_set_state (GdkSurface *surface,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_synthesize_surface_state (GdkSurface *surface,
|
||||
GdkSurfaceState unset_flags,
|
||||
GdkSurfaceState set_flags)
|
||||
gdk_synthesize_surface_state (GdkSurface *surface,
|
||||
GdkToplevelState unset_flags,
|
||||
GdkToplevelState set_flags)
|
||||
{
|
||||
gdk_surface_set_state (surface, (surface->state | set_flags) & ~unset_flags);
|
||||
}
|
||||
|
@ -59,8 +59,8 @@ struct _GdkSurface
|
||||
more than we have to, but it represents the "true" damage. */
|
||||
cairo_region_t *active_update_area;
|
||||
|
||||
GdkSurfaceState old_state;
|
||||
GdkSurfaceState state;
|
||||
GdkToplevelState old_state;
|
||||
GdkToplevelState state;
|
||||
|
||||
guint8 resize_count;
|
||||
|
||||
@ -173,11 +173,11 @@ struct _GdkSurfaceClass
|
||||
|
||||
#define GDK_SURFACE_DESTROYED(d) (((GdkSurface *)(d))->destroyed)
|
||||
|
||||
#define GDK_SURFACE_IS_MAPPED(surface) (((surface)->state & GDK_SURFACE_STATE_WITHDRAWN) == 0)
|
||||
#define GDK_SURFACE_IS_MAPPED(surface) (((surface)->state & GDK_TOPLEVEL_STATE_WITHDRAWN) == 0)
|
||||
|
||||
|
||||
void gdk_surface_set_state (GdkSurface *surface,
|
||||
GdkSurfaceState new_state);
|
||||
GdkToplevelState new_state);
|
||||
|
||||
GdkMonitor * gdk_surface_get_layout_monitor (GdkSurface *surface,
|
||||
GdkPopupLayout *layout,
|
||||
@ -283,8 +283,8 @@ GdkSurface * gdk_surface_new_temp (GdkDisplay *display,
|
||||
void gdk_surface_destroy_notify (GdkSurface *surface);
|
||||
|
||||
void gdk_synthesize_surface_state (GdkSurface *surface,
|
||||
GdkSurfaceState unset_flags,
|
||||
GdkSurfaceState set_flags);
|
||||
GdkToplevelState unset_flags,
|
||||
GdkToplevelState set_flags);
|
||||
|
||||
void gdk_surface_get_root_coords (GdkSurface *surface,
|
||||
int x,
|
||||
|
@ -118,7 +118,7 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
|
||||
g_param_spec_flags ("state",
|
||||
P_("State"),
|
||||
P_("State"),
|
||||
GDK_TYPE_SURFACE_STATE, GDK_SURFACE_STATE_WITHDRAWN,
|
||||
GDK_TYPE_TOPLEVEL_STATE, GDK_TOPLEVEL_STATE_WITHDRAWN,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_string ("title",
|
||||
@ -307,14 +307,14 @@ gdk_toplevel_focus (GdkToplevel *toplevel,
|
||||
* @toplevel: a #GdkToplevel
|
||||
*
|
||||
* Gets the bitwise OR of the currently active surface state flags,
|
||||
* from the #GdkSurfaceState enumeration.
|
||||
* from the #GdkToplevelState enumeration.
|
||||
*
|
||||
* Returns: surface state bitfield
|
||||
*/
|
||||
GdkSurfaceState
|
||||
GdkToplevelState
|
||||
gdk_toplevel_get_state (GdkToplevel *toplevel)
|
||||
{
|
||||
GdkSurfaceState state;
|
||||
GdkToplevelState state;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_TOPLEVEL (toplevel), 0);
|
||||
|
||||
|
@ -45,52 +45,52 @@ typedef enum
|
||||
} GdkFullscreenMode;
|
||||
|
||||
/**
|
||||
* GdkSurfaceState:
|
||||
* @GDK_SURFACE_STATE_WITHDRAWN: the surface is not shown
|
||||
* @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
|
||||
* @GDK_SURFACE_STATE_ABOVE: the surface is kept above other surfaces
|
||||
* @GDK_SURFACE_STATE_BELOW: the surface is kept below other surfaces
|
||||
* @GDK_SURFACE_STATE_FOCUSED: the surface is presented as focused (with active decorations)
|
||||
* @GDK_SURFACE_STATE_TILED: the surface is in a tiled state
|
||||
* @GDK_SURFACE_STATE_TOP_TILED: whether the top edge is tiled
|
||||
* @GDK_SURFACE_STATE_TOP_RESIZABLE: whether the top edge is resizable
|
||||
* @GDK_SURFACE_STATE_RIGHT_TILED: whether the right edge is tiled
|
||||
* @GDK_SURFACE_STATE_RIGHT_RESIZABLE: whether the right edge is resizable
|
||||
* @GDK_SURFACE_STATE_BOTTOM_TILED: whether the bottom edge is tiled
|
||||
* @GDK_SURFACE_STATE_BOTTOM_RESIZABLE: whether the bottom edge is resizable
|
||||
* @GDK_SURFACE_STATE_LEFT_TILED: whether the left edge is tiled
|
||||
* @GDK_SURFACE_STATE_LEFT_RESIZABLE: whether the left edge is resizable
|
||||
* GdkToplevelState:
|
||||
* @GDK_TOPLEVEL_STATE_WITHDRAWN: the surface is not shown
|
||||
* @GDK_TOPLEVEL_STATE_MINIMIZED: the surface is minimized
|
||||
* @GDK_TOPLEVEL_STATE_MAXIMIZED: the surface is maximized
|
||||
* @GDK_TOPLEVEL_STATE_STICKY: the surface is sticky
|
||||
* @GDK_TOPLEVEL_STATE_FULLSCREEN: the surface is maximized without decorations
|
||||
* @GDK_TOPLEVEL_STATE_ABOVE: the surface is kept above other surfaces
|
||||
* @GDK_TOPLEVEL_STATE_BELOW: the surface is kept below other surfaces
|
||||
* @GDK_TOPLEVEL_STATE_FOCUSED: the surface is presented as focused (with active decorations)
|
||||
* @GDK_TOPLEVEL_STATE_TILED: the surface is in a tiled state
|
||||
* @GDK_TOPLEVEL_STATE_TOP_TILED: whether the top edge is tiled
|
||||
* @GDK_TOPLEVEL_STATE_TOP_RESIZABLE: whether the top edge is resizable
|
||||
* @GDK_TOPLEVEL_STATE_RIGHT_TILED: whether the right edge is tiled
|
||||
* @GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE: whether the right edge is resizable
|
||||
* @GDK_TOPLEVEL_STATE_BOTTOM_TILED: whether the bottom edge is tiled
|
||||
* @GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE: whether the bottom edge is resizable
|
||||
* @GDK_TOPLEVEL_STATE_LEFT_TILED: whether the left edge is tiled
|
||||
* @GDK_TOPLEVEL_STATE_LEFT_RESIZABLE: whether the left edge is resizable
|
||||
*
|
||||
* Specifies the state of a toplevel surface.
|
||||
*
|
||||
* On platforms that support information about individual edges, the %GDK_SURFACE_STATE_TILED
|
||||
* On platforms that support information about individual edges, the %GDK_TOPLEVEL_STATE_TILED
|
||||
* state will be set whenever any of the individual tiled states is set. On platforms
|
||||
* that lack that support, the tiled state will give an indication of tiledness without
|
||||
* any of the per-edge states being set.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_SURFACE_STATE_WITHDRAWN = 1 << 0,
|
||||
GDK_SURFACE_STATE_MINIMIZED = 1 << 1,
|
||||
GDK_SURFACE_STATE_MAXIMIZED = 1 << 2,
|
||||
GDK_SURFACE_STATE_STICKY = 1 << 3,
|
||||
GDK_SURFACE_STATE_FULLSCREEN = 1 << 4,
|
||||
GDK_SURFACE_STATE_ABOVE = 1 << 5,
|
||||
GDK_SURFACE_STATE_BELOW = 1 << 6,
|
||||
GDK_SURFACE_STATE_FOCUSED = 1 << 7,
|
||||
GDK_SURFACE_STATE_TILED = 1 << 8,
|
||||
GDK_SURFACE_STATE_TOP_TILED = 1 << 9,
|
||||
GDK_SURFACE_STATE_TOP_RESIZABLE = 1 << 10,
|
||||
GDK_SURFACE_STATE_RIGHT_TILED = 1 << 11,
|
||||
GDK_SURFACE_STATE_RIGHT_RESIZABLE = 1 << 12,
|
||||
GDK_SURFACE_STATE_BOTTOM_TILED = 1 << 13,
|
||||
GDK_SURFACE_STATE_BOTTOM_RESIZABLE = 1 << 14,
|
||||
GDK_SURFACE_STATE_LEFT_TILED = 1 << 15,
|
||||
GDK_SURFACE_STATE_LEFT_RESIZABLE = 1 << 16
|
||||
} GdkSurfaceState;
|
||||
GDK_TOPLEVEL_STATE_WITHDRAWN = 1 << 0,
|
||||
GDK_TOPLEVEL_STATE_MINIMIZED = 1 << 1,
|
||||
GDK_TOPLEVEL_STATE_MAXIMIZED = 1 << 2,
|
||||
GDK_TOPLEVEL_STATE_STICKY = 1 << 3,
|
||||
GDK_TOPLEVEL_STATE_FULLSCREEN = 1 << 4,
|
||||
GDK_TOPLEVEL_STATE_ABOVE = 1 << 5,
|
||||
GDK_TOPLEVEL_STATE_BELOW = 1 << 6,
|
||||
GDK_TOPLEVEL_STATE_FOCUSED = 1 << 7,
|
||||
GDK_TOPLEVEL_STATE_TILED = 1 << 8,
|
||||
GDK_TOPLEVEL_STATE_TOP_TILED = 1 << 9,
|
||||
GDK_TOPLEVEL_STATE_TOP_RESIZABLE = 1 << 10,
|
||||
GDK_TOPLEVEL_STATE_RIGHT_TILED = 1 << 11,
|
||||
GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE = 1 << 12,
|
||||
GDK_TOPLEVEL_STATE_BOTTOM_TILED = 1 << 13,
|
||||
GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE = 1 << 14,
|
||||
GDK_TOPLEVEL_STATE_LEFT_TILED = 1 << 15,
|
||||
GDK_TOPLEVEL_STATE_LEFT_RESIZABLE = 1 << 16
|
||||
} GdkToplevelState;
|
||||
|
||||
|
||||
#define GDK_TYPE_TOPLEVEL (gdk_toplevel_get_type ())
|
||||
@ -113,7 +113,7 @@ void gdk_toplevel_focus (GdkToplevel *toplevel,
|
||||
guint32 timestamp);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkSurfaceState gdk_toplevel_get_state (GdkToplevel *toplevel);
|
||||
GdkToplevelState gdk_toplevel_get_state (GdkToplevel *toplevel);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_toplevel_set_title (GdkToplevel *toplevel,
|
||||
|
@ -62,7 +62,7 @@
|
||||
|
||||
-(void)windowDidMiniaturize:(NSNotification *)aNotification
|
||||
{
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (gdk_surface), 0, GDK_SURFACE_STATE_MINIMIZED);
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (gdk_surface), 0, GDK_TOPLEVEL_STATE_MINIMIZED);
|
||||
}
|
||||
|
||||
-(void)windowDidDeminiaturize:(NSNotification *)aNotification
|
||||
@ -72,18 +72,18 @@
|
||||
else if (GDK_IS_MACOS_POPUP_SURFACE (gdk_surface))
|
||||
_gdk_macos_popup_surface_attach_to_parent (GDK_MACOS_POPUP_SURFACE (gdk_surface));
|
||||
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (gdk_surface), GDK_SURFACE_STATE_MINIMIZED, 0);
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (gdk_surface), GDK_TOPLEVEL_STATE_MINIMIZED, 0);
|
||||
}
|
||||
|
||||
-(void)windowDidBecomeKey:(NSNotification *)aNotification
|
||||
{
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (gdk_surface), 0, GDK_SURFACE_STATE_FOCUSED);
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (gdk_surface), 0, GDK_TOPLEVEL_STATE_FOCUSED);
|
||||
_gdk_macos_display_surface_became_key ([self gdkDisplay], gdk_surface);
|
||||
}
|
||||
|
||||
-(void)windowDidResignKey:(NSNotification *)aNotification
|
||||
{
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (gdk_surface), GDK_SURFACE_STATE_FOCUSED, 0);
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (gdk_surface), GDK_TOPLEVEL_STATE_FOCUSED, 0);
|
||||
_gdk_macos_display_surface_resigned_key ([self gdkDisplay], gdk_surface);
|
||||
}
|
||||
|
||||
@ -193,7 +193,7 @@
|
||||
{
|
||||
NSWindowStyleMask style_mask = [self styleMask];
|
||||
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (gdk_surface), GDK_SURFACE_STATE_MAXIMIZED, 0);
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (gdk_surface), GDK_TOPLEVEL_STATE_MAXIMIZED, 0);
|
||||
|
||||
/* If we are using CSD, then we transitioned to an opaque
|
||||
* window while we were maximized. Now we need to drop that
|
||||
@ -206,7 +206,7 @@
|
||||
-(void)windowDidMove:(NSNotification *)aNotification
|
||||
{
|
||||
GdkSurface *surface = GDK_SURFACE (gdk_surface);
|
||||
gboolean maximized = (surface->state & GDK_SURFACE_STATE_MAXIMIZED) != 0;
|
||||
gboolean maximized = (surface->state & GDK_TOPLEVEL_STATE_MAXIMIZED) != 0;
|
||||
|
||||
/* In case the window is changed when maximized remove the maximized state */
|
||||
if (maximized && !inMaximizeTransition && !NSEqualRects (lastMaximizedFrame, [self frame]))
|
||||
@ -231,7 +231,7 @@
|
||||
display = gdk_surface_get_display (surface);
|
||||
|
||||
content_rect = [self contentRectForFrameRect:[self frame]];
|
||||
maximized = (surface->state & GDK_SURFACE_STATE_MAXIMIZED) != 0;
|
||||
maximized = (surface->state & GDK_TOPLEVEL_STATE_MAXIMIZED) != 0;
|
||||
|
||||
/* see same in windowDidMove */
|
||||
if (maximized && !inMaximizeTransition && !NSEqualRects (lastMaximizedFrame, [self frame]))
|
||||
@ -627,7 +627,7 @@
|
||||
{
|
||||
NSRect screenFrame = [[self screen] visibleFrame];
|
||||
GdkMacosSurface *surface = gdk_surface;
|
||||
gboolean maximized = GDK_SURFACE (surface)->state & GDK_SURFACE_STATE_MAXIMIZED;
|
||||
gboolean maximized = GDK_SURFACE (surface)->state & GDK_TOPLEVEL_STATE_MAXIMIZED;
|
||||
|
||||
if (!maximized)
|
||||
return screenFrame;
|
||||
@ -639,9 +639,9 @@
|
||||
toFrame:(NSRect)newFrame
|
||||
{
|
||||
GdkMacosSurface *surface = gdk_surface;
|
||||
GdkSurfaceState state = GDK_SURFACE (surface)->state;
|
||||
GdkToplevelState state = GDK_SURFACE (surface)->state;
|
||||
|
||||
if (state & GDK_SURFACE_STATE_MAXIMIZED)
|
||||
if (state & GDK_TOPLEVEL_STATE_MAXIMIZED)
|
||||
{
|
||||
lastMaximizedFrame = newFrame;
|
||||
[self windowDidUnmaximize];
|
||||
@ -649,7 +649,7 @@
|
||||
else
|
||||
{
|
||||
lastUnmaximizedFrame = [nsWindow frame];
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (gdk_surface), 0, GDK_SURFACE_STATE_MAXIMIZED);
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (gdk_surface), 0, GDK_TOPLEVEL_STATE_MAXIMIZED);
|
||||
}
|
||||
|
||||
inMaximizeTransition = YES;
|
||||
@ -659,7 +659,7 @@
|
||||
|
||||
-(void)windowDidEndLiveResize:(NSNotification *)aNotification
|
||||
{
|
||||
gboolean maximized = GDK_SURFACE (gdk_surface)->state & GDK_SURFACE_STATE_MAXIMIZED;
|
||||
gboolean maximized = GDK_SURFACE (gdk_surface)->state & GDK_TOPLEVEL_STATE_MAXIMIZED;
|
||||
|
||||
inMaximizeTransition = NO;
|
||||
|
||||
|
@ -650,7 +650,7 @@ _gdk_macos_surface_resize (GdkMacosSurface *self,
|
||||
void
|
||||
_gdk_macos_surface_update_fullscreen_state (GdkMacosSurface *self)
|
||||
{
|
||||
GdkSurfaceState state;
|
||||
GdkToplevelState state;
|
||||
gboolean is_fullscreen;
|
||||
gboolean was_fullscreen;
|
||||
|
||||
@ -658,14 +658,14 @@ _gdk_macos_surface_update_fullscreen_state (GdkMacosSurface *self)
|
||||
|
||||
state = GDK_SURFACE (self)->state;
|
||||
is_fullscreen = window_is_fullscreen (self);
|
||||
was_fullscreen = (state & GDK_SURFACE_STATE_FULLSCREEN) != 0;
|
||||
was_fullscreen = (state & GDK_TOPLEVEL_STATE_FULLSCREEN) != 0;
|
||||
|
||||
if (is_fullscreen != was_fullscreen)
|
||||
{
|
||||
if (is_fullscreen)
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (self), 0, GDK_SURFACE_STATE_FULLSCREEN);
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (self), 0, GDK_TOPLEVEL_STATE_FULLSCREEN);
|
||||
else
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (self), GDK_SURFACE_STATE_FULLSCREEN, 0);
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (self), GDK_TOPLEVEL_STATE_FULLSCREEN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -740,7 +740,7 @@ _gdk_macos_surface_show (GdkMacosSurface *self)
|
||||
was_mapped = GDK_SURFACE_IS_MAPPED (GDK_SURFACE (self));
|
||||
|
||||
if (!was_mapped)
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (self), GDK_SURFACE_STATE_WITHDRAWN, 0);
|
||||
gdk_synthesize_surface_state (GDK_SURFACE (self), GDK_TOPLEVEL_STATE_WITHDRAWN, 0);
|
||||
|
||||
_gdk_macos_display_clear_sorting (GDK_MACOS_DISPLAY (GDK_SURFACE (self)->display));
|
||||
|
||||
|
@ -171,7 +171,7 @@ struct _GdkWaylandSurface
|
||||
struct {
|
||||
int width;
|
||||
int height;
|
||||
GdkSurfaceState state;
|
||||
GdkToplevelState state;
|
||||
} toplevel;
|
||||
|
||||
struct {
|
||||
@ -353,7 +353,7 @@ _gdk_wayland_surface_save_size (GdkSurface *surface)
|
||||
{
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
|
||||
if (surface->state & (GDK_SURFACE_STATE_FULLSCREEN | GDK_SURFACE_STATE_MAXIMIZED))
|
||||
if (surface->state & (GDK_TOPLEVEL_STATE_FULLSCREEN | GDK_TOPLEVEL_STATE_MAXIMIZED))
|
||||
return;
|
||||
|
||||
impl->saved_width = surface->width - impl->margin_left - impl->margin_right;
|
||||
@ -365,7 +365,7 @@ _gdk_wayland_surface_clear_saved_size (GdkSurface *surface)
|
||||
{
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
|
||||
if (surface->state & (GDK_SURFACE_STATE_FULLSCREEN | GDK_SURFACE_STATE_MAXIMIZED))
|
||||
if (surface->state & (GDK_TOPLEVEL_STATE_FULLSCREEN | GDK_TOPLEVEL_STATE_MAXIMIZED))
|
||||
return;
|
||||
|
||||
impl->saved_width = -1;
|
||||
@ -1330,7 +1330,7 @@ gdk_wayland_surface_configure_toplevel (GdkSurface *surface)
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
GdkWaylandDisplay *display_wayland =
|
||||
GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
|
||||
GdkSurfaceState new_state;
|
||||
GdkToplevelState new_state;
|
||||
int width, height;
|
||||
gboolean fixed_size;
|
||||
gboolean saved_size;
|
||||
@ -1339,9 +1339,9 @@ gdk_wayland_surface_configure_toplevel (GdkSurface *surface)
|
||||
impl->pending.toplevel.state = 0;
|
||||
|
||||
fixed_size =
|
||||
new_state & (GDK_SURFACE_STATE_MAXIMIZED |
|
||||
GDK_SURFACE_STATE_FULLSCREEN |
|
||||
GDK_SURFACE_STATE_TILED);
|
||||
new_state & (GDK_TOPLEVEL_STATE_MAXIMIZED |
|
||||
GDK_TOPLEVEL_STATE_FULLSCREEN |
|
||||
GDK_TOPLEVEL_STATE_TILED);
|
||||
|
||||
width = impl->pending.toplevel.width;
|
||||
height = impl->pending.toplevel.height;
|
||||
@ -1389,10 +1389,10 @@ gdk_wayland_surface_configure_toplevel (GdkSurface *surface)
|
||||
GDK_DISPLAY_NOTE (gdk_surface_get_display (surface), EVENTS,
|
||||
g_message ("configure, surface %p %dx%d,%s%s%s%s",
|
||||
surface, width, height,
|
||||
(new_state & GDK_SURFACE_STATE_FULLSCREEN) ? " fullscreen" : "",
|
||||
(new_state & GDK_SURFACE_STATE_MAXIMIZED) ? " maximized" : "",
|
||||
(new_state & GDK_SURFACE_STATE_FOCUSED) ? " focused" : "",
|
||||
(new_state & GDK_SURFACE_STATE_TILED) ? " tiled" : ""));
|
||||
(new_state & GDK_TOPLEVEL_STATE_FULLSCREEN) ? " fullscreen" : "",
|
||||
(new_state & GDK_TOPLEVEL_STATE_MAXIMIZED) ? " maximized" : "",
|
||||
(new_state & GDK_TOPLEVEL_STATE_FOCUSED) ? " focused" : "",
|
||||
(new_state & GDK_TOPLEVEL_STATE_TILED) ? " tiled" : ""));
|
||||
|
||||
gdk_surface_set_state (surface, new_state);
|
||||
|
||||
@ -1511,7 +1511,7 @@ static void
|
||||
gdk_wayland_surface_handle_configure_toplevel (GdkSurface *surface,
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
GdkSurfaceState state)
|
||||
GdkToplevelState state)
|
||||
{
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
|
||||
@ -1558,7 +1558,7 @@ xdg_toplevel_configure (void *data,
|
||||
{
|
||||
GdkSurface *surface = GDK_SURFACE (data);
|
||||
uint32_t *p;
|
||||
GdkSurfaceState pending_state = 0;
|
||||
GdkToplevelState pending_state = 0;
|
||||
|
||||
wl_array_for_each (p, states)
|
||||
{
|
||||
@ -1567,13 +1567,13 @@ xdg_toplevel_configure (void *data,
|
||||
switch (state)
|
||||
{
|
||||
case XDG_TOPLEVEL_STATE_FULLSCREEN:
|
||||
pending_state |= GDK_SURFACE_STATE_FULLSCREEN;
|
||||
pending_state |= GDK_TOPLEVEL_STATE_FULLSCREEN;
|
||||
break;
|
||||
case XDG_TOPLEVEL_STATE_MAXIMIZED:
|
||||
pending_state |= GDK_SURFACE_STATE_MAXIMIZED;
|
||||
pending_state |= GDK_TOPLEVEL_STATE_MAXIMIZED;
|
||||
break;
|
||||
case XDG_TOPLEVEL_STATE_ACTIVATED:
|
||||
pending_state |= GDK_SURFACE_STATE_FOCUSED;
|
||||
pending_state |= GDK_TOPLEVEL_STATE_FOCUSED;
|
||||
break;
|
||||
case XDG_TOPLEVEL_STATE_RESIZING:
|
||||
break;
|
||||
@ -1647,7 +1647,7 @@ zxdg_toplevel_v6_configure (void *data,
|
||||
{
|
||||
GdkSurface *surface = GDK_SURFACE (data);
|
||||
uint32_t *p;
|
||||
GdkSurfaceState pending_state = 0;
|
||||
GdkToplevelState pending_state = 0;
|
||||
|
||||
wl_array_for_each (p, states)
|
||||
{
|
||||
@ -1656,13 +1656,13 @@ zxdg_toplevel_v6_configure (void *data,
|
||||
switch (state)
|
||||
{
|
||||
case ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN:
|
||||
pending_state |= GDK_SURFACE_STATE_FULLSCREEN;
|
||||
pending_state |= GDK_TOPLEVEL_STATE_FULLSCREEN;
|
||||
break;
|
||||
case ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED:
|
||||
pending_state |= GDK_SURFACE_STATE_MAXIMIZED;
|
||||
pending_state |= GDK_TOPLEVEL_STATE_MAXIMIZED;
|
||||
break;
|
||||
case ZXDG_TOPLEVEL_V6_STATE_ACTIVATED:
|
||||
pending_state |= GDK_SURFACE_STATE_FOCUSED;
|
||||
pending_state |= GDK_TOPLEVEL_STATE_FOCUSED;
|
||||
break;
|
||||
case ZXDG_TOPLEVEL_V6_STATE_RESIZING:
|
||||
break;
|
||||
@ -1771,16 +1771,16 @@ gdk_wayland_surface_create_xdg_toplevel (GdkSurface *surface)
|
||||
switch (display_wayland->shell_variant)
|
||||
{
|
||||
case GDK_WAYLAND_SHELL_VARIANT_XDG_SHELL:
|
||||
if (surface->state & GDK_SURFACE_STATE_MAXIMIZED)
|
||||
if (surface->state & GDK_TOPLEVEL_STATE_MAXIMIZED)
|
||||
xdg_toplevel_set_maximized (impl->display_server.xdg_toplevel);
|
||||
if (surface->state & GDK_SURFACE_STATE_FULLSCREEN)
|
||||
if (surface->state & GDK_TOPLEVEL_STATE_FULLSCREEN)
|
||||
xdg_toplevel_set_fullscreen (impl->display_server.xdg_toplevel,
|
||||
impl->initial_fullscreen_output);
|
||||
break;
|
||||
case GDK_WAYLAND_SHELL_VARIANT_ZXDG_SHELL_V6:
|
||||
if (surface->state & GDK_SURFACE_STATE_MAXIMIZED)
|
||||
if (surface->state & GDK_TOPLEVEL_STATE_MAXIMIZED)
|
||||
zxdg_toplevel_v6_set_maximized (impl->display_server.zxdg_toplevel_v6);
|
||||
if (surface->state & GDK_SURFACE_STATE_FULLSCREEN)
|
||||
if (surface->state & GDK_TOPLEVEL_STATE_FULLSCREEN)
|
||||
zxdg_toplevel_v6_set_fullscreen (impl->display_server.zxdg_toplevel_v6,
|
||||
impl->initial_fullscreen_output);
|
||||
break;
|
||||
@ -2975,7 +2975,7 @@ gdk_wayland_surface_map_popup (GdkSurface *surface,
|
||||
impl->popup.unconstrained_height = height;
|
||||
impl->mapped = TRUE;
|
||||
|
||||
gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_WITHDRAWN, 0);
|
||||
gdk_synthesize_surface_state (surface, GDK_TOPLEVEL_STATE_WITHDRAWN, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -3245,7 +3245,7 @@ gtk_surface_configure (void *data,
|
||||
{
|
||||
GdkSurface *surface = GDK_SURFACE (data);
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
GdkSurfaceState new_state = 0;
|
||||
GdkToplevelState new_state = 0;
|
||||
uint32_t *p;
|
||||
|
||||
wl_array_for_each (p, states)
|
||||
@ -3255,21 +3255,21 @@ gtk_surface_configure (void *data,
|
||||
switch (state)
|
||||
{
|
||||
case GTK_SURFACE1_STATE_TILED:
|
||||
new_state |= GDK_SURFACE_STATE_TILED;
|
||||
new_state |= GDK_TOPLEVEL_STATE_TILED;
|
||||
break;
|
||||
|
||||
/* Since v2 */
|
||||
case GTK_SURFACE1_STATE_TILED_TOP:
|
||||
new_state |= (GDK_SURFACE_STATE_TILED | GDK_SURFACE_STATE_TOP_TILED);
|
||||
new_state |= (GDK_TOPLEVEL_STATE_TILED | GDK_TOPLEVEL_STATE_TOP_TILED);
|
||||
break;
|
||||
case GTK_SURFACE1_STATE_TILED_RIGHT:
|
||||
new_state |= (GDK_SURFACE_STATE_TILED | GDK_SURFACE_STATE_RIGHT_TILED);
|
||||
new_state |= (GDK_TOPLEVEL_STATE_TILED | GDK_TOPLEVEL_STATE_RIGHT_TILED);
|
||||
break;
|
||||
case GTK_SURFACE1_STATE_TILED_BOTTOM:
|
||||
new_state |= (GDK_SURFACE_STATE_TILED | GDK_SURFACE_STATE_BOTTOM_TILED);
|
||||
new_state |= (GDK_TOPLEVEL_STATE_TILED | GDK_TOPLEVEL_STATE_BOTTOM_TILED);
|
||||
break;
|
||||
case GTK_SURFACE1_STATE_TILED_LEFT:
|
||||
new_state |= (GDK_SURFACE_STATE_TILED | GDK_SURFACE_STATE_LEFT_TILED);
|
||||
new_state |= (GDK_TOPLEVEL_STATE_TILED | GDK_TOPLEVEL_STATE_LEFT_TILED);
|
||||
break;
|
||||
default:
|
||||
/* Unknown state */
|
||||
@ -3287,7 +3287,7 @@ gtk_surface_configure_edges (void *data,
|
||||
{
|
||||
GdkSurface *surface = GDK_SURFACE (data);
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
GdkSurfaceState new_state = 0;
|
||||
GdkToplevelState new_state = 0;
|
||||
uint32_t *p;
|
||||
|
||||
wl_array_for_each (p, edge_constraints)
|
||||
@ -3297,16 +3297,16 @@ gtk_surface_configure_edges (void *data,
|
||||
switch (constraint)
|
||||
{
|
||||
case GTK_SURFACE1_EDGE_CONSTRAINT_RESIZABLE_TOP:
|
||||
new_state |= GDK_SURFACE_STATE_TOP_RESIZABLE;
|
||||
new_state |= GDK_TOPLEVEL_STATE_TOP_RESIZABLE;
|
||||
break;
|
||||
case GTK_SURFACE1_EDGE_CONSTRAINT_RESIZABLE_RIGHT:
|
||||
new_state |= GDK_SURFACE_STATE_RIGHT_RESIZABLE;
|
||||
new_state |= GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE;
|
||||
break;
|
||||
case GTK_SURFACE1_EDGE_CONSTRAINT_RESIZABLE_BOTTOM:
|
||||
new_state |= GDK_SURFACE_STATE_BOTTOM_RESIZABLE;
|
||||
new_state |= GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE;
|
||||
break;
|
||||
case GTK_SURFACE1_EDGE_CONSTRAINT_RESIZABLE_LEFT:
|
||||
new_state |= GDK_SURFACE_STATE_LEFT_RESIZABLE;
|
||||
new_state |= GDK_TOPLEVEL_STATE_LEFT_RESIZABLE;
|
||||
break;
|
||||
default:
|
||||
/* Unknown state */
|
||||
@ -3599,7 +3599,7 @@ gdk_wayland_surface_maximize (GdkSurface *surface)
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_MAXIMIZED);
|
||||
gdk_synthesize_surface_state (surface, 0, GDK_TOPLEVEL_STATE_MAXIMIZED);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3630,7 +3630,7 @@ gdk_wayland_surface_unmaximize (GdkSurface *surface)
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_MAXIMIZED, 0);
|
||||
gdk_synthesize_surface_state (surface, GDK_TOPLEVEL_STATE_MAXIMIZED, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3667,7 +3667,7 @@ gdk_wayland_surface_fullscreen_on_monitor (GdkSurface *surface,
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_FULLSCREEN);
|
||||
gdk_synthesize_surface_state (surface, 0, GDK_TOPLEVEL_STATE_FULLSCREEN);
|
||||
impl->initial_fullscreen_output = output;
|
||||
}
|
||||
}
|
||||
@ -3705,7 +3705,7 @@ gdk_wayland_surface_fullscreen (GdkSurface *surface)
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_FULLSCREEN);
|
||||
gdk_synthesize_surface_state (surface, 0, GDK_TOPLEVEL_STATE_FULLSCREEN);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3738,7 +3738,7 @@ gdk_wayland_surface_unfullscreen (GdkSurface *surface)
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_FULLSCREEN, 0);
|
||||
gdk_synthesize_surface_state (surface, GDK_TOPLEVEL_STATE_FULLSCREEN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4732,7 +4732,7 @@ show_surface (GdkSurface *surface)
|
||||
was_mapped = GDK_SURFACE_IS_MAPPED (surface);
|
||||
|
||||
if (!was_mapped)
|
||||
gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_WITHDRAWN, 0);
|
||||
gdk_synthesize_surface_state (surface, GDK_TOPLEVEL_STATE_WITHDRAWN, 0);
|
||||
|
||||
gdk_wayland_surface_show (surface, FALSE);
|
||||
|
||||
@ -4807,9 +4807,9 @@ gdk_wayland_toplevel_present (GdkToplevel *toplevel,
|
||||
|
||||
if (needs_reconfigure &&
|
||||
last_configure_serial == impl->last_configure_serial &&
|
||||
!(surface->state & (GDK_SURFACE_STATE_MAXIMIZED |
|
||||
GDK_SURFACE_STATE_FULLSCREEN |
|
||||
GDK_SURFACE_STATE_TILED)))
|
||||
!(surface->state & (GDK_TOPLEVEL_STATE_MAXIMIZED |
|
||||
GDK_TOPLEVEL_STATE_FULLSCREEN |
|
||||
GDK_TOPLEVEL_STATE_TILED)))
|
||||
configure_surface_geometry (surface);
|
||||
|
||||
return TRUE;
|
||||
|
@ -311,7 +311,7 @@ low_level_keystroke_handler (WPARAM message,
|
||||
gboolean lshiftdown = GetKeyState (VK_LSHIFT) & 0x8000;
|
||||
gboolean rshiftdown = GetKeyState (VK_RSHIFT) & 0x8000;
|
||||
gboolean oneshiftdown = (lshiftdown || rshiftdown) && !(lshiftdown && rshiftdown);
|
||||
gboolean maximized = gdk_toplevel_get_state (GDK_TOPLEVEL (toplevel)) & GDK_SURFACE_STATE_MAXIMIZED;
|
||||
gboolean maximized = gdk_toplevel_get_state (GDK_TOPLEVEL (toplevel)) & GDK_TOPLEVEL_STATE_MAXIMIZED;
|
||||
|
||||
switch (kbdhook->vkCode)
|
||||
{
|
||||
@ -983,9 +983,9 @@ show_window_recurse (GdkSurface *window, gboolean hide_window)
|
||||
{
|
||||
if (!hide_window)
|
||||
{
|
||||
if (gdk_toplevel_get_state (GDK_TOPLEVEL (window)) & GDK_SURFACE_STATE_MINIMIZED)
|
||||
if (gdk_toplevel_get_state (GDK_TOPLEVEL (window)) & GDK_TOPLEVEL_STATE_MINIMIZED)
|
||||
{
|
||||
if (gdk_toplevel_get_state (GDK_TOPLEVEL (window)) & GDK_SURFACE_STATE_MAXIMIZED)
|
||||
if (gdk_toplevel_get_state (GDK_TOPLEVEL (window)) & GDK_TOPLEVEL_STATE_MAXIMIZED)
|
||||
{
|
||||
GtkShowWindow (window, SW_SHOWMAXIMIZED);
|
||||
}
|
||||
@ -1590,7 +1590,7 @@ should_window_be_always_on_top (GdkSurface *window)
|
||||
DWORD exstyle;
|
||||
|
||||
if (GDK_IS_DRAG_SURFACE (window) ||
|
||||
(window->state & GDK_SURFACE_STATE_ABOVE))
|
||||
(window->state & GDK_TOPLEVEL_STATE_ABOVE))
|
||||
return TRUE;
|
||||
|
||||
exstyle = GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE);
|
||||
@ -3068,7 +3068,7 @@ gdk_event_translate (MSG *msg,
|
||||
/* Update window state */
|
||||
if (windowpos->flags & (SWP_STATECHANGED | SWP_SHOWWINDOW | SWP_HIDEWINDOW))
|
||||
{
|
||||
GdkSurfaceState set_bits, unset_bits, old_state, new_state;
|
||||
GdkToplevelState set_bits, unset_bits, old_state, new_state;
|
||||
|
||||
old_state = window->state;
|
||||
|
||||
@ -3076,19 +3076,19 @@ gdk_event_translate (MSG *msg,
|
||||
unset_bits = 0;
|
||||
|
||||
if (IsWindowVisible (msg->hwnd))
|
||||
unset_bits |= GDK_SURFACE_STATE_WITHDRAWN;
|
||||
unset_bits |= GDK_TOPLEVEL_STATE_WITHDRAWN;
|
||||
else
|
||||
set_bits |= GDK_SURFACE_STATE_WITHDRAWN;
|
||||
set_bits |= GDK_TOPLEVEL_STATE_WITHDRAWN;
|
||||
|
||||
if (IsIconic (msg->hwnd))
|
||||
set_bits |= GDK_SURFACE_STATE_MINIMIZED;
|
||||
set_bits |= GDK_TOPLEVEL_STATE_MINIMIZED;
|
||||
else
|
||||
unset_bits |= GDK_SURFACE_STATE_MINIMIZED;
|
||||
unset_bits |= GDK_TOPLEVEL_STATE_MINIMIZED;
|
||||
|
||||
if (IsZoomed (msg->hwnd))
|
||||
set_bits |= GDK_SURFACE_STATE_MAXIMIZED;
|
||||
set_bits |= GDK_TOPLEVEL_STATE_MAXIMIZED;
|
||||
else
|
||||
unset_bits |= GDK_SURFACE_STATE_MAXIMIZED;
|
||||
unset_bits |= GDK_TOPLEVEL_STATE_MAXIMIZED;
|
||||
|
||||
gdk_synthesize_surface_state (window, unset_bits, set_bits);
|
||||
|
||||
@ -3098,15 +3098,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_MINIMIZED) !=
|
||||
(new_state & GDK_SURFACE_STATE_MINIMIZED))
|
||||
do_show_window (window, (new_state & GDK_SURFACE_STATE_MINIMIZED));
|
||||
if ((old_state & GDK_TOPLEVEL_STATE_MINIMIZED) !=
|
||||
(new_state & GDK_TOPLEVEL_STATE_MINIMIZED))
|
||||
do_show_window (window, (new_state & GDK_TOPLEVEL_STATE_MINIMIZED));
|
||||
|
||||
|
||||
/* When un-minimizing, make sure we're stacked under any
|
||||
transient-type windows. */
|
||||
if (!(old_state & GDK_SURFACE_STATE_MINIMIZED) &&
|
||||
(new_state & GDK_SURFACE_STATE_MINIMIZED))
|
||||
if (!(old_state & GDK_TOPLEVEL_STATE_MINIMIZED) &&
|
||||
(new_state & GDK_TOPLEVEL_STATE_MINIMIZED))
|
||||
{
|
||||
ensure_stacking_on_unminimize (msg);
|
||||
restack_children (window);
|
||||
@ -3293,9 +3293,9 @@ gdk_event_translate (MSG *msg,
|
||||
}
|
||||
|
||||
if (LOWORD (msg->wParam) == WA_INACTIVE)
|
||||
gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_FOCUSED, 0);
|
||||
gdk_synthesize_surface_state (window, GDK_TOPLEVEL_STATE_FOCUSED, 0);
|
||||
else
|
||||
gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FOCUSED);
|
||||
gdk_synthesize_surface_state (window, 0, GDK_TOPLEVEL_STATE_FOCUSED);
|
||||
|
||||
/* Bring any tablet contexts to the top of the overlap order when
|
||||
* one of our windows is activated.
|
||||
|
@ -262,7 +262,7 @@ _gdk_win32_drag_protocol_to_string (GdkDragProtocol protocol)
|
||||
}
|
||||
|
||||
char *
|
||||
_gdk_win32_surface_state_to_string (GdkSurfaceState state)
|
||||
_gdk_win32_surface_state_to_string (GdkToplevelState state)
|
||||
{
|
||||
char buf[100];
|
||||
char *bufp = buf;
|
||||
@ -271,11 +271,11 @@ _gdk_win32_surface_state_to_string (GdkSurfaceState state)
|
||||
buf[0] = '\0';
|
||||
|
||||
#define BIT(x) \
|
||||
if (state & GDK_SURFACE_STATE_ ## x) \
|
||||
if (state & GDK_TOPLEVEL_STATE_ ## x) \
|
||||
(bufp += sprintf (bufp, "%s" #x, s), s = "|")
|
||||
|
||||
/* For clarity, also show the complement of WITHDRAWN, i.e. "MAPPED" */
|
||||
if (!(state & GDK_SURFACE_STATE_WITHDRAWN))
|
||||
if (!(state & GDK_TOPLEVEL_STATE_WITHDRAWN))
|
||||
(bufp += sprintf (bufp, "MAPPED"), s = "|");
|
||||
|
||||
BIT (WITHDRAWN);
|
||||
|
@ -213,7 +213,7 @@ void _gdk_win32_print_hpalette (HPALETTE hpal);
|
||||
void _gdk_win32_print_dc (HDC hdc);
|
||||
|
||||
char *_gdk_win32_drag_protocol_to_string (GdkDragProtocol protocol);
|
||||
char *_gdk_win32_surface_state_to_string (GdkSurfaceState state);
|
||||
char *_gdk_win32_surface_state_to_string (GdkToplevelState state);
|
||||
char *_gdk_win32_surface_style_to_string (LONG style);
|
||||
char *_gdk_win32_surface_exstyle_to_string (LONG style);
|
||||
char *_gdk_win32_surface_pos_bits_to_string (UINT flags);
|
||||
|
@ -804,21 +804,21 @@ show_window_internal (GdkSurface *window,
|
||||
*/
|
||||
if (!unminimize &&
|
||||
!already_mapped &&
|
||||
(window->state & GDK_SURFACE_STATE_MINIMIZED))
|
||||
(window->state & GDK_TOPLEVEL_STATE_MINIMIZED))
|
||||
{
|
||||
GtkShowWindow (window, SW_SHOWMINNOACTIVE);
|
||||
return;
|
||||
}
|
||||
|
||||
/* If asked to just show an iconified window, do nothing. */
|
||||
if (!unminimize && (window->state & GDK_SURFACE_STATE_MINIMIZED))
|
||||
if (!unminimize && (window->state & GDK_TOPLEVEL_STATE_MINIMIZED))
|
||||
return;
|
||||
|
||||
/* 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 (unminimize && !(window->state & GDK_SURFACE_STATE_MINIMIZED))
|
||||
if (unminimize && !(window->state & GDK_TOPLEVEL_STATE_MINIMIZED))
|
||||
return;
|
||||
|
||||
/* If asked to show (but not raise) a window that is already
|
||||
@ -965,15 +965,15 @@ show_window_internal (GdkSurface *window,
|
||||
}
|
||||
|
||||
|
||||
if (window->state & GDK_SURFACE_STATE_FULLSCREEN)
|
||||
if (window->state & GDK_TOPLEVEL_STATE_FULLSCREEN)
|
||||
{
|
||||
gdk_win32_surface_fullscreen (window);
|
||||
}
|
||||
else if (window->state & GDK_SURFACE_STATE_MAXIMIZED)
|
||||
else if (window->state & GDK_TOPLEVEL_STATE_MAXIMIZED)
|
||||
{
|
||||
GtkShowWindow (window, SW_MAXIMIZE);
|
||||
}
|
||||
else if (window->state & GDK_SURFACE_STATE_MINIMIZED)
|
||||
else if (window->state & GDK_TOPLEVEL_STATE_MINIMIZED)
|
||||
{
|
||||
GtkShowWindow (window, SW_RESTORE);
|
||||
}
|
||||
@ -995,13 +995,13 @@ show_window_internal (GdkSurface *window,
|
||||
|
||||
/* Sync STATE_ABOVE to TOPMOST */
|
||||
if (!GDK_IS_DRAG_SURFACE (window) &&
|
||||
(((window->state & GDK_SURFACE_STATE_ABOVE) &&
|
||||
(((window->state & GDK_TOPLEVEL_STATE_ABOVE) &&
|
||||
!(exstyle & WS_EX_TOPMOST)) ||
|
||||
(!(window->state & GDK_SURFACE_STATE_ABOVE) &&
|
||||
(!(window->state & GDK_TOPLEVEL_STATE_ABOVE) &&
|
||||
(exstyle & WS_EX_TOPMOST))))
|
||||
{
|
||||
API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window),
|
||||
(window->state & GDK_SURFACE_STATE_ABOVE)?HWND_TOPMOST:HWND_NOTOPMOST,
|
||||
(window->state & GDK_TOPLEVEL_STATE_ABOVE)?HWND_TOPMOST:HWND_NOTOPMOST,
|
||||
0, 0, 0, 0,
|
||||
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOOWNERZORDER));
|
||||
}
|
||||
@ -1027,7 +1027,7 @@ gdk_win32_surface_hide (GdkSurface *window)
|
||||
if (GDK_SURFACE_IS_MAPPED (window))
|
||||
gdk_synthesize_surface_state (window,
|
||||
0,
|
||||
GDK_SURFACE_STATE_WITHDRAWN);
|
||||
GDK_TOPLEVEL_STATE_WITHDRAWN);
|
||||
|
||||
_gdk_surface_clear_update_area (window);
|
||||
|
||||
@ -1064,7 +1064,7 @@ gdk_win32_surface_do_move (GdkSurface *window,
|
||||
GDK_NOTE (MISC, g_print ("gdk_win32_surface_move: %p: %+d%+d\n",
|
||||
GDK_SURFACE_HWND (window), x, y));
|
||||
|
||||
if (window->state & GDK_SURFACE_STATE_FULLSCREEN)
|
||||
if (window->state & GDK_TOPLEVEL_STATE_FULLSCREEN)
|
||||
return;
|
||||
|
||||
impl = GDK_WIN32_SURFACE (window);
|
||||
@ -1103,7 +1103,7 @@ gdk_win32_surface_resize (GdkSurface *window,
|
||||
GDK_NOTE (MISC, g_print ("gdk_win32_surface_resize: %p: %dx%d\n",
|
||||
GDK_SURFACE_HWND (window), width, height));
|
||||
|
||||
if (window->state & GDK_SURFACE_STATE_FULLSCREEN)
|
||||
if (window->state & GDK_TOPLEVEL_STATE_FULLSCREEN)
|
||||
return;
|
||||
|
||||
get_outer_rect (window, width, height, &outer_rect);
|
||||
@ -1143,7 +1143,7 @@ gdk_win32_surface_do_move_resize (GdkSurface *window,
|
||||
if (height < 1)
|
||||
height = 1;
|
||||
|
||||
if (window->state & GDK_SURFACE_STATE_FULLSCREEN)
|
||||
if (window->state & GDK_TOPLEVEL_STATE_FULLSCREEN)
|
||||
return;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_win32_surface_move_resize: %p: %dx%d@%+d%+d\n",
|
||||
@ -1276,7 +1276,7 @@ static void
|
||||
show_popup (GdkSurface *surface)
|
||||
{
|
||||
gdk_win32_surface_raise (surface);
|
||||
gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_WITHDRAWN, 0);
|
||||
gdk_synthesize_surface_state (surface, GDK_TOPLEVEL_STATE_WITHDRAWN, 0);
|
||||
show_window_internal (surface, FALSE, FALSE);
|
||||
gdk_surface_invalidate_rect (surface, NULL);
|
||||
}
|
||||
@ -1828,7 +1828,7 @@ _gdk_win32_surface_update_style_bits (GdkSurface *window)
|
||||
HWND insert_after;
|
||||
UINT flags;
|
||||
|
||||
if (window->state & GDK_SURFACE_STATE_FULLSCREEN)
|
||||
if (window->state & GDK_TOPLEVEL_STATE_FULLSCREEN)
|
||||
return;
|
||||
|
||||
old_style = GetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE);
|
||||
@ -2394,9 +2394,9 @@ _gdk_win32_surface_handle_aerosnap (GdkSurface *window,
|
||||
GdkDisplay *display;
|
||||
GListModel *monitors;
|
||||
int n_monitors;
|
||||
GdkSurfaceState surface_state = gdk_toplevel_get_state (GDK_TOPLEVEL (window));
|
||||
gboolean minimized = surface_state & GDK_SURFACE_STATE_MINIMIZED;
|
||||
gboolean maximized = surface_state & GDK_SURFACE_STATE_MAXIMIZED;
|
||||
GdkToplevelState surface_state = gdk_toplevel_get_state (GDK_TOPLEVEL (window));
|
||||
gboolean minimized = surface_state & GDK_TOPLEVEL_STATE_MINIMIZED;
|
||||
gboolean maximized = surface_state & GDK_TOPLEVEL_STATE_MAXIMIZED;
|
||||
gboolean halfsnapped;
|
||||
GdkMonitor *monitor;
|
||||
|
||||
@ -3432,7 +3432,7 @@ setup_drag_move_resize_context (GdkSurface *window,
|
||||
const char *cursor_name;
|
||||
GdkSurface *pointer_window;
|
||||
GdkWin32Surface *impl = GDK_WIN32_SURFACE (window);
|
||||
gboolean maximized = gdk_toplevel_get_state (GDK_TOPLEVEL (window)) & GDK_SURFACE_STATE_MAXIMIZED;
|
||||
gboolean maximized = gdk_toplevel_get_state (GDK_TOPLEVEL (window)) & GDK_TOPLEVEL_STATE_MAXIMIZED;
|
||||
int root_x, root_y;
|
||||
|
||||
gdk_win32_surface_get_root_coords (window, x, y, &root_x, &root_y);
|
||||
@ -4162,7 +4162,7 @@ gdk_win32_surface_minimize (GdkSurface *window)
|
||||
{
|
||||
gdk_synthesize_surface_state (window,
|
||||
0,
|
||||
GDK_SURFACE_STATE_MINIMIZED);
|
||||
GDK_TOPLEVEL_STATE_MINIMIZED);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4184,7 +4184,7 @@ gdk_win32_surface_maximize (GdkSurface *window)
|
||||
else
|
||||
gdk_synthesize_surface_state (window,
|
||||
0,
|
||||
GDK_SURFACE_STATE_MAXIMIZED);
|
||||
GDK_TOPLEVEL_STATE_MAXIMIZED);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -4205,7 +4205,7 @@ gdk_win32_surface_unmaximize (GdkSurface *window)
|
||||
GtkShowWindow (window, SW_RESTORE);
|
||||
else
|
||||
gdk_synthesize_surface_state (window,
|
||||
GDK_SURFACE_STATE_MAXIMIZED,
|
||||
GDK_TOPLEVEL_STATE_MAXIMIZED,
|
||||
0);
|
||||
}
|
||||
|
||||
@ -4250,7 +4250,7 @@ gdk_win32_surface_fullscreen (GdkSurface *window)
|
||||
fi->style = GetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE);
|
||||
|
||||
/* Send state change before configure event */
|
||||
gdk_synthesize_surface_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN);
|
||||
gdk_synthesize_surface_state (window, 0, GDK_TOPLEVEL_STATE_FULLSCREEN);
|
||||
|
||||
SetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE,
|
||||
(fi->style & ~WS_OVERLAPPEDWINDOW) | WS_POPUP);
|
||||
@ -4273,7 +4273,7 @@ gdk_win32_surface_unfullscreen (GdkSurface *window)
|
||||
{
|
||||
GdkWin32Surface *impl = GDK_WIN32_SURFACE (window);
|
||||
|
||||
gdk_synthesize_surface_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0);
|
||||
gdk_synthesize_surface_state (window, GDK_TOPLEVEL_STATE_FULLSCREEN, 0);
|
||||
|
||||
impl->hint_flags = fi->hint_flags;
|
||||
SetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE, fi->style);
|
||||
@ -4302,9 +4302,9 @@ gdk_win32_surface_focus (GdkSurface *window,
|
||||
GDK_SURFACE_HWND (window),
|
||||
_gdk_win32_surface_state_to_string (window->state)));
|
||||
|
||||
if (window->state & GDK_SURFACE_STATE_MAXIMIZED)
|
||||
if (window->state & GDK_TOPLEVEL_STATE_MAXIMIZED)
|
||||
GtkShowWindow (window, SW_SHOWMAXIMIZED);
|
||||
else if (window->state & GDK_SURFACE_STATE_MINIMIZED)
|
||||
else if (window->state & GDK_TOPLEVEL_STATE_MINIMIZED)
|
||||
GtkShowWindow (window, SW_RESTORE);
|
||||
else if (!IsWindowVisible (GDK_SURFACE_HWND (window)))
|
||||
GtkShowWindow (window, SW_SHOWNORMAL);
|
||||
@ -4927,7 +4927,7 @@ show_surface (GdkSurface *surface)
|
||||
was_mapped = GDK_SURFACE_IS_MAPPED (surface);
|
||||
|
||||
if (!was_mapped)
|
||||
gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_WITHDRAWN, 0);
|
||||
gdk_synthesize_surface_state (surface, GDK_TOPLEVEL_STATE_WITHDRAWN, 0);
|
||||
|
||||
gdk_win32_surface_show (surface, FALSE);
|
||||
|
||||
|
@ -216,19 +216,19 @@ gdk_x11_display_event_translator_init (GdkEventTranslatorIface *iface)
|
||||
iface->translate_event = gdk_x11_display_translate_event;
|
||||
}
|
||||
|
||||
#define ANY_EDGE_TILED (GDK_SURFACE_STATE_LEFT_TILED | \
|
||||
GDK_SURFACE_STATE_RIGHT_TILED | \
|
||||
GDK_SURFACE_STATE_TOP_TILED | \
|
||||
GDK_SURFACE_STATE_BOTTOM_TILED)
|
||||
#define ANY_EDGE_TILED (GDK_TOPLEVEL_STATE_LEFT_TILED | \
|
||||
GDK_TOPLEVEL_STATE_RIGHT_TILED | \
|
||||
GDK_TOPLEVEL_STATE_TOP_TILED | \
|
||||
GDK_TOPLEVEL_STATE_BOTTOM_TILED)
|
||||
|
||||
static void
|
||||
do_edge_constraint_state_check (GdkSurface *surface,
|
||||
GdkSurfaceState old_state,
|
||||
GdkSurfaceState *set,
|
||||
GdkSurfaceState *unset)
|
||||
GdkToplevelState old_state,
|
||||
GdkToplevelState *set,
|
||||
GdkToplevelState *unset)
|
||||
{
|
||||
GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (surface);
|
||||
GdkSurfaceState local_set, local_unset;
|
||||
GdkToplevelState local_set, local_unset;
|
||||
guint edge_constraints;
|
||||
|
||||
local_set = *set;
|
||||
@ -237,7 +237,7 @@ do_edge_constraint_state_check (GdkSurface *surface,
|
||||
|
||||
/* If the WM doesn't support _GTK_EDGE_CONSTRAINTS, rely on the fallback
|
||||
* implementation. If it supports _GTK_EDGE_CONSTRAINTS, arrange for
|
||||
* GDK_SURFACE_STATE_TILED to be set if any edge is tiled, and cleared
|
||||
* GDK_TOPLEVEL_STATE_TILED to be set if any edge is tiled, and cleared
|
||||
* if no edge is tiled.
|
||||
*/
|
||||
if (!gdk_x11_surface_supports_edge_constraints (surface))
|
||||
@ -246,121 +246,121 @@ do_edge_constraint_state_check (GdkSurface *surface,
|
||||
* mutter only tiles horizontally, and sets maxvert when it does
|
||||
* and if it tiles, it always affects all edges
|
||||
*/
|
||||
if (old_state & GDK_SURFACE_STATE_TILED)
|
||||
if (old_state & GDK_TOPLEVEL_STATE_TILED)
|
||||
{
|
||||
if (!toplevel->have_maxvert)
|
||||
local_unset |= GDK_SURFACE_STATE_TILED;
|
||||
local_unset |= GDK_TOPLEVEL_STATE_TILED;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (toplevel->have_maxvert && !toplevel->have_maxhorz)
|
||||
local_set |= GDK_SURFACE_STATE_TILED;
|
||||
local_set |= GDK_TOPLEVEL_STATE_TILED;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (old_state & GDK_SURFACE_STATE_TILED)
|
||||
if (old_state & GDK_TOPLEVEL_STATE_TILED)
|
||||
{
|
||||
if (!(edge_constraints & ANY_EDGE_TILED))
|
||||
local_unset |= GDK_SURFACE_STATE_TILED;
|
||||
local_unset |= GDK_TOPLEVEL_STATE_TILED;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (edge_constraints & ANY_EDGE_TILED)
|
||||
local_set |= GDK_SURFACE_STATE_TILED;
|
||||
local_set |= GDK_TOPLEVEL_STATE_TILED;
|
||||
}
|
||||
}
|
||||
|
||||
/* Top edge */
|
||||
if (old_state & GDK_SURFACE_STATE_TOP_TILED)
|
||||
if (old_state & GDK_TOPLEVEL_STATE_TOP_TILED)
|
||||
{
|
||||
if ((edge_constraints & GDK_SURFACE_STATE_TOP_TILED) == 0)
|
||||
local_unset |= GDK_SURFACE_STATE_TOP_TILED;
|
||||
if ((edge_constraints & GDK_TOPLEVEL_STATE_TOP_TILED) == 0)
|
||||
local_unset |= GDK_TOPLEVEL_STATE_TOP_TILED;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (edge_constraints & GDK_SURFACE_STATE_TOP_TILED)
|
||||
local_set |= GDK_SURFACE_STATE_TOP_TILED;
|
||||
if (edge_constraints & GDK_TOPLEVEL_STATE_TOP_TILED)
|
||||
local_set |= GDK_TOPLEVEL_STATE_TOP_TILED;
|
||||
}
|
||||
|
||||
if (old_state & GDK_SURFACE_STATE_TOP_RESIZABLE)
|
||||
if (old_state & GDK_TOPLEVEL_STATE_TOP_RESIZABLE)
|
||||
{
|
||||
if ((edge_constraints & GDK_SURFACE_STATE_TOP_RESIZABLE) == 0)
|
||||
local_unset |= GDK_SURFACE_STATE_TOP_RESIZABLE;
|
||||
if ((edge_constraints & GDK_TOPLEVEL_STATE_TOP_RESIZABLE) == 0)
|
||||
local_unset |= GDK_TOPLEVEL_STATE_TOP_RESIZABLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (edge_constraints & GDK_SURFACE_STATE_TOP_RESIZABLE)
|
||||
local_set |= GDK_SURFACE_STATE_TOP_RESIZABLE;
|
||||
if (edge_constraints & GDK_TOPLEVEL_STATE_TOP_RESIZABLE)
|
||||
local_set |= GDK_TOPLEVEL_STATE_TOP_RESIZABLE;
|
||||
}
|
||||
|
||||
/* Right edge */
|
||||
if (old_state & GDK_SURFACE_STATE_RIGHT_TILED)
|
||||
if (old_state & GDK_TOPLEVEL_STATE_RIGHT_TILED)
|
||||
{
|
||||
if ((edge_constraints & GDK_SURFACE_STATE_RIGHT_TILED) == 0)
|
||||
local_unset |= GDK_SURFACE_STATE_RIGHT_TILED;
|
||||
if ((edge_constraints & GDK_TOPLEVEL_STATE_RIGHT_TILED) == 0)
|
||||
local_unset |= GDK_TOPLEVEL_STATE_RIGHT_TILED;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (edge_constraints & GDK_SURFACE_STATE_RIGHT_TILED)
|
||||
local_set |= GDK_SURFACE_STATE_RIGHT_TILED;
|
||||
if (edge_constraints & GDK_TOPLEVEL_STATE_RIGHT_TILED)
|
||||
local_set |= GDK_TOPLEVEL_STATE_RIGHT_TILED;
|
||||
}
|
||||
|
||||
if (old_state & GDK_SURFACE_STATE_RIGHT_RESIZABLE)
|
||||
if (old_state & GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE)
|
||||
{
|
||||
if ((edge_constraints & GDK_SURFACE_STATE_RIGHT_RESIZABLE) == 0)
|
||||
local_unset |= GDK_SURFACE_STATE_RIGHT_RESIZABLE;
|
||||
if ((edge_constraints & GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE) == 0)
|
||||
local_unset |= GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (edge_constraints & GDK_SURFACE_STATE_RIGHT_RESIZABLE)
|
||||
local_set |= GDK_SURFACE_STATE_RIGHT_RESIZABLE;
|
||||
if (edge_constraints & GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE)
|
||||
local_set |= GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE;
|
||||
}
|
||||
|
||||
/* Bottom edge */
|
||||
if (old_state & GDK_SURFACE_STATE_BOTTOM_TILED)
|
||||
if (old_state & GDK_TOPLEVEL_STATE_BOTTOM_TILED)
|
||||
{
|
||||
if ((edge_constraints & GDK_SURFACE_STATE_BOTTOM_TILED) == 0)
|
||||
local_unset |= GDK_SURFACE_STATE_BOTTOM_TILED;
|
||||
if ((edge_constraints & GDK_TOPLEVEL_STATE_BOTTOM_TILED) == 0)
|
||||
local_unset |= GDK_TOPLEVEL_STATE_BOTTOM_TILED;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (edge_constraints & GDK_SURFACE_STATE_BOTTOM_TILED)
|
||||
local_set |= GDK_SURFACE_STATE_BOTTOM_TILED;
|
||||
if (edge_constraints & GDK_TOPLEVEL_STATE_BOTTOM_TILED)
|
||||
local_set |= GDK_TOPLEVEL_STATE_BOTTOM_TILED;
|
||||
}
|
||||
|
||||
if (old_state & GDK_SURFACE_STATE_BOTTOM_RESIZABLE)
|
||||
if (old_state & GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE)
|
||||
{
|
||||
if ((edge_constraints & GDK_SURFACE_STATE_BOTTOM_RESIZABLE) == 0)
|
||||
local_unset |= GDK_SURFACE_STATE_BOTTOM_RESIZABLE;
|
||||
if ((edge_constraints & GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE) == 0)
|
||||
local_unset |= GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (edge_constraints & GDK_SURFACE_STATE_BOTTOM_RESIZABLE)
|
||||
local_set |= GDK_SURFACE_STATE_BOTTOM_RESIZABLE;
|
||||
if (edge_constraints & GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE)
|
||||
local_set |= GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE;
|
||||
}
|
||||
|
||||
/* Left edge */
|
||||
if (old_state & GDK_SURFACE_STATE_LEFT_TILED)
|
||||
if (old_state & GDK_TOPLEVEL_STATE_LEFT_TILED)
|
||||
{
|
||||
if ((edge_constraints & GDK_SURFACE_STATE_LEFT_TILED) == 0)
|
||||
local_unset |= GDK_SURFACE_STATE_LEFT_TILED;
|
||||
if ((edge_constraints & GDK_TOPLEVEL_STATE_LEFT_TILED) == 0)
|
||||
local_unset |= GDK_TOPLEVEL_STATE_LEFT_TILED;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (edge_constraints & GDK_SURFACE_STATE_LEFT_TILED)
|
||||
local_set |= GDK_SURFACE_STATE_LEFT_TILED;
|
||||
if (edge_constraints & GDK_TOPLEVEL_STATE_LEFT_TILED)
|
||||
local_set |= GDK_TOPLEVEL_STATE_LEFT_TILED;
|
||||
}
|
||||
|
||||
if (old_state & GDK_SURFACE_STATE_LEFT_RESIZABLE)
|
||||
if (old_state & GDK_TOPLEVEL_STATE_LEFT_RESIZABLE)
|
||||
{
|
||||
if ((edge_constraints & GDK_SURFACE_STATE_LEFT_RESIZABLE) == 0)
|
||||
local_unset |= GDK_SURFACE_STATE_LEFT_RESIZABLE;
|
||||
if ((edge_constraints & GDK_TOPLEVEL_STATE_LEFT_RESIZABLE) == 0)
|
||||
local_unset |= GDK_TOPLEVEL_STATE_LEFT_RESIZABLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (edge_constraints & GDK_SURFACE_STATE_LEFT_RESIZABLE)
|
||||
local_set |= GDK_SURFACE_STATE_LEFT_RESIZABLE;
|
||||
if (edge_constraints & GDK_TOPLEVEL_STATE_LEFT_RESIZABLE)
|
||||
local_set |= GDK_TOPLEVEL_STATE_LEFT_RESIZABLE;
|
||||
}
|
||||
|
||||
*set = local_set;
|
||||
@ -371,7 +371,7 @@ static void
|
||||
do_net_wm_state_changes (GdkSurface *surface)
|
||||
{
|
||||
GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (surface);
|
||||
GdkSurfaceState old_state, set, unset;
|
||||
GdkToplevelState old_state, set, unset;
|
||||
|
||||
if (GDK_SURFACE_DESTROYED (surface) ||
|
||||
!GDK_IS_TOPLEVEL (surface))
|
||||
@ -381,51 +381,51 @@ do_net_wm_state_changes (GdkSurface *surface)
|
||||
|
||||
set = unset = 0;
|
||||
|
||||
if (old_state & GDK_SURFACE_STATE_FULLSCREEN)
|
||||
if (old_state & GDK_TOPLEVEL_STATE_FULLSCREEN)
|
||||
{
|
||||
if (!toplevel->have_fullscreen)
|
||||
unset |= GDK_SURFACE_STATE_FULLSCREEN;
|
||||
unset |= GDK_TOPLEVEL_STATE_FULLSCREEN;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (toplevel->have_fullscreen)
|
||||
set |= GDK_SURFACE_STATE_FULLSCREEN;
|
||||
set |= GDK_TOPLEVEL_STATE_FULLSCREEN;
|
||||
}
|
||||
|
||||
/* Our "maximized" means both vertical and horizontal; if only one,
|
||||
* we don't expose that via GDK
|
||||
*/
|
||||
if (old_state & GDK_SURFACE_STATE_MAXIMIZED)
|
||||
if (old_state & GDK_TOPLEVEL_STATE_MAXIMIZED)
|
||||
{
|
||||
if (!(toplevel->have_maxvert && toplevel->have_maxhorz))
|
||||
unset |= GDK_SURFACE_STATE_MAXIMIZED;
|
||||
unset |= GDK_TOPLEVEL_STATE_MAXIMIZED;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (toplevel->have_maxvert && toplevel->have_maxhorz)
|
||||
set |= GDK_SURFACE_STATE_MAXIMIZED;
|
||||
set |= GDK_TOPLEVEL_STATE_MAXIMIZED;
|
||||
}
|
||||
|
||||
if (old_state & GDK_SURFACE_STATE_FOCUSED)
|
||||
if (old_state & GDK_TOPLEVEL_STATE_FOCUSED)
|
||||
{
|
||||
if (!toplevel->have_focused)
|
||||
unset |= GDK_SURFACE_STATE_FOCUSED;
|
||||
unset |= GDK_TOPLEVEL_STATE_FOCUSED;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (toplevel->have_focused)
|
||||
set |= GDK_SURFACE_STATE_FOCUSED;
|
||||
set |= GDK_TOPLEVEL_STATE_FOCUSED;
|
||||
}
|
||||
|
||||
if (old_state & GDK_SURFACE_STATE_MINIMIZED)
|
||||
if (old_state & GDK_TOPLEVEL_STATE_MINIMIZED)
|
||||
{
|
||||
if (!toplevel->have_hidden)
|
||||
unset |= GDK_SURFACE_STATE_MINIMIZED;
|
||||
unset |= GDK_TOPLEVEL_STATE_MINIMIZED;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (toplevel->have_hidden)
|
||||
set |= GDK_SURFACE_STATE_MINIMIZED;
|
||||
set |= GDK_TOPLEVEL_STATE_MINIMIZED;
|
||||
}
|
||||
|
||||
/* Update edge constraints and tiling */
|
||||
@ -827,7 +827,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
|
||||
if (GDK_SURFACE_IS_MAPPED (surface))
|
||||
gdk_synthesize_surface_state (surface,
|
||||
0,
|
||||
GDK_SURFACE_STATE_MINIMIZED);
|
||||
GDK_TOPLEVEL_STATE_MINIMIZED);
|
||||
}
|
||||
|
||||
if (surface_impl->toplevel &&
|
||||
@ -855,9 +855,9 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
|
||||
if (surface && !is_substructure)
|
||||
{
|
||||
/* Unset minimized if it was set */
|
||||
if (surface->state & GDK_SURFACE_STATE_MINIMIZED)
|
||||
if (surface->state & GDK_TOPLEVEL_STATE_MINIMIZED)
|
||||
gdk_synthesize_surface_state (surface,
|
||||
GDK_SURFACE_STATE_MINIMIZED,
|
||||
GDK_TOPLEVEL_STATE_MINIMIZED,
|
||||
0);
|
||||
|
||||
if (toplevel)
|
||||
|
@ -2030,7 +2030,7 @@ _gdk_x11_surface_drag_begin (GdkSurface *surface,
|
||||
if (gdk_x11_surface_get_group (surface))
|
||||
gdk_x11_surface_set_group (x11_drag->ipc_surface, surface);
|
||||
|
||||
gdk_synthesize_surface_state (x11_drag->ipc_surface, GDK_SURFACE_STATE_WITHDRAWN, 0);
|
||||
gdk_synthesize_surface_state (x11_drag->ipc_surface, GDK_TOPLEVEL_STATE_WITHDRAWN, 0);
|
||||
gdk_x11_surface_show (x11_drag->ipc_surface, FALSE);
|
||||
|
||||
x11_drag->drag_surface = create_drag_surface (display);
|
||||
|
@ -716,7 +716,7 @@ on_surface_state_changed (GdkGLContext *context)
|
||||
{
|
||||
GdkSurface *surface = gdk_gl_context_get_surface (context);
|
||||
|
||||
if ((surface->state & GDK_SURFACE_STATE_WITHDRAWN) == 0)
|
||||
if ((surface->state & GDK_TOPLEVEL_STATE_WITHDRAWN) == 0)
|
||||
return;
|
||||
|
||||
/* If we're about to withdraw the surface, then we don't care if the frame is
|
||||
|
@ -47,7 +47,7 @@ gdk_monitor_has_fullscreen_window (GdkMonitor *monitor)
|
||||
if (!GDK_IS_TOPLEVEL (surface))
|
||||
continue;
|
||||
|
||||
if ((gdk_toplevel_get_state (GDK_TOPLEVEL (surface)) & GDK_SURFACE_STATE_FULLSCREEN) == 0)
|
||||
if ((gdk_toplevel_get_state (GDK_TOPLEVEL (surface)) & GDK_TOPLEVEL_STATE_FULLSCREEN) == 0)
|
||||
continue;
|
||||
|
||||
if (surface->fullscreen_mode == GDK_FULLSCREEN_ON_ALL_MONITORS ||
|
||||
|
@ -1168,14 +1168,14 @@ update_wm_hints (GdkSurface *surface,
|
||||
|
||||
if (!force &&
|
||||
!toplevel->is_leader &&
|
||||
surface->state & GDK_SURFACE_STATE_WITHDRAWN)
|
||||
surface->state & GDK_TOPLEVEL_STATE_WITHDRAWN)
|
||||
return;
|
||||
|
||||
wm_hints.flags = StateHint | InputHint;
|
||||
wm_hints.input = True;
|
||||
wm_hints.initial_state = NormalState;
|
||||
|
||||
if (surface->state & GDK_SURFACE_STATE_MINIMIZED)
|
||||
if (surface->state & GDK_TOPLEVEL_STATE_MINIMIZED)
|
||||
{
|
||||
wm_hints.flags |= StateHint;
|
||||
wm_hints.initial_state = IconicState;
|
||||
@ -1234,7 +1234,7 @@ set_initial_hints (GdkSurface *surface)
|
||||
|
||||
i = 0;
|
||||
|
||||
if (surface->state & GDK_SURFACE_STATE_MAXIMIZED)
|
||||
if (surface->state & GDK_TOPLEVEL_STATE_MAXIMIZED)
|
||||
{
|
||||
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_WM_STATE_MAXIMIZED_VERT");
|
||||
@ -1245,21 +1245,21 @@ set_initial_hints (GdkSurface *surface)
|
||||
toplevel->have_maxhorz = toplevel->have_maxvert = TRUE;
|
||||
}
|
||||
|
||||
if (surface->state & GDK_SURFACE_STATE_ABOVE)
|
||||
if (surface->state & GDK_TOPLEVEL_STATE_ABOVE)
|
||||
{
|
||||
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_WM_STATE_ABOVE");
|
||||
++i;
|
||||
}
|
||||
|
||||
if (surface->state & GDK_SURFACE_STATE_BELOW)
|
||||
if (surface->state & GDK_TOPLEVEL_STATE_BELOW)
|
||||
{
|
||||
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_WM_STATE_BELOW");
|
||||
++i;
|
||||
}
|
||||
|
||||
if (surface->state & GDK_SURFACE_STATE_FULLSCREEN)
|
||||
if (surface->state & GDK_TOPLEVEL_STATE_FULLSCREEN)
|
||||
{
|
||||
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_WM_STATE_FULLSCREEN");
|
||||
@ -1288,7 +1288,7 @@ set_initial_hints (GdkSurface *surface)
|
||||
++i;
|
||||
}
|
||||
|
||||
if (surface->state & GDK_SURFACE_STATE_MINIMIZED)
|
||||
if (surface->state & GDK_TOPLEVEL_STATE_MINIMIZED)
|
||||
{
|
||||
atoms[i] = gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_WM_STATE_HIDDEN");
|
||||
@ -1311,7 +1311,7 @@ set_initial_hints (GdkSurface *surface)
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"));
|
||||
}
|
||||
|
||||
if (surface->state & GDK_SURFACE_STATE_STICKY)
|
||||
if (surface->state & GDK_TOPLEVEL_STATE_STICKY)
|
||||
{
|
||||
atoms[0] = 0xFFFFFFFF;
|
||||
XChangeProperty (xdisplay,
|
||||
@ -1377,7 +1377,7 @@ gdk_x11_surface_withdraw (GdkSurface *surface)
|
||||
if (GDK_SURFACE_IS_MAPPED (surface))
|
||||
gdk_synthesize_surface_state (surface,
|
||||
0,
|
||||
GDK_SURFACE_STATE_WITHDRAWN);
|
||||
GDK_TOPLEVEL_STATE_WITHDRAWN);
|
||||
|
||||
g_assert (!GDK_SURFACE_IS_MAPPED (surface));
|
||||
XWithdrawWindow (GDK_SURFACE_XDISPLAY (surface),
|
||||
@ -1596,7 +1596,7 @@ static void
|
||||
show_popup (GdkSurface *surface)
|
||||
{
|
||||
gdk_x11_surface_raise (surface);
|
||||
gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_WITHDRAWN, 0);
|
||||
gdk_synthesize_surface_state (surface, GDK_TOPLEVEL_STATE_WITHDRAWN, 0);
|
||||
gdk_x11_surface_show (surface, FALSE);
|
||||
gdk_surface_invalidate_rect (surface, NULL);
|
||||
}
|
||||
@ -3075,7 +3075,7 @@ gdk_x11_surface_minimize (GdkSurface *surface)
|
||||
else
|
||||
{
|
||||
/* Flip our client side flag, the real work happens on map. */
|
||||
gdk_synthesize_surface_state (surface, 0, GDK_SURFACE_STATE_MINIMIZED);
|
||||
gdk_synthesize_surface_state (surface, 0, GDK_TOPLEVEL_STATE_MINIMIZED);
|
||||
gdk_wmspec_change_state (TRUE, surface,
|
||||
"_NET_WM_STATE_HIDDEN",
|
||||
NULL);
|
||||
@ -3098,7 +3098,7 @@ gdk_x11_surface_unminimize (GdkSurface *surface)
|
||||
else
|
||||
{
|
||||
/* Flip our client side flag, the real work happens on map. */
|
||||
gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_MINIMIZED, 0);
|
||||
gdk_synthesize_surface_state (surface, GDK_TOPLEVEL_STATE_MINIMIZED, 0);
|
||||
gdk_wmspec_change_state (FALSE, surface,
|
||||
"_NET_WM_STATE_HIDDEN",
|
||||
NULL);
|
||||
@ -3118,7 +3118,7 @@ gdk_x11_surface_maximize (GdkSurface *surface)
|
||||
else
|
||||
gdk_synthesize_surface_state (surface,
|
||||
0,
|
||||
GDK_SURFACE_STATE_MAXIMIZED);
|
||||
GDK_TOPLEVEL_STATE_MAXIMIZED);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -3133,7 +3133,7 @@ gdk_x11_surface_unmaximize (GdkSurface *surface)
|
||||
"_NET_WM_STATE_MAXIMIZED_HORZ");
|
||||
else
|
||||
gdk_synthesize_surface_state (surface,
|
||||
GDK_SURFACE_STATE_MAXIMIZED,
|
||||
GDK_TOPLEVEL_STATE_MAXIMIZED,
|
||||
0);
|
||||
}
|
||||
|
||||
@ -3248,7 +3248,7 @@ gdk_x11_surface_fullscreen (GdkSurface *surface)
|
||||
else
|
||||
gdk_synthesize_surface_state (surface,
|
||||
0,
|
||||
GDK_SURFACE_STATE_FULLSCREEN);
|
||||
GDK_TOPLEVEL_STATE_FULLSCREEN);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -3281,7 +3281,7 @@ gdk_x11_surface_unfullscreen (GdkSurface *surface)
|
||||
|
||||
else
|
||||
gdk_synthesize_surface_state (surface,
|
||||
GDK_SURFACE_STATE_FULLSCREEN,
|
||||
GDK_TOPLEVEL_STATE_FULLSCREEN,
|
||||
0);
|
||||
}
|
||||
|
||||
@ -3790,7 +3790,7 @@ check_maximize (MoveResizeData *mv_resize,
|
||||
double x_root,
|
||||
double y_root)
|
||||
{
|
||||
GdkSurfaceState state;
|
||||
GdkToplevelState state;
|
||||
int y;
|
||||
|
||||
if (mv_resize->is_resize)
|
||||
@ -3798,7 +3798,7 @@ check_maximize (MoveResizeData *mv_resize,
|
||||
|
||||
state = gdk_toplevel_get_state (GDK_TOPLEVEL (mv_resize->moveresize_surface));
|
||||
|
||||
if (state & GDK_SURFACE_STATE_MAXIMIZED)
|
||||
if (state & GDK_TOPLEVEL_STATE_MAXIMIZED)
|
||||
return;
|
||||
|
||||
y = mv_resize->moveresize_orig_y + (y_root - mv_resize->moveresize_y);
|
||||
@ -3812,7 +3812,7 @@ check_unmaximize (MoveResizeData *mv_resize,
|
||||
double x_root,
|
||||
double y_root)
|
||||
{
|
||||
GdkSurfaceState state;
|
||||
GdkToplevelState state;
|
||||
int dx, dy;
|
||||
|
||||
if (mv_resize->is_resize)
|
||||
@ -3820,7 +3820,7 @@ check_unmaximize (MoveResizeData *mv_resize,
|
||||
|
||||
state = gdk_toplevel_get_state (GDK_TOPLEVEL (mv_resize->moveresize_surface));
|
||||
|
||||
if ((state & (GDK_SURFACE_STATE_MAXIMIZED | GDK_SURFACE_STATE_TILED)) == 0)
|
||||
if ((state & (GDK_TOPLEVEL_STATE_MAXIMIZED | GDK_TOPLEVEL_STATE_TILED)) == 0)
|
||||
return;
|
||||
|
||||
dx = x_root - mv_resize->moveresize_x;
|
||||
@ -4923,7 +4923,7 @@ gdk_x11_toplevel_present (GdkToplevel *toplevel,
|
||||
was_mapped = GDK_SURFACE_IS_MAPPED (surface);
|
||||
|
||||
if (!was_mapped)
|
||||
gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_WITHDRAWN, 0);
|
||||
gdk_synthesize_surface_state (surface, GDK_TOPLEVEL_STATE_WITHDRAWN, 0);
|
||||
|
||||
gdk_x11_surface_show (surface, was_mapped);
|
||||
|
||||
@ -4980,7 +4980,7 @@ gdk_x11_toplevel_inhibit_system_shortcuts (GdkToplevel *toplevel,
|
||||
if (surface->shortcuts_inhibited)
|
||||
return; /* Already inhibited */
|
||||
|
||||
if (!(surface->state & GDK_SURFACE_STATE_FOCUSED))
|
||||
if (!(surface->state & GDK_TOPLEVEL_STATE_FOCUSED))
|
||||
return;
|
||||
|
||||
gdk_seat = gdk_surface_get_seat_from_event (surface, gdk_event);
|
||||
@ -5019,7 +5019,7 @@ gdk_x11_toplevel_restore_system_shortcuts (GdkToplevel *toplevel)
|
||||
static void
|
||||
gdk_x11_toplevel_state_callback (GdkSurface *surface)
|
||||
{
|
||||
if (surface->state & GDK_SURFACE_STATE_FOCUSED)
|
||||
if (surface->state & GDK_TOPLEVEL_STATE_FOCUSED)
|
||||
return;
|
||||
|
||||
if (surface->shortcuts_inhibited)
|
||||
@ -5096,7 +5096,7 @@ gdk_x11_drag_surface_present (GdkDragSurface *drag_surface,
|
||||
GdkSurface *surface = GDK_SURFACE (drag_surface);
|
||||
|
||||
gdk_x11_surface_toplevel_resize (surface, width, height);
|
||||
gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_WITHDRAWN, 0);
|
||||
gdk_synthesize_surface_state (surface, GDK_TOPLEVEL_STATE_WITHDRAWN, 0);
|
||||
gdk_x11_surface_show (surface, FALSE);
|
||||
gdk_surface_invalidate_rect (surface, NULL);
|
||||
|
||||
|
@ -128,7 +128,7 @@ struct _GtkHeaderBar
|
||||
guint show_title_buttons : 1;
|
||||
guint track_default_decoration : 1;
|
||||
|
||||
GdkSurfaceState state;
|
||||
GdkToplevelState state;
|
||||
};
|
||||
|
||||
typedef struct _GtkHeaderBarClass GtkHeaderBarClass;
|
||||
@ -609,7 +609,7 @@ gtk_header_bar_init (GtkHeaderBar *bar)
|
||||
bar->title_widget = NULL;
|
||||
bar->decoration_layout = NULL;
|
||||
bar->show_title_buttons = TRUE;
|
||||
bar->state = GDK_SURFACE_STATE_WITHDRAWN;
|
||||
bar->state = GDK_TOPLEVEL_STATE_WITHDRAWN;
|
||||
|
||||
bar->handle = gtk_window_handle_new ();
|
||||
gtk_widget_set_parent (bar->handle, GTK_WIDGET (bar));
|
||||
|
@ -47,7 +47,7 @@ struct _GtkTooltipWindow
|
||||
GdkSurface *surface;
|
||||
GskRenderer *renderer;
|
||||
|
||||
GdkSurfaceState state;
|
||||
GdkToplevelState state;
|
||||
GtkWidget *relative_to;
|
||||
GdkRectangle rect;
|
||||
GdkGravity rect_anchor;
|
||||
@ -173,16 +173,16 @@ static void
|
||||
surface_state_changed (GtkWidget *widget)
|
||||
{
|
||||
GtkTooltipWindow *window = GTK_TOOLTIP_WINDOW (widget);
|
||||
GdkSurfaceState new_surface_state;
|
||||
GdkSurfaceState changed_mask;
|
||||
GdkToplevelState new_surface_state;
|
||||
GdkToplevelState changed_mask;
|
||||
|
||||
new_surface_state = gdk_toplevel_get_state (GDK_TOPLEVEL (window->surface));
|
||||
changed_mask = new_surface_state ^ window->state;
|
||||
window->state = new_surface_state;
|
||||
|
||||
if (changed_mask & GDK_SURFACE_STATE_WITHDRAWN)
|
||||
if (changed_mask & GDK_TOPLEVEL_STATE_WITHDRAWN)
|
||||
{
|
||||
if (window->state & GDK_SURFACE_STATE_WITHDRAWN)
|
||||
if (window->state & GDK_TOPLEVEL_STATE_WITHDRAWN)
|
||||
gtk_widget_hide (widget);
|
||||
}
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ typedef struct
|
||||
GdkMonitor *initial_fullscreen_monitor;
|
||||
guint edge_constraints;
|
||||
|
||||
GdkSurfaceState state;
|
||||
GdkToplevelState state;
|
||||
|
||||
/* The following flags are initially TRUE (before a window is mapped).
|
||||
* They cause us to compute a configure request that involves
|
||||
@ -1164,21 +1164,21 @@ constraints_for_edge (GdkSurfaceEdge edge)
|
||||
switch (edge)
|
||||
{
|
||||
case GDK_SURFACE_EDGE_NORTH_WEST:
|
||||
return GDK_SURFACE_STATE_LEFT_RESIZABLE | GDK_SURFACE_STATE_TOP_RESIZABLE;
|
||||
return GDK_TOPLEVEL_STATE_LEFT_RESIZABLE | GDK_TOPLEVEL_STATE_TOP_RESIZABLE;
|
||||
case GDK_SURFACE_EDGE_NORTH:
|
||||
return GDK_SURFACE_STATE_TOP_RESIZABLE;
|
||||
return GDK_TOPLEVEL_STATE_TOP_RESIZABLE;
|
||||
case GDK_SURFACE_EDGE_NORTH_EAST:
|
||||
return GDK_SURFACE_STATE_RIGHT_RESIZABLE | GDK_SURFACE_STATE_TOP_RESIZABLE;
|
||||
return GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE | GDK_TOPLEVEL_STATE_TOP_RESIZABLE;
|
||||
case GDK_SURFACE_EDGE_WEST:
|
||||
return GDK_SURFACE_STATE_LEFT_RESIZABLE;
|
||||
return GDK_TOPLEVEL_STATE_LEFT_RESIZABLE;
|
||||
case GDK_SURFACE_EDGE_EAST:
|
||||
return GDK_SURFACE_STATE_RIGHT_RESIZABLE;
|
||||
return GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE;
|
||||
case GDK_SURFACE_EDGE_SOUTH_WEST:
|
||||
return GDK_SURFACE_STATE_LEFT_RESIZABLE | GDK_SURFACE_STATE_BOTTOM_RESIZABLE;
|
||||
return GDK_TOPLEVEL_STATE_LEFT_RESIZABLE | GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE;
|
||||
case GDK_SURFACE_EDGE_SOUTH:
|
||||
return GDK_SURFACE_STATE_BOTTOM_RESIZABLE;
|
||||
return GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE;
|
||||
case GDK_SURFACE_EDGE_SOUTH_EAST:
|
||||
return GDK_SURFACE_STATE_RIGHT_RESIZABLE | GDK_SURFACE_STATE_BOTTOM_RESIZABLE;
|
||||
return GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE | GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE;
|
||||
default:
|
||||
g_warn_if_reached ();
|
||||
return 0;
|
||||
@ -1474,7 +1474,7 @@ gtk_window_init (GtkWindow *window)
|
||||
priv->decorated = TRUE;
|
||||
priv->display = gdk_display_get_default ();
|
||||
|
||||
priv->state = GDK_SURFACE_STATE_WITHDRAWN;
|
||||
priv->state = GDK_TOPLEVEL_STATE_WITHDRAWN;
|
||||
|
||||
priv->deletable = TRUE;
|
||||
priv->startup_id = NULL;
|
||||
@ -3905,7 +3905,7 @@ gtk_window_unmap (GtkWidget *widget)
|
||||
GtkWindow *window = GTK_WINDOW (widget);
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
GtkWidget *child = priv->child;
|
||||
GdkSurfaceState state;
|
||||
GdkToplevelState state;
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_window_parent_class)->unmap (widget);
|
||||
gdk_surface_hide (priv->surface);
|
||||
@ -3918,8 +3918,8 @@ gtk_window_unmap (GtkWidget *widget)
|
||||
priv->configure_notify_received = FALSE;
|
||||
|
||||
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->minimize_initially = (state & GDK_TOPLEVEL_STATE_MINIMIZED) != 0;
|
||||
priv->maximize_initially = (state & GDK_TOPLEVEL_STATE_MAXIMIZED) != 0;
|
||||
|
||||
if (priv->title_box != NULL)
|
||||
gtk_widget_unmap (priv->title_box);
|
||||
@ -4528,22 +4528,22 @@ update_window_style_classes (GtkWindow *window)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (edge_constraints & GDK_SURFACE_STATE_TOP_TILED)
|
||||
if (edge_constraints & GDK_TOPLEVEL_STATE_TOP_TILED)
|
||||
gtk_widget_add_css_class (widget, "tiled-top");
|
||||
else
|
||||
gtk_widget_remove_css_class (widget, "tiled-top");
|
||||
|
||||
if (edge_constraints & GDK_SURFACE_STATE_RIGHT_TILED)
|
||||
if (edge_constraints & GDK_TOPLEVEL_STATE_RIGHT_TILED)
|
||||
gtk_widget_add_css_class (widget, "tiled-right");
|
||||
else
|
||||
gtk_widget_remove_css_class (widget, "tiled-right");
|
||||
|
||||
if (edge_constraints & GDK_SURFACE_STATE_BOTTOM_TILED)
|
||||
if (edge_constraints & GDK_TOPLEVEL_STATE_BOTTOM_TILED)
|
||||
gtk_widget_add_css_class (widget, "tiled-bottom");
|
||||
else
|
||||
gtk_widget_remove_css_class (widget, "tiled-bottom");
|
||||
|
||||
if (edge_constraints & GDK_SURFACE_STATE_LEFT_TILED)
|
||||
if (edge_constraints & GDK_TOPLEVEL_STATE_LEFT_TILED)
|
||||
gtk_widget_add_css_class (widget, "tiled-left");
|
||||
else
|
||||
gtk_widget_remove_css_class (widget, "tiled-left");
|
||||
@ -4656,20 +4656,20 @@ gtk_window_size_allocate (GtkWidget *widget,
|
||||
|
||||
static void
|
||||
update_edge_constraints (GtkWindow *window,
|
||||
GdkSurfaceState state)
|
||||
GdkToplevelState state)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
priv->edge_constraints = (state & GDK_SURFACE_STATE_TOP_TILED) |
|
||||
(state & GDK_SURFACE_STATE_TOP_RESIZABLE) |
|
||||
(state & GDK_SURFACE_STATE_RIGHT_TILED) |
|
||||
(state & GDK_SURFACE_STATE_RIGHT_RESIZABLE) |
|
||||
(state & GDK_SURFACE_STATE_BOTTOM_TILED) |
|
||||
(state & GDK_SURFACE_STATE_BOTTOM_RESIZABLE) |
|
||||
(state & GDK_SURFACE_STATE_LEFT_TILED) |
|
||||
(state & GDK_SURFACE_STATE_LEFT_RESIZABLE);
|
||||
priv->edge_constraints = (state & GDK_TOPLEVEL_STATE_TOP_TILED) |
|
||||
(state & GDK_TOPLEVEL_STATE_TOP_RESIZABLE) |
|
||||
(state & GDK_TOPLEVEL_STATE_RIGHT_TILED) |
|
||||
(state & GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE) |
|
||||
(state & GDK_TOPLEVEL_STATE_BOTTOM_TILED) |
|
||||
(state & GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE) |
|
||||
(state & GDK_TOPLEVEL_STATE_LEFT_TILED) |
|
||||
(state & GDK_TOPLEVEL_STATE_LEFT_RESIZABLE);
|
||||
|
||||
priv->tiled = (state & GDK_SURFACE_STATE_TILED) ? 1 : 0;
|
||||
priv->tiled = (state & GDK_TOPLEVEL_STATE_TILED) ? 1 : 0;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -4677,16 +4677,16 @@ surface_state_changed (GtkWidget *widget)
|
||||
{
|
||||
GtkWindow *window = GTK_WINDOW (widget);
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
GdkSurfaceState new_surface_state;
|
||||
GdkSurfaceState changed_mask;
|
||||
GdkToplevelState new_surface_state;
|
||||
GdkToplevelState changed_mask;
|
||||
|
||||
new_surface_state = gdk_toplevel_get_state (GDK_TOPLEVEL (priv->surface));
|
||||
changed_mask = new_surface_state ^ priv->state;
|
||||
priv->state = new_surface_state;
|
||||
|
||||
if (changed_mask & GDK_SURFACE_STATE_FOCUSED)
|
||||
if (changed_mask & GDK_TOPLEVEL_STATE_FOCUSED)
|
||||
{
|
||||
gboolean focused = new_surface_state & GDK_SURFACE_STATE_FOCUSED;
|
||||
gboolean focused = new_surface_state & GDK_TOPLEVEL_STATE_FOCUSED;
|
||||
|
||||
ensure_state_flag_backdrop (widget);
|
||||
|
||||
@ -4694,25 +4694,25 @@ surface_state_changed (GtkWidget *widget)
|
||||
gtk_window_set_mnemonics_visible (window, FALSE);
|
||||
}
|
||||
|
||||
if (changed_mask & GDK_SURFACE_STATE_FULLSCREEN)
|
||||
priv->fullscreen = (new_surface_state & GDK_SURFACE_STATE_FULLSCREEN) ? TRUE : FALSE;
|
||||
if (changed_mask & GDK_TOPLEVEL_STATE_FULLSCREEN)
|
||||
priv->fullscreen = (new_surface_state & GDK_TOPLEVEL_STATE_FULLSCREEN) ? TRUE : FALSE;
|
||||
|
||||
if (changed_mask & GDK_SURFACE_STATE_MAXIMIZED)
|
||||
if (changed_mask & GDK_TOPLEVEL_STATE_MAXIMIZED)
|
||||
{
|
||||
priv->maximized = (new_surface_state & GDK_SURFACE_STATE_MAXIMIZED) ? TRUE : FALSE;
|
||||
priv->maximized = (new_surface_state & GDK_TOPLEVEL_STATE_MAXIMIZED) ? TRUE : FALSE;
|
||||
g_object_notify_by_pspec (G_OBJECT (widget), window_props[PROP_IS_MAXIMIZED]);
|
||||
}
|
||||
|
||||
update_edge_constraints (window, new_surface_state);
|
||||
|
||||
if (changed_mask & (GDK_SURFACE_STATE_FULLSCREEN |
|
||||
GDK_SURFACE_STATE_MAXIMIZED |
|
||||
GDK_SURFACE_STATE_TILED |
|
||||
GDK_SURFACE_STATE_TOP_TILED |
|
||||
GDK_SURFACE_STATE_RIGHT_TILED |
|
||||
GDK_SURFACE_STATE_BOTTOM_TILED |
|
||||
GDK_SURFACE_STATE_LEFT_TILED |
|
||||
GDK_SURFACE_STATE_MINIMIZED))
|
||||
if (changed_mask & (GDK_TOPLEVEL_STATE_FULLSCREEN |
|
||||
GDK_TOPLEVEL_STATE_MAXIMIZED |
|
||||
GDK_TOPLEVEL_STATE_TILED |
|
||||
GDK_TOPLEVEL_STATE_TOP_TILED |
|
||||
GDK_TOPLEVEL_STATE_RIGHT_TILED |
|
||||
GDK_TOPLEVEL_STATE_BOTTOM_TILED |
|
||||
GDK_TOPLEVEL_STATE_LEFT_TILED |
|
||||
GDK_TOPLEVEL_STATE_MINIMIZED))
|
||||
{
|
||||
update_window_style_classes (window);
|
||||
update_window_actions (window);
|
||||
@ -6563,7 +6563,7 @@ ensure_state_flag_backdrop (GtkWidget *widget)
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (GTK_WINDOW (widget));
|
||||
gboolean surface_focused = TRUE;
|
||||
|
||||
surface_focused = gdk_toplevel_get_state (GDK_TOPLEVEL (priv->surface)) & GDK_SURFACE_STATE_FOCUSED;
|
||||
surface_focused = gdk_toplevel_get_state (GDK_TOPLEVEL (priv->surface)) & GDK_TOPLEVEL_STATE_FOCUSED;
|
||||
|
||||
if (!surface_focused)
|
||||
gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_BACKDROP, FALSE);
|
||||
|
@ -4527,23 +4527,23 @@ surface_state_callback (GdkSurface *window,
|
||||
GtkWidget *label)
|
||||
{
|
||||
char *msg;
|
||||
GdkSurfaceState new_state;
|
||||
GdkToplevelState new_state;
|
||||
|
||||
new_state = gdk_toplevel_get_state (GDK_TOPLEVEL (window));
|
||||
msg = g_strconcat ((const char *)g_object_get_data (G_OBJECT (label), "title"), ": ",
|
||||
(new_state & GDK_SURFACE_STATE_WITHDRAWN) ?
|
||||
(new_state & GDK_TOPLEVEL_STATE_WITHDRAWN) ?
|
||||
"withdrawn" : "not withdrawn", ", ",
|
||||
(new_state & GDK_SURFACE_STATE_MINIMIZED) ?
|
||||
(new_state & GDK_TOPLEVEL_STATE_MINIMIZED) ?
|
||||
"minimized" : "not minimized", ", ",
|
||||
(new_state & GDK_SURFACE_STATE_STICKY) ?
|
||||
(new_state & GDK_TOPLEVEL_STATE_STICKY) ?
|
||||
"sticky" : "not sticky", ", ",
|
||||
(new_state & GDK_SURFACE_STATE_MAXIMIZED) ?
|
||||
(new_state & GDK_TOPLEVEL_STATE_MAXIMIZED) ?
|
||||
"maximized" : "not maximized", ", ",
|
||||
(new_state & GDK_SURFACE_STATE_FULLSCREEN) ?
|
||||
(new_state & GDK_TOPLEVEL_STATE_FULLSCREEN) ?
|
||||
"fullscreen" : "not fullscreen", ", ",
|
||||
(new_state & GDK_SURFACE_STATE_ABOVE) ?
|
||||
(new_state & GDK_TOPLEVEL_STATE_ABOVE) ?
|
||||
"above" : "not above", ", ",
|
||||
(new_state & GDK_SURFACE_STATE_BELOW) ?
|
||||
(new_state & GDK_TOPLEVEL_STATE_BELOW) ?
|
||||
"below" : "not below", ", ",
|
||||
NULL);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user