2021年2月22日(月) 19:51 Gerd Hoffmann <kra...@redhat.com>: > > Hi, > > > #define QEMU_ALLOCATED_FLAG 0x01 > > +#define QEMU_PLACEHOLDER_FLAG 0x02 > > > +static inline int is_placeholder(DisplaySurface *surface) > > +{ > > + return surface->flags & QEMU_PLACEHOLDER_FLAG; > > +} > > Interesting idea. That approach makes sense too. > > > + if (!placeholder) { > > + placeholder = qemu_create_message_surface(640, 480, > > placeholder_msg); > > + placeholder->flags |= QEMU_PLACEHOLDER_FLAG; > > I think we should set the placeholder flag in > qemu_create_message_surface() because every surface created with that > function is some kind if placeholder. > > Also when replacing an existing surface we should make the placeholder > the same size, to avoid pointless ui window resizes. > > > - if (!new_surface) { > > + if (is_placeholder(new_surface)) { > > We should check whenever this is the primary or a secondary window here > and only destroy secondary windows. qemu hiding all windows but > continuing to run has great potential for user confusion ... > > > - if (!new_surface) { > > + if (is_placeholder(new_surface)) { > > Same here.
The other surfaces created by qemu_create_message_surface() are not considered as "placeholder" here, and have contents to be displayed. Since no emulated devices give NULL to dpy_gfx_replace_surface for the primary connection, it will never get the "placeholder", and its window will be always shown. Regards, Akihiko Odaki > > take care, > Gerd >