mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
This helper checks whether a given XID belongs to some screen's root window. It does so by looking up the window and comparing that with the window's screen's root window pointer. The resource lookup is intentionally being on behalf of the serverClient, so the fired XACE hook doesn't treat it as an actual client's request. It's explicitly designed for being used by callback handlers. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
57 lines
1.8 KiB
C
57 lines
1.8 KiB
C
/* SPDX-License-Identifier: MIT OR X11
|
|
*
|
|
* Copyright © 2025 Enrico Weigelt, metux IT consult <info@metux.net>
|
|
*/
|
|
#ifndef _XSERVER_DIX_WINDOW_PRIV_H
|
|
#define _XSERVER_DIX_WINDOW_PRIV_H
|
|
|
|
#include <X11/X.h>
|
|
|
|
#include "include/dix.h"
|
|
#include "include/window.h"
|
|
|
|
/*
|
|
* @brief create a window
|
|
*
|
|
* Creates a window with given XID, geometry, etc
|
|
*
|
|
* @return pointer to new Window or NULL on error (see error pointer)
|
|
*/
|
|
WindowPtr dixCreateWindow(Window wid,
|
|
WindowPtr pParent,
|
|
int x,
|
|
int y,
|
|
unsigned int w,
|
|
unsigned int h,
|
|
unsigned int bw,
|
|
unsigned int windowclass,
|
|
Mask vmask,
|
|
XID * vlist,
|
|
int depth,
|
|
ClientPtr client,
|
|
VisualID visual,
|
|
int * error);
|
|
/*
|
|
* @brief Make sure the window->optional structure exists.
|
|
*
|
|
* allocate if window->optional == NULL, otherwise do nothing.
|
|
*
|
|
* @param pWin the window to operate on
|
|
* @return FALSE if allocation failed, otherwise TRUE
|
|
*/
|
|
Bool MakeWindowOptional(WindowPtr pWin);
|
|
|
|
/*
|
|
* @brief check whether a window (ID) is a screen root window
|
|
*
|
|
* The underlying resource query is explicitly done on behalf of serverClient,
|
|
* so XACE resource hooks don't recognize this as a client action.
|
|
* It's explicitly designed for use in hooks that don't wanna cause unncessary
|
|
* traffic in other XACE resource hooks: things done by the serverClient usually
|
|
* considered safe enough for not needing any additional security checks.
|
|
* (we don't have any way for completely skipping the XACE hook yet)
|
|
*/
|
|
Bool dixWindowIsRoot(Window window);
|
|
|
|
#endif /* _XSERVER_DIX_WINDOW_PRIV_H */
|