Skip to content

Commit

Permalink
macos: clear window stack before requesting motion
Browse files Browse the repository at this point in the history
We want to ensure that we recalculate the sort order of windows before
processing the motion. Generally this would be done in response from the
display server in GdkMacosWindow, but I've seen it possible to race there.
  • Loading branch information
chergert committed Mar 2, 2022
1 parent efa8f90 commit ca79688
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gdk/macos/gdkmacossurface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1270,11 +1270,15 @@ _gdk_macos_surface_get_buffer (GdkMacosSurface *self)
static void
_gdk_macos_surface_do_delayed_show (GdkMacosSurface *self)
{
GdkSurface *surface = (GdkSurface *)self;

g_assert (GDK_IS_MACOS_SURFACE (self));

self->show_on_next_swap = FALSE;
[self->window showAndMakeKey:YES];
gdk_surface_request_motion (GDK_SURFACE (self));

_gdk_macos_display_clear_sorting (GDK_MACOS_DISPLAY (surface->display));
gdk_surface_request_motion (surface);
}

void
Expand Down

0 comments on commit ca79688

Please sign in to comment.