\hypertarget{group__iface__xdg__popup}{}\section{The xdg\+\_\+popup interface}
\label{group__iface__xdg__popup}\index{The xdg\+\_\+popup interface@{The xdg\+\_\+popup interface}}


A popup surface is a short-\/lived, temporary surface that can be used to implement menus.  


\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{structxdg__popup__listener}{xdg\+\_\+popup\+\_\+listener}}
\begin{DoxyCompactList}\small\item\em xdg\+\_\+popup -\/ short-\/lived, popup surfaces for menus \+: popup interaction is done \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{group__iface__xdg__popup_ga78a80519c46f9099cd029ca172705560}\label{group__iface__xdg__popup_ga78a80519c46f9099cd029ca172705560}} 
\#define {\bfseries X\+D\+G\+\_\+\+P\+O\+P\+U\+P\+\_\+\+P\+O\+P\+U\+P\+\_\+\+D\+O\+N\+E\+\_\+\+S\+I\+N\+C\+E\+\_\+\+V\+E\+R\+S\+I\+ON}~1
\item 
\mbox{\Hypertarget{group__iface__xdg__popup_ga13f61af07a0ecea6d3b433e6e8e06879}\label{group__iface__xdg__popup_ga13f61af07a0ecea6d3b433e6e8e06879}} 
\#define {\bfseries X\+D\+G\+\_\+\+P\+O\+P\+U\+P\+\_\+\+D\+E\+S\+T\+R\+O\+Y\+\_\+\+S\+I\+N\+C\+E\+\_\+\+V\+E\+R\+S\+I\+ON}~1
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{group__iface__xdg__popup_ga1a9e0b4f79b796230f005af1167904bb}\label{group__iface__xdg__popup_ga1a9e0b4f79b796230f005af1167904bb}} 
static int {\bfseries xdg\+\_\+popup\+\_\+add\+\_\+listener} (struct xdg\+\_\+popup $\ast$xdg\+\_\+popup, const struct \mbox{\hyperlink{structxdg__popup__listener}{xdg\+\_\+popup\+\_\+listener}} $\ast$listener, void $\ast$data)
\item 
\mbox{\Hypertarget{group__iface__xdg__popup_ga0ec0a6725799bbe2d04dd68107a8f473}\label{group__iface__xdg__popup_ga0ec0a6725799bbe2d04dd68107a8f473}} 
static void {\bfseries xdg\+\_\+popup\+\_\+set\+\_\+user\+\_\+data} (struct xdg\+\_\+popup $\ast$xdg\+\_\+popup, void $\ast$user\+\_\+data)
\item 
\mbox{\Hypertarget{group__iface__xdg__popup_gae18cd5da648f2d49d39578a035bcd211}\label{group__iface__xdg__popup_gae18cd5da648f2d49d39578a035bcd211}} 
static void $\ast$ {\bfseries xdg\+\_\+popup\+\_\+get\+\_\+user\+\_\+data} (struct xdg\+\_\+popup $\ast$xdg\+\_\+popup)
\item 
static void \mbox{\hyperlink{group__iface__xdg__popup_gaaa662105930acc53ddce8419f56c7c00}{xdg\+\_\+popup\+\_\+destroy}} (struct xdg\+\_\+popup $\ast$xdg\+\_\+popup)
\begin{DoxyCompactList}\small\item\em This destroys the popup. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A popup surface is a short-\/lived, temporary surface that can be used to implement menus. 

It takes an explicit grab on the surface that will be dismissed when the user dismisses the popup. This can be done by the user clicking outside the surface, using the keyboard, or even locking the screen through closing the lid or a timeout.

When the popup is dismissed, a popup\+\_\+done event will be sent out, and at the same time the surface will be unmapped. The xdg\+\_\+popup object is now inert and cannot be reactivated, so clients should destroy it. Explicitly destroying the xdg\+\_\+popup object will also dismiss the popup and unmap the surface.

Clients will receive events for all their surfaces during this grab (which is an \char`\"{}owner-\/events\char`\"{} grab in X11 parlance). This is done so that users can navigate through submenus and other \char`\"{}nested\char`\"{} popup windows without having to dismiss the topmost popup.

Clients that want to dismiss the popup when another surface of their own is clicked should dismiss the popup using the destroy request.

The parent surface must have either an xdg\+\_\+surface or xdg\+\_\+popup role.

Specifying an xdg\+\_\+popup for the parent means that the popups are nested, with this popup now being the topmost popup. Nested popups must be destroyed in the reverse order they were created in, e.\+g. the only popup you are allowed to destroy at all times is the topmost one.

If there is an existing popup when creating a new popup, the parent must be the current topmost popup.

A parent surface must be mapped before the new popup is mapped.

When compositors choose to dismiss a popup, they will likely dismiss every nested popup as well. When a compositor dismisses popups, it will follow the same dismissing order as required from the client.

The x and y arguments passed when creating the popup object specify where the top left of the popup should be placed, relative to the local surface coordinates of the parent surface. See xdg\+\_\+shell.\+get\+\_\+xdg\+\_\+popup.

The client must call wl\+\_\+surface.\+commit on the corresponding wl\+\_\+surface for the xdg\+\_\+popup state to take effect.

For a surface to be mapped by the compositor the client must have committed both the xdg\+\_\+popup state and a buffer. 

\subsection{Function Documentation}
\mbox{\Hypertarget{group__iface__xdg__popup_gaaa662105930acc53ddce8419f56c7c00}\label{group__iface__xdg__popup_gaaa662105930acc53ddce8419f56c7c00}} 
\index{The xdg\+\_\+popup interface@{The xdg\+\_\+popup interface}!xdg\+\_\+popup\+\_\+destroy@{xdg\+\_\+popup\+\_\+destroy}}
\index{xdg\+\_\+popup\+\_\+destroy@{xdg\+\_\+popup\+\_\+destroy}!The xdg\+\_\+popup interface@{The xdg\+\_\+popup interface}}
\subsubsection{\texorpdfstring{xdg\+\_\+popup\+\_\+destroy()}{xdg\_popup\_destroy()}}
{\footnotesize\ttfamily static void xdg\+\_\+popup\+\_\+destroy (\begin{DoxyParamCaption}\item[{struct xdg\+\_\+popup $\ast$}]{xdg\+\_\+popup }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



This destroys the popup. 

Explicitly destroying the xdg\+\_\+popup object will also dismiss the popup, and unmap the surface.

If this xdg\+\_\+popup is not the \char`\"{}topmost\char`\"{} popup, a protocol error will be sent. 