static gboolean
gdk_surface_is_toplevel (GdkSurface *surface)
{
- return
- surface->parent == NULL ||
- surface->parent->surface_type == GDK_SURFACE_ROOT;
+ return surface->parent == NULL;
}
gboolean
/* Not for non-shaped toplevels */
(surface->shape != NULL || surface->applied_shape) &&
/* or for foreign surfaces */
- surface->surface_type != GDK_SURFACE_FOREIGN &&
- /* or for the root surface */
- surface->surface_type != GDK_SURFACE_ROOT;
+ surface->surface_type != GDK_SURFACE_FOREIGN;
}
static void
private->clip_region = new_clip;
}
- /* Update all children, recursively (except for root, where children are not exact). */
- if ((abs_pos_changed || clip_region_changed || recalculate_children) &&
- private->surface_type != GDK_SURFACE_ROOT)
+ /* Update all children, recursively */
+ if ((abs_pos_changed || clip_region_changed || recalculate_children))
{
for (l = private->children; l; l = l->next)
{
else
event_mask = private->event_mask;
- if (private->surface_type == GDK_SURFACE_ROOT ||
- private->surface_type == GDK_SURFACE_FOREIGN)
+ if (private->surface_type == GDK_SURFACE_FOREIGN)
return event_mask;
else
{
{
case GDK_SURFACE_TOPLEVEL:
case GDK_SURFACE_TEMP:
- if (parent != NULL && GDK_SURFACE_TYPE (parent) != GDK_SURFACE_ROOT)
- g_warning (G_STRLOC "Toplevel surfaces must be created as children of\n"
- "a surface of type GDK_SURFACE_ROOT");
+ if (parent != NULL)
+ g_warning (G_STRLOC "Toplevel surfaces must be created without a parent");
break;
case GDK_SURFACE_SUBSURFACE:
#ifdef GDK_WINDOWING_WAYLAND
#endif
break;
case GDK_SURFACE_CHILD:
- if (GDK_SURFACE_TYPE (parent) == GDK_SURFACE_ROOT ||
- GDK_SURFACE_TYPE (parent) == GDK_SURFACE_FOREIGN)
+ if (GDK_SURFACE_TYPE (parent) == GDK_SURFACE_FOREIGN)
{
g_warning (G_STRLOC "Child surfaces must not be created as children of\n"
- "a surface of type GDK_SURFACE_ROOT or GDK_SURFACE_FOREIGN");
+ "a surface of type GDK_SURFACE_FOREIGN");
return NULL;
}
break;
g_assert_not_reached ();
break;
- case GDK_SURFACE_ROOT:
- if (!gdk_display_is_closed (display))
- {
- g_error ("attempted to destroy root window");
- break;
- }
- /* else fall thru */
case GDK_SURFACE_TOPLEVEL:
case GDK_SURFACE_CHILD:
case GDK_SURFACE_TEMP:
if (surface->input_only ||
!surface->viewable ||
- cairo_region_is_empty (region) ||
- surface->surface_type == GDK_SURFACE_ROOT)
+ cairo_region_is_empty (region))
return;
r.x = 0;
{
gboolean viewable;
- if (surface->surface_type == GDK_SURFACE_FOREIGN ||
- surface->surface_type == GDK_SURFACE_ROOT)
+ if (surface->surface_type == GDK_SURFACE_FOREIGN)
viewable = TRUE;
else if (gdk_surface_is_toplevel (surface) ||
surface->parent->viewable)
g_assert (gdk_surface_get_display (surface) == gdk_device_get_display (device));
- if (surface->surface_type == GDK_SURFACE_ROOT ||
- surface->surface_type == GDK_SURFACE_FOREIGN)
+ if (surface->surface_type == GDK_SURFACE_FOREIGN)
GDK_DEVICE_GET_CLASS (device)->set_surface_cursor (device, surface, cursor);
else
{
{
GdkSurface *parent;
- while ((parent = surface->parent) != NULL &&
- (parent->surface_type != GDK_SURFACE_ROOT))
+ while ((parent = surface->parent) != NULL)
surface = parent;
return surface;
the cursor is inherited from the parent */
while (cursor_surface->cursor == NULL &&
!g_hash_table_contains (cursor_surface->device_cursor, device) &&
- (parent = cursor_surface->parent) != NULL &&
- parent->surface_type != GDK_SURFACE_ROOT)
+ (parent = cursor_surface->parent) != NULL)
cursor_surface = parent;
cursor = g_hash_table_lookup (cursor_surface->device_cursor, device);
}
#endif
- if (event_surface->surface_type == GDK_SURFACE_ROOT)
- goto out;
-
if (event->any.type == GDK_ENTER_NOTIFY)
_gdk_display_set_surface_under_pointer (display, device, event_surface);
else if (event->any.type == GDK_LEAVE_NOTIFY)
g_object_notify (G_OBJECT (surface), "state");
break;
case GDK_SURFACE_FOREIGN:
- case GDK_SURFACE_ROOT:
case GDK_SURFACE_CHILD:
default:
break;