window: Defer focus setting until after paint

Commit 3dbf5038 tried to defer focus changes
until after rendering is done. But it failed to do so, since
the toplevel ::render handler is still before rendering of
popups that are attached to that toplevel. To do this
properly, we need to do it in the AFTER_PAINT frame clock
phase.

Fixes: #3725
12 jobs for popover-list-lockup in 21 minutes and 25 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  .Pre
failed #1246888
allowed to fail
style-check-diff

00:03:22

 
  Build
passed #1246889
fedora-x86_64

00:20:48

passed #1246891
installed-tests

00:19:44

passed #1246893
macos
macos

00:11:31

passed #1246892
win32-ps
msys2-mingw64

00:08:38

passed #1246890
release-build

00:03:47

 
  Analysis
failed #1246895
asan allowed to fail
asan-build

00:10:28

passed #1246894
static-scan

00:09:56

 
  Docs
passed #1246896
reference

00:21:25

 
  Flatpak
manual #1246897
flatpak allowed to fail manual
flatpak-manual:demo
manual #1246899
flatpak allowed to fail manual
flatpak-manual:icon-browser
manual #1246898
flatpak allowed to fail manual
flatpak-manual:widget-factory
 
Name Stage Failure
failed
style-check-diff .Pre
 static void
after_paint (GdkFrameClock *clock,
- GtkWindow *window)
+ GtkWindow *window)
{
maybe_unset_focus_and_default (window);
}
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
asan-build Analysis
 - css: 214 total, 214 pass, 0 fail
Processing gtk suite a11y:
- a11y: 22 total, 22 pass, 0 fail
Processing gtk suite tools:
- tools: 4 total, 3 pass, 1 fail
Processing gtk suite reftest:
- reftest: 132 total, 132 pass, 0 fail
Cleaning up file based variables
ERROR: Job failed: exit code 1