Hide or show the surface

Jonas Ã…dahl jadahl at gmail.com
Fri Dec 23 03:25:05 UTC 2016


On Fri, Dec 23, 2016 at 09:52:45AM +0800, Anthenony wrote:
> Hi, All:
> 
> 
>     As far as I know there is no interface to hide or show the client. I want to make sure whether other method is feasible.
>     For example, I move the client out of the screen.
>     
> Hide:
> attach(m_wl_sufface, 1000, 1000);
> commit();
>  
> Show:
> attach(m_wl_sufface, 0, 0);
> commit();
> 
> 
> Anyway, is there any other methods?

Attaching with an offset should not be used to hide a surface. It's a
total abuse of those parameters and will definitely not work reliably. I
wouldn't be surprised if compositors will blatantly terminate clients
abusing it in such ways, since it would make no sense from the point of
view of the way those parameters were intended to be used.

The proper way depends on the role the surface has. For example if it's
a pointer cursor surface, and you want to hide the cursor, you set the
pointer cursor to a NULL surface. If it's a shell surface (xdg_toplevel
or a toplevel wl_shell_surface) you unmap it; how unmapping is done
depends on the protocol defining the role. For example if it's a
xdg_toplevel, to unmap the surface you destroy the xdg_toplevel and
xdg_surface objects. For wl_shell_surface clients, it's similar; destroy
the wl_shell_surface object to unmap the surface.

For other roles, it's up to the role to define how to hide/unmap the
corresponding surface view.


Jonas

> 
> 
> 
> 
> Best regards,
> Anthenony

> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel



More information about the wayland-devel mailing list