\hypertarget{group__iface__zxdg__surface__v6}{}\section{The zxdg\+\_\+surface\+\_\+v6 interface}
\label{group__iface__zxdg__surface__v6}\index{The zxdg\+\_\+surface\+\_\+v6 interface@{The zxdg\+\_\+surface\+\_\+v6 interface}}


An interface that may be implemented by a wl\+\_\+surface, for implementations that provide a desktop-\/style user interface.  


\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{structzxdg__surface__v6__listener}{zxdg\+\_\+surface\+\_\+v6\+\_\+listener}}
\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{group__iface__zxdg__surface__v6_gabda4683436334d20bae224b6e808ed68}\label{group__iface__zxdg__surface__v6_gabda4683436334d20bae224b6e808ed68}} 
\#define {\bfseries Z\+X\+D\+G\+\_\+\+S\+U\+R\+F\+A\+C\+E\+\_\+\+V6\+\_\+\+C\+O\+N\+F\+I\+G\+U\+R\+E\+\_\+\+S\+I\+N\+C\+E\+\_\+\+V\+E\+R\+S\+I\+ON}~1
\item 
\mbox{\Hypertarget{group__iface__zxdg__surface__v6_ga58c02ea2128f8ad17d186f2e779f9869}\label{group__iface__zxdg__surface__v6_ga58c02ea2128f8ad17d186f2e779f9869}} 
\#define {\bfseries Z\+X\+D\+G\+\_\+\+S\+U\+R\+F\+A\+C\+E\+\_\+\+V6\+\_\+\+D\+E\+S\+T\+R\+O\+Y\+\_\+\+S\+I\+N\+C\+E\+\_\+\+V\+E\+R\+S\+I\+ON}~1
\item 
\mbox{\Hypertarget{group__iface__zxdg__surface__v6_ga7fd922f7d7f79c1fa914528af9dd59be}\label{group__iface__zxdg__surface__v6_ga7fd922f7d7f79c1fa914528af9dd59be}} 
\#define {\bfseries Z\+X\+D\+G\+\_\+\+S\+U\+R\+F\+A\+C\+E\+\_\+\+V6\+\_\+\+G\+E\+T\+\_\+\+T\+O\+P\+L\+E\+V\+E\+L\+\_\+\+S\+I\+N\+C\+E\+\_\+\+V\+E\+R\+S\+I\+ON}~1
\item 
\mbox{\Hypertarget{group__iface__zxdg__surface__v6_ga0fddaaa0cb776a45c14da3e83f361a2f}\label{group__iface__zxdg__surface__v6_ga0fddaaa0cb776a45c14da3e83f361a2f}} 
\#define {\bfseries Z\+X\+D\+G\+\_\+\+S\+U\+R\+F\+A\+C\+E\+\_\+\+V6\+\_\+\+G\+E\+T\+\_\+\+P\+O\+P\+U\+P\+\_\+\+S\+I\+N\+C\+E\+\_\+\+V\+E\+R\+S\+I\+ON}~1
\item 
\mbox{\Hypertarget{group__iface__zxdg__surface__v6_ga4e8a6f227810ca1f7b4733f58899ee65}\label{group__iface__zxdg__surface__v6_ga4e8a6f227810ca1f7b4733f58899ee65}} 
\#define {\bfseries Z\+X\+D\+G\+\_\+\+S\+U\+R\+F\+A\+C\+E\+\_\+\+V6\+\_\+\+S\+E\+T\+\_\+\+W\+I\+N\+D\+O\+W\+\_\+\+G\+E\+O\+M\+E\+T\+R\+Y\+\_\+\+S\+I\+N\+C\+E\+\_\+\+V\+E\+R\+S\+I\+ON}~1
\item 
\mbox{\Hypertarget{group__iface__zxdg__surface__v6_gaef51375710f9a41e5f0d6f5ff3044b00}\label{group__iface__zxdg__surface__v6_gaef51375710f9a41e5f0d6f5ff3044b00}} 
\#define {\bfseries Z\+X\+D\+G\+\_\+\+S\+U\+R\+F\+A\+C\+E\+\_\+\+V6\+\_\+\+A\+C\+K\+\_\+\+C\+O\+N\+F\+I\+G\+U\+R\+E\+\_\+\+S\+I\+N\+C\+E\+\_\+\+V\+E\+R\+S\+I\+ON}~1
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{group__iface__zxdg__surface__v6_ga3ae1d01fbb63c2ee3f828e33257d2df7}\label{group__iface__zxdg__surface__v6_ga3ae1d01fbb63c2ee3f828e33257d2df7}} 
static int {\bfseries zxdg\+\_\+surface\+\_\+v6\+\_\+add\+\_\+listener} (struct zxdg\+\_\+surface\+\_\+v6 $\ast$zxdg\+\_\+surface\+\_\+v6, const struct \mbox{\hyperlink{structzxdg__surface__v6__listener}{zxdg\+\_\+surface\+\_\+v6\+\_\+listener}} $\ast$listener, void $\ast$data)
\item 
\mbox{\Hypertarget{group__iface__zxdg__surface__v6_ga7baeb7f2b02338129d3f4f39b607476c}\label{group__iface__zxdg__surface__v6_ga7baeb7f2b02338129d3f4f39b607476c}} 
static void {\bfseries zxdg\+\_\+surface\+\_\+v6\+\_\+set\+\_\+user\+\_\+data} (struct zxdg\+\_\+surface\+\_\+v6 $\ast$zxdg\+\_\+surface\+\_\+v6, void $\ast$user\+\_\+data)
\item 
\mbox{\Hypertarget{group__iface__zxdg__surface__v6_ga524cf1186d7bd64d90d71b84877c92b5}\label{group__iface__zxdg__surface__v6_ga524cf1186d7bd64d90d71b84877c92b5}} 
static void $\ast$ {\bfseries zxdg\+\_\+surface\+\_\+v6\+\_\+get\+\_\+user\+\_\+data} (struct zxdg\+\_\+surface\+\_\+v6 $\ast$zxdg\+\_\+surface\+\_\+v6)
\item 
static void \mbox{\hyperlink{group__iface__zxdg__surface__v6_ga7fab1ab4f752897bf9de0c8575f366f7}{zxdg\+\_\+surface\+\_\+v6\+\_\+destroy}} (struct zxdg\+\_\+surface\+\_\+v6 $\ast$zxdg\+\_\+surface\+\_\+v6)
\begin{DoxyCompactList}\small\item\em Destroy the xdg\+\_\+surface object. \end{DoxyCompactList}\item 
static struct zxdg\+\_\+toplevel\+\_\+v6 $\ast$ \mbox{\hyperlink{group__iface__zxdg__surface__v6_gaf6168dd1115e3d6c69b0345e07a678e3}{zxdg\+\_\+surface\+\_\+v6\+\_\+get\+\_\+toplevel}} (struct zxdg\+\_\+surface\+\_\+v6 $\ast$zxdg\+\_\+surface\+\_\+v6)
\begin{DoxyCompactList}\small\item\em This creates an xdg\+\_\+toplevel object for the given xdg\+\_\+surface and gives the associated wl\+\_\+surface the xdg\+\_\+toplevel role. \end{DoxyCompactList}\item 
static struct zxdg\+\_\+popup\+\_\+v6 $\ast$ \mbox{\hyperlink{group__iface__zxdg__surface__v6_gaf788ec06dbffa1872fc925b6dfd8bb08}{zxdg\+\_\+surface\+\_\+v6\+\_\+get\+\_\+popup}} (struct zxdg\+\_\+surface\+\_\+v6 $\ast$zxdg\+\_\+surface\+\_\+v6, struct zxdg\+\_\+surface\+\_\+v6 $\ast$parent, struct zxdg\+\_\+positioner\+\_\+v6 $\ast$positioner)
\begin{DoxyCompactList}\small\item\em This creates an xdg\+\_\+popup object for the given xdg\+\_\+surface and gives the associated wl\+\_\+surface the xdg\+\_\+popup role. \end{DoxyCompactList}\item 
static void \mbox{\hyperlink{group__iface__zxdg__surface__v6_gaf7a3ce9bbcf303ac88ed0caa1ea0e31e}{zxdg\+\_\+surface\+\_\+v6\+\_\+set\+\_\+window\+\_\+geometry}} (struct zxdg\+\_\+surface\+\_\+v6 $\ast$zxdg\+\_\+surface\+\_\+v6, int32\+\_\+t x, int32\+\_\+t y, int32\+\_\+t width, int32\+\_\+t height)
\begin{DoxyCompactList}\small\item\em The window geometry of a surface is its \char`\"{}visible bounds\char`\"{} from the user\textquotesingle{}s perspective. \end{DoxyCompactList}\item 
static void \mbox{\hyperlink{group__iface__zxdg__surface__v6_ga9b94457a2c37e2737b51cca2a6df9b24}{zxdg\+\_\+surface\+\_\+v6\+\_\+ack\+\_\+configure}} (struct zxdg\+\_\+surface\+\_\+v6 $\ast$zxdg\+\_\+surface\+\_\+v6, uint32\+\_\+t serial)
\begin{DoxyCompactList}\small\item\em When a configure event is received, if a client commits the surface in response to the configure event, then the client must make an ack\+\_\+configure request sometime before the commit request, passing along the serial of the configure event. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
An interface that may be implemented by a wl\+\_\+surface, for implementations that provide a desktop-\/style user interface. 

