Merge branch 'should_be_mapped' into 'main'

gdk/wayland/surface: Remove redundant `should_be_mapped` code

See merge request GNOME/gtk!4203
This commit is contained in:
Matthias Clasen
2022-01-12 02:48:10 +00:00

View File

@@ -118,7 +118,6 @@ struct _GdkWaylandSurface
unsigned int mapped : 1; unsigned int mapped : 1;
unsigned int awaiting_frame : 1; unsigned int awaiting_frame : 1;
unsigned int awaiting_frame_frozen : 1; unsigned int awaiting_frame_frozen : 1;
unsigned int is_drag_surface : 1;
int pending_buffer_offset_x; int pending_buffer_offset_x;
int pending_buffer_offset_y; int pending_buffer_offset_y;
@@ -2836,27 +2835,12 @@ find_grab_input_seat (GdkSurface *surface,
return NULL; return NULL;
} }
static gboolean
should_be_mapped (GdkSurface *surface)
{
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
/* Don't map crazy temp that GTK uses for internal X11 shenanigans. */
if (GDK_IS_DRAG_SURFACE (surface) && surface->x < 0 && surface->y < 0)
return FALSE;
if (impl->is_drag_surface)
return FALSE;
return TRUE;
}
static void static void
gdk_wayland_surface_map_toplevel (GdkSurface *surface) gdk_wayland_surface_map_toplevel (GdkSurface *surface)
{ {
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface); GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
if (!should_be_mapped (surface)) if (!GDK_IS_WAYLAND_TOPLEVEL (surface))
return; return;
if (impl->mapped) if (impl->mapped)
@@ -4714,7 +4698,6 @@ create_dnd_surface (GdkDisplay *display)
GDK_SURFACE_TEMP, GDK_SURFACE_TEMP,
NULL, NULL,
0, 0, 100, 100); 0, 0, 100, 100);
GDK_WAYLAND_SURFACE (surface)->is_drag_surface = TRUE;
return surface; return surface;
} }