mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 02:40:11 +00:00
Move fullscreen-mode to GdkToplevel
This commit is contained in:
parent
81be6ff46b
commit
f020d77a23
@ -282,11 +282,6 @@ GdkSurface * gdk_surface_new_temp (GdkDisplay *display,
|
|||||||
const GdkRectangle *position);
|
const GdkRectangle *position);
|
||||||
|
|
||||||
|
|
||||||
void gdk_surface_set_fullscreen_mode (GdkSurface *surface,
|
|
||||||
GdkFullscreenMode mode);
|
|
||||||
GdkFullscreenMode gdk_surface_get_fullscreen_mode (GdkSurface *surface);
|
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GDK_INTERNALS_H__ */
|
#endif /* __GDK_INTERNALS_H__ */
|
||||||
|
@ -2337,29 +2337,6 @@ gdk_surface_create_similar_surface (GdkSurface * surface,
|
|||||||
return similar_surface;
|
return similar_surface;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
gdk_surface_set_fullscreen_mode (GdkSurface *surface,
|
|
||||||
GdkFullscreenMode mode)
|
|
||||||
{
|
|
||||||
g_return_if_fail (GDK_IS_SURFACE (surface));
|
|
||||||
|
|
||||||
if (surface->fullscreen_mode != mode)
|
|
||||||
{
|
|
||||||
surface->fullscreen_mode = mode;
|
|
||||||
|
|
||||||
if (GDK_SURFACE_GET_CLASS (surface)->apply_fullscreen_mode != NULL)
|
|
||||||
GDK_SURFACE_GET_CLASS (surface)->apply_fullscreen_mode (surface);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GdkFullscreenMode
|
|
||||||
gdk_surface_get_fullscreen_mode (GdkSurface *surface)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (GDK_IS_SURFACE (surface), GDK_FULLSCREEN_ON_CURRENT_MONITOR);
|
|
||||||
|
|
||||||
return surface->fullscreen_mode;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gdk_surface_begin_resize_drag:
|
* gdk_surface_begin_resize_drag:
|
||||||
* @surface: a toplevel #GdkSurface
|
* @surface: a toplevel #GdkSurface
|
||||||
|
@ -148,7 +148,6 @@ struct _GdkSurfaceClass
|
|||||||
/* optional */
|
/* optional */
|
||||||
gboolean (* beep) (GdkSurface *surface);
|
gboolean (* beep) (GdkSurface *surface);
|
||||||
|
|
||||||
void (* apply_fullscreen_mode) (GdkSurface *surface);
|
|
||||||
void (* begin_resize_drag) (GdkSurface *surface,
|
void (* begin_resize_drag) (GdkSurface *surface,
|
||||||
GdkSurfaceEdge edge,
|
GdkSurfaceEdge edge,
|
||||||
GdkDevice *device,
|
GdkDevice *device,
|
||||||
|
@ -164,6 +164,13 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
|
|||||||
"Deletable",
|
"Deletable",
|
||||||
FALSE,
|
FALSE,
|
||||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
||||||
|
g_object_interface_install_property (iface,
|
||||||
|
g_param_spec_enum ("fullscreen-mode",
|
||||||
|
"Fullscreen mode",
|
||||||
|
"Fullscreen mode",
|
||||||
|
GDK_TYPE_FULLSCREEN_MODE,
|
||||||
|
GDK_FULLSCREEN_ON_CURRENT_MONITOR,
|
||||||
|
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
||||||
}
|
}
|
||||||
|
|
||||||
guint
|
guint
|
||||||
@ -183,6 +190,7 @@ gdk_toplevel_install_properties (GObjectClass *object_class,
|
|||||||
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_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_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_DELETABLE, "deletable");
|
||||||
|
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_FULLSCREEN_MODE, "fullscreen-mode");
|
||||||
|
|
||||||
return GDK_TOPLEVEL_NUM_PROPERTIES;
|
return GDK_TOPLEVEL_NUM_PROPERTIES;
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@ typedef enum
|
|||||||
GDK_TOPLEVEL_PROP_FOCUS_ON_MAP,
|
GDK_TOPLEVEL_PROP_FOCUS_ON_MAP,
|
||||||
GDK_TOPLEVEL_PROP_DECORATED,
|
GDK_TOPLEVEL_PROP_DECORATED,
|
||||||
GDK_TOPLEVEL_PROP_DELETABLE,
|
GDK_TOPLEVEL_PROP_DELETABLE,
|
||||||
|
GDK_TOPLEVEL_PROP_FULLSCREEN_MODE,
|
||||||
GDK_TOPLEVEL_NUM_PROPERTIES
|
GDK_TOPLEVEL_NUM_PROPERTIES
|
||||||
} GdkToplevelProperties;
|
} GdkToplevelProperties;
|
||||||
|
|
||||||
|
@ -4371,6 +4371,11 @@ gdk_wayland_toplevel_set_property (GObject *object,
|
|||||||
case LAST_PROP + GDK_TOPLEVEL_PROP_DELETABLE:
|
case LAST_PROP + GDK_TOPLEVEL_PROP_DELETABLE:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case LAST_PROP + GDK_TOPLEVEL_PROP_FULLSCREEN_MODE:
|
||||||
|
surface->fullscreen_mode = g_value_get_enum (value);
|
||||||
|
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
@ -4433,6 +4438,10 @@ gdk_wayland_toplevel_get_property (GObject *object,
|
|||||||
case LAST_PROP + GDK_TOPLEVEL_PROP_DELETABLE:
|
case LAST_PROP + GDK_TOPLEVEL_PROP_DELETABLE:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case LAST_PROP + GDK_TOPLEVEL_PROP_FULLSCREEN_MODE:
|
||||||
|
g_value_set_enum (value, surface->fullscreen_mode);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -50,7 +50,7 @@ gdk_monitor_has_fullscreen_window (GdkMonitor *monitor)
|
|||||||
if ((gdk_toplevel_get_state (GDK_TOPLEVEL (surface)) & GDK_SURFACE_STATE_FULLSCREEN) == 0)
|
if ((gdk_toplevel_get_state (GDK_TOPLEVEL (surface)) & GDK_SURFACE_STATE_FULLSCREEN) == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (gdk_surface_get_fullscreen_mode (surface) == GDK_FULLSCREEN_ON_ALL_MONITORS ||
|
if (surface->fullscreen_mode == GDK_FULLSCREEN_ON_ALL_MONITORS ||
|
||||||
gdk_display_get_monitor_at_surface (monitor->display, surface) == monitor)
|
gdk_display_get_monitor_at_surface (monitor->display, surface) == monitor)
|
||||||
{
|
{
|
||||||
has_fullscreen = TRUE;
|
has_fullscreen = TRUE;
|
||||||
|
@ -1287,7 +1287,6 @@ gdk_x11_surface_withdraw (GdkSurface *surface)
|
|||||||
GDK_SURFACE_STATE_WITHDRAWN);
|
GDK_SURFACE_STATE_WITHDRAWN);
|
||||||
|
|
||||||
g_assert (!GDK_SURFACE_IS_MAPPED (surface));
|
g_assert (!GDK_SURFACE_IS_MAPPED (surface));
|
||||||
|
|
||||||
XWithdrawWindow (GDK_SURFACE_XDISPLAY (surface),
|
XWithdrawWindow (GDK_SURFACE_XDISPLAY (surface),
|
||||||
GDK_SURFACE_XID (surface), 0);
|
GDK_SURFACE_XID (surface), 0);
|
||||||
}
|
}
|
||||||
@ -3288,7 +3287,8 @@ gdk_x11_surface_fullscreen_on_monitor (GdkSurface *surface,
|
|||||||
gdk_monitor_get_geometry (monitor, &geom);
|
gdk_monitor_get_geometry (monitor, &geom);
|
||||||
gdk_x11_surface_move (surface, geom.x, geom.y);
|
gdk_x11_surface_move (surface, geom.x, geom.y);
|
||||||
|
|
||||||
gdk_surface_set_fullscreen_mode (surface, GDK_FULLSCREEN_ON_CURRENT_MONITOR);
|
surface->fullscreen_mode = GDK_FULLSCREEN_ON_CURRENT_MONITOR;
|
||||||
|
g_object_notify (G_OBJECT (surface), "fullscreen-mode");
|
||||||
gdk_x11_surface_fullscreen (surface);
|
gdk_x11_surface_fullscreen (surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4660,7 +4660,6 @@ gdk_x11_surface_class_init (GdkX11SurfaceClass *klass)
|
|||||||
impl_class->destroy = gdk_x11_surface_destroy;
|
impl_class->destroy = gdk_x11_surface_destroy;
|
||||||
impl_class->beep = gdk_x11_surface_beep;
|
impl_class->beep = gdk_x11_surface_beep;
|
||||||
|
|
||||||
impl_class->apply_fullscreen_mode = gdk_x11_surface_apply_fullscreen_mode;
|
|
||||||
impl_class->begin_resize_drag = gdk_x11_surface_begin_resize_drag;
|
impl_class->begin_resize_drag = gdk_x11_surface_begin_resize_drag;
|
||||||
impl_class->begin_move_drag = gdk_x11_surface_begin_move_drag;
|
impl_class->begin_move_drag = gdk_x11_surface_begin_move_drag;
|
||||||
impl_class->destroy_notify = gdk_x11_surface_destroy_notify;
|
impl_class->destroy_notify = gdk_x11_surface_destroy_notify;
|
||||||
@ -4889,6 +4888,12 @@ gdk_wayland_toplevel_set_property (GObject *object,
|
|||||||
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
|
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case LAST_PROP + GDK_TOPLEVEL_PROP_FULLSCREEN_MODE:
|
||||||
|
surface->fullscreen_mode = g_value_get_enum (value);
|
||||||
|
gdk_x11_surface_apply_fullscreen_mode (surface);
|
||||||
|
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
@ -4964,6 +4969,10 @@ gdk_wayland_toplevel_get_property (GObject *object,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case LAST_PROP + GDK_TOPLEVEL_PROP_FULLSCREEN_MODE:
|
||||||
|
g_value_set_enum (value, surface->fullscreen_mode);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user