It provides a base set of functionality required to construct user interface elements requiring management by the compositor, such as toplevel windows, menus, etc. The types of functionality are split into xdg\+\_\+surface roles.

Creating an xdg\+\_\+surface does not set the role for a wl\+\_\+surface. In order to map an xdg\+\_\+surface, the client must create a role-\/specific object using, e.\+g., get\+\_\+toplevel, get\+\_\+popup. The wl\+\_\+surface for any given xdg\+\_\+surface can have at most one role, and may not be assigned any role not based on xdg\+\_\+surface.

A role must be assigned before any other requests are made to the xdg\+\_\+surface object.

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

Creating an xdg\+\_\+surface from a wl\+\_\+surface which has a buffer attached or committed is a client error, and any attempts by a client to attach or manipulate a buffer prior to the first xdg\+\_\+surface.\+configure call must also be treated as errors.

For a surface to be mapped by the compositor, the following conditions must be met\+: (1) the client has assigned a xdg\+\_\+surface based role to the surface, (2) the client has set and committed the xdg\+\_\+surface state and the role dependent state to the surface and (3) the client has committed a buffer to the surface. 

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



Destroy the xdg\+\_\+surface object. 

An xdg\+\_\+surface must only be destroyed after its role object has been destroyed. \mbox{\Hypertarget{group__iface__zxdg__surface__v6_gaf6168dd1115e3d6c69b0345e07a678e3}\label{group__iface__zxdg__surface__v6_gaf6168dd1115e3d6c69b0345e07a678e3}} 
\index{The zxdg\+\_\+surface\+\_\+v6 interface@{The zxdg\+\_\+surface\+\_\+v6 interface}!zxdg\+\_\+surface\+\_\+v6\+\_\+get\+\_\+toplevel@{zxdg\+\_\+surface\+\_\+v6\+\_\+get\+\_\+toplevel}}
\index{zxdg\+\_\+surface\+\_\+v6\+\_\+get\+\_\+toplevel@{zxdg\+\_\+surface\+\_\+v6\+\_\+get\+\_\+toplevel}!The zxdg\+\_\+surface\+\_\+v6 interface@{The zxdg\+\_\+surface\+\_\+v6 interface}}
\subsubsection{\texorpdfstring{zxdg\+\_\+surface\+\_\+v6\+\_\+get\+\_\+toplevel()}{zxdg\_surface\_v6\_get\_toplevel()}}
{\footnotesize\ttfamily static struct zxdg\+\_\+toplevel\+\_\+v6$\ast$ zxdg\+\_\+surface\+\_\+v6\+\_\+get\+\_\+toplevel (\begin{DoxyParamCaption}\item[{struct zxdg\+\_\+surface\+\_\+v6 $\ast$}]{zxdg\+\_\+surface\+\_\+v6 }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



This creates an xdg\+\_\+toplevel object for the given xdg\+\_\+surface and gives the associated wl\+\_\+surface the xdg\+\_\+toplevel role. 

See the documentation of xdg\+\_\+toplevel for more details about what an xdg\+\_\+toplevel is and how it is used. \mbox{\Hypertarget{group__iface__zxdg__surface__v6_gaf788ec06dbffa1872fc925b6dfd8bb08}\label{group__iface__zxdg__surface__v6_gaf788ec06dbffa1872fc925b6dfd8bb08}} 
\index{The zxdg\+\_\+surface\+\_\+v6 interface@{The zxdg\+\_\+surface\+\_\+v6 interface}!zxdg\+\_\+surface\+\_\+v6\+\_\+get\+\_\+popup@{zxdg\+\_\+surface\+\_\+v6\+\_\+get\+\_\+popup}}
\index{zxdg\+\_\+surface\+\_\+v6\+\_\+get\+\_\+popup@{zxdg\+\_\+surface\+\_\+v6\+\_\+get\+\_\+popup}!The zxdg\+\_\+surface\+\_\+v6 interface@{The zxdg\+\_\+surface\+\_\+v6 interface}}
\subsubsection{\texorpdfstring{zxdg\+\_\+surface\+\_\+v6\+\_\+get\+\_\+popup()}{zxdg\_surface\_v6\_get\_popup()}}
{\footnotesize\ttfamily static struct zxdg\+\_\+popup\+\_\+v6$\ast$ zxdg\+\_\+surface\+\_\+v6\+\_\+get\+\_\+popup (\begin{DoxyParamCaption}\item[{struct zxdg\+\_\+surface\+\_\+v6 $\ast$}]{zxdg\+\_\+surface\+\_\+v6,  }\item[{struct zxdg\+\_\+surface\+\_\+v6 $\ast$}]{parent,  }\item[{struct zxdg\+\_\+positioner\+\_\+v6 $\ast$}]{positioner }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



This creates an xdg\+\_\+popup object for the given xdg\+\_\+surface and gives the associated wl\+\_\+surface the xdg\+\_\+popup role. 

See the documentation of xdg\+\_\+popup for more details about what an xdg\+\_\+popup is and how it is used. \mbox{\Hypertarget{group__iface__zxdg__surface__v6_gaf7a3ce9bbcf303ac88ed0caa1ea0e31e}\label{group__iface__zxdg__surface__v6_gaf7a3ce9bbcf303ac88ed0caa1ea0e31e}} 
\index{The zxdg\+\_\+surface\+\_\+v6 interface@{The zxdg\+\_\+surface\+\_\+v6 interface}!zxdg\+\_\+surface\+\_\+v6\+\_\+set\+\_\+window\+\_\+geometry@{zxdg\+\_\+surface\+\_\+v6\+\_\+set\+\_\+window\+\_\+geometry}}
\index{zxdg\+\_\+surface\+\_\+v6\+\_\+set\+\_\+window\+\_\+geometry@{zxdg\+\_\+surface\+\_\+v6\+\_\+set\+\_\+window\+\_\+geometry}!The zxdg\+\_\+surface\+\_\+v6 interface@{The zxdg\+\_\+surface\+\_\+v6 interface}}
\subsubsection{\texorpdfstring{zxdg\+\_\+surface\+\_\+v6\+\_\+set\+\_\+window\+\_\+geometry()}{zxdg\_surface\_v6\_set\_window\_geometry()}}
{\footnotesize\ttfamily static void zxdg\+\_\+surface\+\_\+v6\+\_\+set\+\_\+window\+\_\+geometry (\begin{DoxyParamCaption}\item[{struct zxdg\+\_\+surface\+\_\+v6 $\ast$}]{zxdg\+\_\+surface\+\_\+v6,  }\item[{int32\+\_\+t}]{x,  }\item[{int32\+\_\+t}]{y,  }\item[{int32\+\_\+t}]{width,  }\item[{int32\+\_\+t}]{height }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



The window geometry of a surface is its \char`\"{}visible bounds\char`\"{} from the user\textquotesingle{}s perspective. 

Client-\/side decorations often have invisible portions like drop-\/shadows which should be ignored for the purposes of aligning, placing and constraining windows.

The window geometry is double buffered, and will be applied at the time wl\+\_\+surface.\+commit of the corresponding wl\+\_\+surface is called.

Once the window geometry of the surface is set, it is not possible to unset it, and it will remain the same until set\+\_\+window\+\_\+geometry is called again, even if a new subsurface or buffer is attached.

If never set, the value is the full bounds of the surface, including any subsurfaces. This updates dynamically on every commit. This unset is meant for extremely simple clients.

The arguments are given in the surface-\/local coordinate space of the wl\+\_\+surface associated with this xdg\+\_\+surface.

The width and height must be greater than zero. Setting an invalid size will raise an error. When applied, the effective window geometry will be the set window geometry clamped to the bounding rectangle of the combined geometry of the surface of the xdg\+\_\+surface and the associated subsurfaces. \mbox{\Hypertarget{group__iface__zxdg__surface__v6_ga9b94457a2c37e2737b51cca2a6df9b24}\label{group__iface__zxdg__surface__v6_ga9b94457a2c37e2737b51cca2a6df9b24}} 
\index{The zxdg\+\_\+surface\+\_\+v6 interface@{The zxdg\+\_\+surface\+\_\+v6 interface}!zxdg\+\_\+surface\+\_\+v6\+\_\+ack\+\_\+configure@{zxdg\+\_\+surface\+\_\+v6\+\_\+ack\+\_\+configure}}
\index{zxdg\+\_\+surface\+\_\+v6\+\_\+ack\+\_\+configure@{zxdg\+\_\+surface\+\_\+v6\+\_\+ack\+\_\+configure}!The zxdg\+\_\+surface\+\_\+v6 interface@{The zxdg\+\_\+surface\+\_\+v6 interface}}
\subsubsection{\texorpdfstring{zxdg\+\_\+surface\+\_\+v6\+\_\+ack\+\_\+configure()}{zxdg\_surface\_v6\_ack\_configure()}}
{\footnotesize\ttfamily static void zxdg\+\_\+surface\+\_\+v6\+\_\+ack\+\_\+configure (\begin{DoxyParamCaption}\item[{struct zxdg\+\_\+surface\+\_\+v6 $\ast$}]{zxdg\+\_\+surface\+\_\+v6,  }\item[{uint32\+\_\+t}]{serial }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



When a configure event is received, if a client commits the surface in response to the configure event, then the client must make an ack\+\_\+configure request sometime before the commit request, passing along the serial of the configure event. 

For instance, for toplevel surfaces the compositor might use this information to move a surface to the top left only when the client has drawn itself for the maximized or fullscreen state.

If the client receives multiple configure events before it can respond to one, it only has to ack the last configure event.

A client is not required to commit immediately after sending an ack\+\_\+configure request -\/ it may even ack\+\_\+configure several times before its next surface commit.

A client may send multiple ack\+\_\+configure requests before committing, but only the last request sent before a commit indicates which configure event the client really is responding to. 