Compare commits

..

23 Commits

Author SHA1 Message Date
stefan11111 d403cbd25c kdrive: ephyr: initialize OS specific callback vectors
These will be used by subsequent commits for generic Kdrive
functions calling back into the OS specific parts

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-04 19:36:04 +02:00
stefan11111 a46fd9f16e kdrive: add KdOsInit
Kdrive X servers used to do the OS-speciffic init part using KdOsInit.
This was changed in modern Xorg because Xephyr is the only kdrive
X server there, so there was no need to keep this generic.
Since we want to eventually add Xfbdev, we need to add this back.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-04 19:36:04 +02:00
Enrico Weigelt, metux IT consult fc9bd6b175 minor release 25.0.0.4
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:26:48 +02:00
Enrico Weigelt, metux IT consult d338bf6e68 namespace: drop unused winIsRoot()
Not used in this file, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:11:54 +02:00
Enrico Weigelt, metux IT consult c6777fe48e xnest: drop unused DarwinHandleGUI()
Obsolete since 17 years now, probably just forgotten to clean up.

Fixes: ef1c520537
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:10:02 +02:00
Enrico Weigelt, metux IT consult 2f46a02217 vfb: drop unused DarwinHandleGUI()
Obsolete since 17 years now, probably just forgotten to clean up.

Fixes: ef1c520537
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:10:02 +02:00
Enrico Weigelt, metux IT consult 93013224b4 xquartz: fix incomplete prototype of executable_path()
> ../hw/xquartz/mach-startup/bundle_trampoline.c:53:29: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
> static char *executable_path() {
>                             ^
>                              void
> 1 warning generated.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:09:33 +02:00
Enrico Weigelt, metux IT consult 74d5b7bb05 xquartz: drop unused field declarations in request handlers
Silence compiler warning on unused fields, eg.:

> ../hw/xquartz/applewm.c:692:5: warning: unused variable 'stuff' [-Wunused-variable]
>     REQUEST(xAppleWMQueryVersionReq);
>     ^
> ../include/dix.h:65:12: note: expanded from macro 'REQUEST'
>     type * stuff = (type *)client->requestBuffer;
>            ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:08:46 +02:00
stefan11111 160ab343ea mi: move miPointerCloseScreen to hookPostClose
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-03 18:46:58 +02:00
Enrico Weigelt, metux IT consult 2069db50e7 xfree86: compat: make xf86MsgVerb() a bit less noisier
print the driver bug warning only once.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-03 16:55:14 +02:00
Nathan Kidd 7ca8b37ab1 glx: Don't blindly write 8 bytes in GLX single replies
Previously we leaked stack when invalid enum parameters were
specified and caused __glGet*_size functions to return a 0 size.

Further, we read out-of-bounds (and leaked) when the input data was less
than 8 bytes (__glXDispSwap_GetFramebufferAttachmentParameteriv and
__glXDisp_GetRenderbufferParameteriv).

Now we only write a single element in the reply padding, and only when there
is a single element. This is what the Mesa client-side libGL expects, and
restores original GLX server behaviour, matching both pre-public (1996) SGI GLX
and XFree86 4.

The main risk of this change is if we have any error in element count or size;
previously it may not have mattered but now it does.

There are no piglit result changes from this modification using either mesa
libGLX or NVIDIA libGLX.

For performance considerations, an extra conditional and variable-length
memcpy has no meaningful impact on the indirect rendering pipeline cost.

There is still the possiblity to leak if our size checks allow an enum that
the GL implemention does not. Guarding against that requires zero-initializing
all temp storage, which wants re-evaluation of the blind 200-byte buffers
used for many calls and thus is a much bigger change.

Signed-off-by: Nathan Kidd <nkidd@rocketsoftware.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1647>
2025-07-03 16:43:18 +02:00
Nathan Kidd 5b810bac5e glx: Fix out-of-bounds reads from negative return
The callers of these functions were casting -1 to unsigned and then
using 4GB indexes. By returning 0 we match all the other size functions.

GLX size functions return -1 to indicate error, but GL size functions return 0.

Signed-off-by: Nathan Kidd <nkidd@rocketsoftware.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1647>
2025-07-03 16:43:18 +02:00
dasha_uwu 7c64a06ba4 treewide: remove "lib" prefix in static_library names (meson)
this was producing static libraries named "liblibsomething.a"

Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-07-03 12:01:52 +02:00
Enrico Weigelt, metux IT consult 5d7be80305 minor release 25.0.0.3
minor bugfix release.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-02 17:44:12 +02:00
stefan11111 6851e17816 meson.build: meson_options.txt: add build option to disable building tests
These tests take a long time to build and link, especially with lto.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-02 17:40:10 +02:00
Enrico Weigelt, metux IT consult 96be335fd3 miext: damage: use dixScreenHookPostClose() instead of dixScreenHookClose()
Some drivers need to call into damage from within their CloseScreen proc,
so damage teardown needs to be done after that, instead of before.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-02 15:41:37 +02:00
Enrico Weigelt, metux IT consult 56650ba873 dix: add screen hook for post-close
In contrast to the already existing ScreenClose hook, this one is
called *after* the driver's CloseScreen() proc. That's required for
some extensions (eg. damage) where drivers still need to call in
inside of their CloseScreen procs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-02 15:41:37 +02:00
Enrico Weigelt, metux IT consult 4036b8c163 os: log: vpnprintf(): ignore reverse justification modifier
The only caller is libinput, and we don't really need it, just silencing
bug message.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-01 17:15:56 +02:00
Enrico Weigelt, metux IT consult c24372893b xfree86: compat: consolidate logging
Consolidate the redundant warnings into generic functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-01 17:11:28 +02:00
Enrico Weigelt, metux IT consult 28e739e05b xfree86: loadmod: locally scope the errtype variable
In CheckVersion() the errtype variable is used in two separate scopes,
but not globally, so it's cleaner to have it only in the scopes that
are actually using it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-01 17:03:12 +02:00
Enrico Weigelt, metux IT consult a4c3c9da4d xf86bigfont: fix compiler warning on unused variable
> ../Xext/xf86bigfont.c: In function ‘SProcXF86BigfontQueryVersion’:
> ../include/dix.h:65:12: warning: unused variable ‘stuff’ [-Wunused-variable]
>   65 |     type * stuff = (type *)client->requestBuffer;

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-01 17:01:07 +02:00
stefan11111 3d266528a9 kdrive: ephyr: use c99 struct initialization
For better readability and robustness against future changes, it's
better to use named struct initializers instead of array-like lists.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-01 16:50:01 +02:00
Tautvis 6c2f17a5e0 xf86vidmode: fix result copying in ProcVidModeGetMonitor()
The monitor values (vendor and model) accidentally had been copied
at the start of the payload, instead of being appended after the
previously copied data, and also moving the wrong pointer, thus
corrupting the reply and causing some clients to hang.

Signed-off-by: Tautvis <gtautvis@gmail.com>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-01 15:58:44 +02:00
92 changed files with 453 additions and 515 deletions

View File

@ -191,22 +191,8 @@ mingw-cross-build:
extends: .common-build-and-test
script:
- .gitlab-ci/meson-build.sh --run-install
- find / -name libX*.dll
variables:
MESON_ARGS: --cross-file=.gitlab-ci/cross-i686-w64-mingw32.txt -Dglx=false -Dlisten_tcp=true -Dxvmc=true -Dxv=true
artifacts:
when: always
paths:
- hw/vfb/Xvfb.exe
- hw/xnest/Xnest.exe
- hw/xwin/winclipboard/xwinclip.exe
- hw/xwin/Xming.exe
- build/hw/vfb/Xvfb.exe
- build/hw/xnest/Xnest.exe
- build/hw/xwin/winclipboard/xwinclip.exe
- build/hw/xwin/Xming.exe
- hw/xwin/system.XWinrc
expire_in: 1 week
freebsd:
stage: build-and-test

View File

@ -58,13 +58,13 @@ if build_xv
hdrs_xext += ['xvdix.h', 'xvmcext.h']
endif
libxserver_xext = static_library('libxserver_xext',
libxserver_xext = static_library('xserver_xext',
srcs_xext,
include_directories: inc,
dependencies: common_dep,
)
libxserver_xext_vidmode = static_library('libxserver_xext_vidmode',
libxserver_xext_vidmode = static_library('xserver_xext_vidmode',
'vidmode.c',
include_directories: inc,
dependencies: common_dep,

View File

@ -11,14 +11,6 @@
#include "namespace.h"
#include "hooks.h"
static inline Bool winIsRoot(WindowPtr pWin) {
if (!pWin)
return FALSE;
if (pWin->drawable.pScreen->root == pWin)
return TRUE;
return FALSE;
}
void hookWindowProperty(CallbackListPtr *pcbl, void *unused, void *calldata)
{
XNS_HOOK_HEAD(PropertyFilterParam);

View File

@ -1,5 +1,5 @@
libxserver_namespace = static_library(
'libxserver_namespace',
'xserver_namespace',
[
'config.c',
'hook-client.c',

View File

@ -1280,7 +1280,7 @@ ProcVidModeGetMonitor(ClientPtr client)
+ nHsync + nVrefresh + nVendorItems + nModelItems
};
const int buflen = nHsync * nVrefresh + nVendorItems + nModelItems;
const int buflen = nHsync + nVrefresh + nVendorItems + nModelItems;
CARD32 *sendbuf = calloc(buflen, sizeof(CARD32));
if (!sendbuf)
@ -1302,22 +1302,22 @@ ProcVidModeGetMonitor(ClientPtr client)
bufwalk++;
}
memcpy(sendbuf,
memcpy(bufwalk,
pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_VENDOR, 0).ptr,
vendorLength);
sendbuf += nVendorItems;
bufwalk += nVendorItems;
memcpy(sendbuf,
memcpy(bufwalk,
pVidMode->GetMonitorValue(pScreen, VIDMODE_MON_MODEL, 0).ptr,
modelLength);
sendbuf += nModelItems;
bufwalk += nModelItems;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, SIZEOF(xXF86VidModeGetMonitorReply), &rep);
WriteToClient(client, sizeof(xXF86VidModeGetMonitorReply), &rep);
WriteToClient(client, buflen * sizeof(CARD32), sendbuf);
free(sendbuf);

View File

@ -647,7 +647,6 @@ ProcXF86BigfontDispatch(ClientPtr client)
static int _X_COLD
SProcXF86BigfontQueryVersion(ClientPtr client)
{
REQUEST(xXF86BigfontQueryVersionReq);
return ProcXF86BigfontQueryVersion(client);
}

View File

@ -583,7 +583,7 @@ InitXTestDevices(void)
*/
static int
DeviceSetXTestProperty(DeviceIntPtr dev, Atom property,
PropertyValuePtr prop, BOOL checkonly)
XIPropertyValuePtr prop, BOOL checkonly)
{
if (property == XIGetKnownProperty(XI_PROP_XTEST_DEVICE))
return BadAccess;

View File

@ -53,14 +53,14 @@ srcs_xi = [
'xiwarppointer.c',
]
libxserver_xi = static_library('libxserver_xi',
libxserver_xi = static_library('xserver_xi',
srcs_xi,
include_directories: inc,
dependencies: common_dep,
)
srcs_xi_stubs = ['stubs.c']
libxserver_xi_stubs = static_library('libxserver_xi_stubs',
libxserver_xi_stubs = static_library('xserver_xi_stubs',
srcs_xi_stubs,
include_directories: inc,
dependencies: common_dep,

View File

@ -244,7 +244,7 @@ get_property(ClientPtr client, DeviceIntPtr dev, Atom property, Atom type,
unsigned long n, len, ind;
int rc;
XIPropertyPtr prop;
PropertyValuePtr prop_value;
XIPropertyValuePtr prop_value;
if (!ValidAtom(property)) {
client->errorValue = property;
@ -418,7 +418,7 @@ XIResetProperties(void)
* @return Success or the error code if an error occurred.
*/
int
XIPropToInt(PropertyValuePtr val, int *nelem_return, int **buf_return)
XIPropToInt(XIPropertyValuePtr val, int *nelem_return, int **buf_return)
{
int i;
int *buf;
@ -488,7 +488,7 @@ XIPropToInt(PropertyValuePtr val, int *nelem_return, int **buf_return)
* @return Success or the error code if an error occurred.
*/
int
XIPropToFloat(PropertyValuePtr val, int *nelem_return, float **buf_return)
XIPropToFloat(XIPropertyValuePtr val, int *nelem_return, float **buf_return)
{
int i;
float *buf;
@ -528,11 +528,11 @@ long
XIRegisterPropertyHandler(DeviceIntPtr dev,
int (*SetProperty) (DeviceIntPtr dev,
Atom property,
PropertyValuePtr prop,
XIPropertyValuePtr prop,
BOOL checkonly),
int (*GetProperty) (DeviceIntPtr dev,
Atom property),
int (*DelProperty) (DeviceIntPtr dev,
int (*DeleteProperty) (DeviceIntPtr dev,
Atom property))
{
XIPropertyHandlerPtr new_handler;
@ -544,7 +544,7 @@ XIRegisterPropertyHandler(DeviceIntPtr dev,
new_handler->id = XIPropHandlerID++;
new_handler->SetProperty = SetProperty;
new_handler->GetProperty = GetProperty;
new_handler->DeleteProperty = DelProperty;
new_handler->DeleteProperty = DeleteProperty;
new_handler->next = dev->properties.handlers;
dev->properties.handlers = new_handler;
@ -687,8 +687,8 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type,
XIPropertyPtr prop;
int size_in_bytes;
unsigned long total_len;
PropertyValuePtr prop_value;
PropertyValueRec new_value;
XIPropertyValuePtr prop_value;
XIPropertyValueRec new_value;
Bool add = FALSE;
int rc;
@ -804,7 +804,7 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type,
}
int
XIGetDeviceProperty(DeviceIntPtr dev, Atom property, PropertyValuePtr *value)
XIGetDeviceProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr *value)
{
XIPropertyPtr prop = XIFetchDeviceProperty(dev, property);
int rc;

View File

@ -10,7 +10,7 @@ hdrs_composite = [
'compositeext.h',
]
libxserver_composite = static_library('libxserver_composite',
libxserver_composite = static_library('xserver_composite',
srcs_composite,
include_directories: inc,
dependencies: common_dep,

View File

@ -28,7 +28,7 @@ if build_xorg
install_dir: join_paths(get_option('datadir'), 'X11/xorg.conf.d'))
endif
libxserver_config = static_library('libxserver_config',
libxserver_config = static_library('xserver_config',
srcs_config,
include_directories: inc,
dependencies: config_dep,

View File

@ -2,7 +2,7 @@ srcs_damageext = [
'damageext.c',
]
libxserver_damageext = static_library('libxserver_damageext',
libxserver_damageext = static_library('xserver_damageext',
srcs_damageext,
include_directories: inc,
dependencies: common_dep,

View File

@ -3,7 +3,7 @@ srcs_dbe = [
'midbe.c',
]
libxserver_dbe = static_library('libxserver_dbe',
libxserver_dbe = static_library('xserver_dbe',
srcs_dbe,
include_directories: inc,
dependencies: common_dep,

View File

@ -474,7 +474,7 @@ TellNoMap(WindowPtr pwin, Colormap * pmid)
#ifdef XINERAMA
if (noPanoramiXExtension || !pwin->drawable.pScreen->myNum)
#endif /* XINERAMA */
dixDeliverEvents(pwin, &xE, 1, (WindowPtr) NULL);
DeliverEvents(pwin, &xE, 1, (WindowPtr) NULL);
if (pwin->optional) {
pwin->optional->colormap = None;
CheckWindowOptionalNeed(pwin);
@ -503,7 +503,7 @@ TellLostMap(WindowPtr pwin, void *value)
.u.colormap.state = ColormapUninstalled
};
xE.u.u.type = ColormapNotify;
dixDeliverEvents(pwin, &xE, 1, (WindowPtr) NULL);
DeliverEvents(pwin, &xE, 1, (WindowPtr) NULL);
}
return WT_WALKCHILDREN;
@ -528,7 +528,7 @@ TellGainedMap(WindowPtr pwin, void *value)
.u.colormap.state = ColormapInstalled
};
xE.u.u.type = ColormapNotify;
dixDeliverEvents(pwin, &xE, 1, (WindowPtr) NULL);
DeliverEvents(pwin, &xE, 1, (WindowPtr) NULL);
}
return WT_WALKCHILDREN;

View File

@ -147,7 +147,7 @@ DeviceSetTransform(DeviceIntPtr dev, float *transform_data)
* DIX property handler.
*/
static int
DeviceSetProperty(DeviceIntPtr dev, Atom property, PropertyValuePtr prop,
DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
BOOL checkonly)
{
if (property == XIGetKnownProperty(XI_PROP_ENABLED)) {

View File

@ -2944,7 +2944,7 @@ DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab,
* @return event delivery state (@see enum EventDeliveryState)
*/
enum EventDeliveryState
dixDeliverEvents(WindowPtr pWin, xEvent *xE, size_t count, WindowPtr otherParent)
DeliverEvents(WindowPtr pWin, xEvent *xE, size_t count, WindowPtr otherParent)
{
DeviceIntRec dummy;
int deliveries;

View File

@ -155,8 +155,8 @@ void XTestDeviceSendEvents(DeviceIntPtr dev,
int flags,
const ValuatorMask *mask);
int XIPropToInt(PropertyValuePtr val, int *nelem_return, int **buf_return);
int XIPropToInt(XIPropertyValuePtr val, int *nelem_return, int **buf_return);
int XIPropToFloat(PropertyValuePtr val, int *nelem_return, float **buf_return);
int XIPropToFloat(XIPropertyValuePtr val, int *nelem_return, float **buf_return);
#endif /* _XSERVER_EXEVENTS_PRIV_H */

View File

@ -24,7 +24,6 @@ srcs_dix = [
'pixmap.c',
'privates.c',
'property.c',
'property_list.c',
'ptrveloc.c',
'region.c',
'registry.c',
@ -58,13 +57,13 @@ endif
dtrace_dep = declare_dependency(sources: [dtrace_src, dtrace_hdr])
libxserver_dix = static_library('libxserver_dix',
libxserver_dix = static_library('xserver_dix',
[ srcs_dix, builtinatoms_src ],
include_directories: inc,
dependencies: [ dtrace_dep, common_dep, ]
)
libxserver_main = static_library('libxserver_main',
libxserver_main = static_library('xserver_main',
'stubmain.c',
include_directories: inc,
dependencies: common_dep,

View File

@ -123,10 +123,10 @@ static void
notifyVRRMode(ClientPtr pClient, WindowPtr pWindow, int state, PropertyPtr pProp)
{
const char *pName = NameForAtom(pProp->propertyName);
if (pName == NULL || strcmp(pName, "_VARIABLE_REFRESH") || pProp->value.format != 32 || pProp->value.size != 1)
if (pName == NULL || strcmp(pName, "_VARIABLE_REFRESH") || pProp->format != 32 || pProp->size != 1)
return;
WindowVRRMode mode = (WindowVRRMode)(state == PropertyNewValue ? (*((uint32_t*)pProp->value.data)) : 0);
WindowVRRMode mode = (WindowVRRMode)(state == PropertyNewValue ? (*((uint32_t*)pProp->data)) : 0);
#ifdef XINERAMA
if (!noPanoramiXExtension) {
@ -166,7 +166,7 @@ deliverPropertyNotifyEvent(WindowPtr pWin, int state, PropertyPtr pProp)
};
event.u.u.type = PropertyNotify;
dixDeliverEvents(pWin, &event, 1, (WindowPtr) NULL);
DeliverEvents(pWin, &event, 1, (WindowPtr) NULL);
}
int
@ -241,10 +241,10 @@ ProcRotateProperties(ClientPtr client)
notifyVRRMode(client, pWin, PropertyNewValue, props[i]);
/* Preserve name and devPrivates */
props[j]->value.type = saved[i].value.type;
props[j]->value.format = saved[i].value.format;
props[j]->value.size = saved[i].value.size;
props[j]->value.data = saved[i].value.data;
props[j]->type = saved[i].type;
props[j]->format = saved[i].format;
props[j]->size = saved[i].size;
props[j]->data = saved[i].data;
}
}
out:
@ -325,9 +325,11 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
{
PropertyPtr pProp;
PropertyRec savedProp;
int rc;
int sizeInBytes, totalSize, rc;
Mask access_mode;
sizeInBytes = format >> 3;
totalSize = len * sizeInBytes;
access_mode = (mode == PropModeReplace) ? DixWriteAccess : DixBlendAccess;
/* first see if property already exists */
@ -336,15 +338,27 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
if (rc == BadMatch) { /* just add to list */
if (!MakeWindowOptional(pWin))
return BadAlloc;
pProp = dixPropertyCreate(type, property, format, len, value);
pProp = dixAllocateObjectWithPrivates(PropertyRec, PRIVATE_PROPERTY);
if (!pProp)
return BadAlloc;
unsigned char *data = calloc(1, totalSize);
if (totalSize) {
if (!data) {
dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY);
return BadAlloc;
}
memcpy(data, value, totalSize);
}
pProp->propertyName = property;
pProp->type = type;
pProp->format = format;
pProp->data = data;
pProp->size = len;
rc = XaceHookPropertyAccess(pClient, pWin, &pProp,
DixCreateAccess | DixWriteAccess);
if (rc != Success) {
dixPropertyFree(pProp);
free(data);
dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY);
pClient->errorValue = property;
return rc;
}
@ -352,17 +366,14 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
pWin->properties = pProp;
}
else if (rc == Success) {
const int sizeInBytes = format >> 3;
const int totalSize = len * sizeInBytes;
/* To append or prepend to a property the request format and type
must match those of the already defined property. The
existing format and type are irrelevant when using the mode
"PropModeReplace" since they will be written over. */
if ((format != pProp->value.format) && (mode != PropModeReplace))
if ((format != pProp->format) && (mode != PropModeReplace))
return BadMatch;
if ((pProp->value.type != type) && (mode != PropModeReplace))
if ((pProp->type != type) && (mode != PropModeReplace))
return BadMatch;
/* save the old values for later */
@ -375,43 +386,43 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
return BadAlloc;
memcpy(data, value, totalSize);
}
pProp->value.data = data;
pProp->value.size = len;
pProp->value.type = type;
pProp->value.format = format;
pProp->data = data;
pProp->size = len;
pProp->type = type;
pProp->format = format;
}
else if (len == 0) {
/* do nothing */
}
else if (mode == PropModeAppend) {
unsigned char *data = calloc(pProp->value.size + len, sizeInBytes);
unsigned char *data = calloc(pProp->size + len, sizeInBytes);
if (!data)
return BadAlloc;
memcpy(data, pProp->value.data, pProp->value.size * sizeInBytes);
memcpy(data + pProp->value.size * sizeInBytes, value, totalSize);
pProp->value.data = data;
pProp->value.size += len;
memcpy(data, pProp->data, pProp->size * sizeInBytes);
memcpy(data + pProp->size * sizeInBytes, value, totalSize);
pProp->data = data;
pProp->size += len;
}
else if (mode == PropModePrepend) {
unsigned char *data = calloc(len + pProp->value.size, sizeInBytes);
unsigned char *data = calloc(len + pProp->size, sizeInBytes);
if (!data)
return BadAlloc;
memcpy(data + totalSize, pProp->value.data, pProp->value.size * sizeInBytes);
memcpy(data + totalSize, pProp->data, pProp->size * sizeInBytes);
memcpy(data, value, totalSize);
pProp->value.data = data;
pProp->value.size += len;
pProp->data = data;
pProp->size += len;
}
/* Allow security modules to check the new content */
access_mode |= DixPostAccess;
rc = XaceHookPropertyAccess(pClient, pWin, &pProp, access_mode);
if (rc == Success) {
if (savedProp.value.data != pProp->value.data)
free(savedProp.value.data);
if (savedProp.data != pProp->data)
free(savedProp.data);
}
else {
if (savedProp.value.data != pProp->value.data)
free(pProp->value.data);
if (savedProp.data != pProp->data)
free(pProp->data);
*pProp = savedProp;
return rc;
}
@ -430,7 +441,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
int
DeleteProperty(ClientPtr client, WindowPtr pWin, Atom propName)
{
PropertyPtr pProp;
PropertyPtr pProp, prevProp;
int rc;
rc = dixLookupProperty(&pProp, pWin, propName, client, DixDestroyAccess);
@ -438,13 +449,23 @@ DeleteProperty(ClientPtr client, WindowPtr pWin, Atom propName)
return Success; /* Succeed if property does not exist */
if (rc == Success) {
dixPropertyUnlinkPtr(&pWin->properties, pProp);
if (!pWin->properties)
if (pWin->properties == pProp) {
/* Takes care of head */
if (!(pWin->properties = pProp->next))
CheckWindowOptionalNeed(pWin);
}
else {
/* Need to traverse to find the previous element */
prevProp = pWin->properties;
while (prevProp->next != pProp)
prevProp = prevProp->next;
prevProp->next = pProp->next;
}
deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp);
notifyVRRMode(client, pWin, PropertyDelete, pProp);
dixPropertyFree(pProp);
free(pProp->data);
dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY);
}
return rc;
}
@ -452,13 +473,17 @@ DeleteProperty(ClientPtr client, WindowPtr pWin, Atom propName)
void
DeleteAllWindowProperties(WindowPtr pWin)
{
PropertyPtr pProp;
PropertyPtr pProp = pWin->properties;
while ((pProp = pWin->properties)) {
while (pProp) {
deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp);
dixPropertyUnlinkPtr(&pWin->properties, pProp);
dixPropertyFree(pProp);
PropertyPtr pNextProp = pProp->next;
free(pProp->data);
dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY);
pProp = pNextProp;
}
pWin->properties = NULL;
}
/*****************
@ -539,13 +564,13 @@ ProcGetProperty(ClientPtr client)
/* If the request type and actual type don't match. Return the
property information, but not the data. */
if (((p.type != pProp->value.type) && (p.type != AnyPropertyType))) {
if (((p.type != pProp->type) && (p.type != AnyPropertyType))) {
xGetPropertyReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.bytesAfter = pProp->value.size,
.format = pProp->value.format,
.propertyType = pProp->value.type
.bytesAfter = pProp->size,
.format = pProp->format,
.propertyType = pProp->type
};
if (client->swapped) {
swaps(&rep.sequenceNumber);
@ -559,7 +584,7 @@ ProcGetProperty(ClientPtr client)
/*
* Return type, format, value to client
*/
n = (pProp->value.format / 8) * pProp->value.size; /* size (bytes) of prop */
n = (pProp->format / 8) * pProp->size; /* size (bytes) of prop */
ind = p.longOffset << 2;
/* If longOffset is invalid such that it causes "len" to
@ -576,10 +601,10 @@ ProcGetProperty(ClientPtr client)
.type = X_Reply,
.sequenceNumber = client->sequence,
.bytesAfter = n - (ind + len),
.format = pProp->value.format,
.format = pProp->format,
.length = bytes_to_int32(len),
.nItems = len / (pProp->value.format / 8),
.propertyType = pProp->value.type
.nItems = len / (pProp->format / 8),
.propertyType = pProp->type
};
if (p.delete && (rep.bytesAfter == 0)) {
@ -590,7 +615,7 @@ ProcGetProperty(ClientPtr client)
void *payload = calloc(1, len);
if (!payload)
return BadAlloc;
memcpy(payload, (char*)(pProp->value.data) + ind, len);
memcpy(payload, (char*)(pProp->data) + ind, len);
if (p.delete && (rep.bytesAfter == 0)) {
/* Delete the Property */
@ -607,7 +632,8 @@ ProcGetProperty(ClientPtr client)
prevProp->next = pProp->next;
}
dixPropertyFree(pProp);
free(pProp->data);
dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY);
}
if (client->swapped) {

View File

@ -1,77 +0,0 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#include <dix-config.h>
#include "dix/property_priv.h"
#include "include/privates.h"
#include "include/propertyst.h"
#include "os/bug_priv.h"
void dixPropertyFree(PropertyPtr pr)
{
if (pr) {
free(pr->value.data);
dixFreeObjectWithPrivates(pr, PRIVATE_PROPERTY);
}
}
PropertyPtr dixPropertyCreate(Atom type, Atom name, int format, size_t len,
const void *value)
{
const int totalSize = (format >> 3) * len;
void *data = calloc(1, totalSize);
if (!data)
return NULL;
PropertyPtr pProp = dixAllocateObjectWithPrivates(PropertyRec, PRIVATE_PROPERTY);
if (!pProp) {
free(data);
return NULL;
}
memcpy(data, value, totalSize);
pProp->propertyName = name;
pProp->value.data = data;
pProp->value.format = format;
pProp->value.size = len;
pProp->value.type = type;
pProp->deletable = TRUE;
return pProp;
}
PropertyPtr dixPropertyUnlinkPtr(PropertyPtr *list, PropertyPtr prop)
{
BUG_RETURN_VAL(!list, NULL);
if ((!prop) || (!(*list))) // nothing to do
return NULL;
PropertyPtr walk = *list;
// remove from head
if (walk == prop) {
*list = prop->next;
walk->next = NULL;
return prop;
}
// walk the list to find it
while (walk->next && walk->next != prop) {
walk = walk->next;
}
// didn't find it
if (!walk->next)
return NULL;
// unlink the element
walk->next = walk->next->next;
prop->next = NULL;
return prop;
}

View File

@ -53,8 +53,6 @@ SOFTWARE.
#include <X11/X.h>
#include "include/privates.h"
#include "dix.h"
#include "window.h"
#include "property.h"
@ -101,36 +99,4 @@ int dixLookupProperty(PropertyPtr *result, WindowPtr pWin, Atom proprty,
void DeleteAllWindowProperties(WindowPtr pWin);
/*
* Free an individual property structure and related data.
* Invalidates the passed pointer. Doesn't touch anything other in the list.
*
* @param pProp pointer to property structure to free
*/
void dixPropertyFree(PropertyPtr pProp);
/*
* Create and fill a new property structure from given data. The `value`
* is malloc()ed and copied over.
*
* @param type AtomID of the property type
* @param name AtomID of the property name
* @param format the property format (8/16/32 bits)
* @param len length in units defined by format
* @param value pointer to the (raw) property data)
* @return pointer to newly created property structure (NULL on allocation failure)
*/
PropertyPtr dixPropertyCreate(Atom type, Atom name, int format,
size_t len, const void *value);
/*
* Unlink a property structure from a property list. The given property's next
* pointer is also cleared. The property structure itself is NOT destroyed.
*
* @param list pointer to the property list head (NULL on empty list)
* @param prop pointer to the property to unlink.
* @return on success, pointer to the property, NULL if not found in list
*/
PropertyPtr dixPropertyUnlinkPtr(PropertyPtr *list, PropertyPtr prop);
#endif /* _XSERVER_PROPERTY_PRIV_H */

View File

@ -191,7 +191,7 @@ AccelerationDefaultCleanup(DeviceIntPtr dev)
*/
static int
AccelSetProfileProperty(DeviceIntPtr dev, Atom atom,
PropertyValuePtr val, BOOL checkOnly)
XIPropertyValuePtr val, BOOL checkOnly)
{
DeviceVelocityPtr vel;
int profile, *ptr = &profile;
@ -236,7 +236,7 @@ AccelInitProfileProperty(DeviceIntPtr dev, DeviceVelocityPtr vel)
*/
static int
AccelSetDecelProperty(DeviceIntPtr dev, Atom atom,
PropertyValuePtr val, BOOL checkOnly)
XIPropertyValuePtr val, BOOL checkOnly)
{
DeviceVelocityPtr vel;
float v, *ptr = &v;
@ -280,7 +280,7 @@ AccelInitDecelProperty(DeviceIntPtr dev, DeviceVelocityPtr vel)
*/
static int
AccelSetAdaptDecelProperty(DeviceIntPtr dev, Atom atom,
PropertyValuePtr val, BOOL checkOnly)
XIPropertyValuePtr val, BOOL checkOnly)
{
DeviceVelocityPtr veloc;
float v, *ptr = &v;
@ -327,7 +327,7 @@ AccelInitAdaptDecelProperty(DeviceIntPtr dev, DeviceVelocityPtr vel)
*/
static int
AccelSetScaleProperty(DeviceIntPtr dev, Atom atom,
PropertyValuePtr val, BOOL checkOnly)
XIPropertyValuePtr val, BOOL checkOnly)
{
DeviceVelocityPtr vel;
float v, *ptr = &v;

View File

@ -23,6 +23,7 @@ void dixFreeScreen(ScreenPtr pScreen)
DeleteCallbackList(&pScreen->hookWindowDestroy);
DeleteCallbackList(&pScreen->hookWindowPosition);
DeleteCallbackList(&pScreen->hookClose);
DeleteCallbackList(&pScreen->hookPostClose);
DeleteCallbackList(&pScreen->hookPixmapDestroy);
free(pScreen);
}

View File

@ -28,6 +28,7 @@
DECLARE_HOOK_PROC(WindowDestroy, hookWindowDestroy, XorgScreenWindowDestroyProcPtr);
DECLARE_HOOK_PROC(WindowPosition, hookWindowPosition, XorgScreenWindowPositionProcPtr);
DECLARE_HOOK_PROC(Close, hookClose, XorgScreenCloseProcPtr);
DECLARE_HOOK_PROC(PostClose, hookPostClose, XorgScreenCloseProcPtr);
DECLARE_HOOK_PROC(PixmapDestroy, hookPixmapDestroy, XorgScreenPixmapDestroyProcPtr);
DECLARE_HOOK_PROC(PostCreateResources, hookPostCreateResources,
XorgScreenPostCreateResourcesProcPtr);
@ -71,6 +72,8 @@ void dixScreenRaiseClose(ScreenPtr pScreen) {
if (pScreen->CloseScreen)
pScreen->CloseScreen(pScreen);
CallCallbacks(&pScreen->hookPostClose, NULL);
}
void dixScreenRaisePixmapDestroy(PixmapPtr pPixmap)

View File

@ -147,6 +147,37 @@ _X_EXPORT
void dixScreenUnhookClose(ScreenPtr pScreen,
XorgScreenCloseProcPtr func);
/**
* @brief register a screen post close notify hook on the given screen
*
* @param pScreen pointer to the screen to register the notify hook into
* @param func pointer to the hook function
*
* In contrast to Close hook, it's called *after* the driver's CloseScreen()
* proc had been called.
*
* When registration fails, the server aborts.
**/
void dixScreenHookPostClose(ScreenPtr pScreen,
XorgScreenCloseProcPtr func);
/**
* @brief unregister a screen close notify hook on the given screen
*
* @param pScreen pointer to the screen to unregister the hook from
* @param func pointer to the hook function
* @param arg opaque pointer passed to the destructor
*
* @see dixScreenHookPostClose
*
* Unregister a screen close notify hook registered via @ref dixScreenHookPostClose
*
* In contrast to Close hook, it's called *after* the driver's CloseScreen()
* proc had been called.
**/
void dixScreenUnhookPostClose(ScreenPtr pScreen,
XorgScreenCloseProcPtr func);
/* prototype of pixmap destroy notification handler */
typedef void (*XorgScreenPixmapDestroyProcPtr)(CallbackListPtr *pcbl,
ScreenPtr pScreen,

View File

@ -200,10 +200,10 @@ get_window_name(WindowPtr pWin)
return overlay_win_name;
for (prop = pWin->properties; prop; prop = prop->next) {
if (prop->propertyName == XA_WM_NAME &&
prop->value.type == XA_STRING && prop->value.data) {
len = min(prop->value.size, WINDOW_NAME_BUF_LEN - 1);
memcpy(buf, prop->value.data, len);
if (prop->propertyName == XA_WM_NAME && prop->type == XA_STRING &&
prop->data) {
len = min(prop->size, WINDOW_NAME_BUF_LEN - 1);
memcpy(buf, prop->data, len);
buf[len] = '\0';
return buf;
}
@ -931,7 +931,7 @@ dixCreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
.u.createNotify.override = pWin->overrideRedirect
};
event.u.u.type = CreateNotify;
dixDeliverEvents(pParent, &event, 1, NullWindow);
DeliverEvents(pParent, &event, 1, NullWindow);
}
return pWin;
}
@ -1018,7 +1018,7 @@ CrushTree(WindowPtr pWin)
if (SubStrSend(pChild, pParent)) {
xEvent event = { .u.u.type = DestroyNotify };
event.u.destroyNotify.window = pChild->drawable.id;
dixDeliverEvents(pChild, &event, 1, NullWindow);
DeliverEvents(pChild, &event, 1, NullWindow);
}
FreeResource(pChild->drawable.id, X11_RESTYPE_WINDOW);
pSib = pChild->nextSib;
@ -1060,7 +1060,7 @@ DeleteWindow(void *value, XID wid)
if (wid && pParent && SubStrSend(pWin, pParent)) {
xEvent event = { .u.u.type = DestroyNotify };
event.u.destroyNotify.window = pWin->drawable.id;
dixDeliverEvents(pWin, &event, 1, NullWindow);
DeliverEvents(pWin, &event, 1, NullWindow);
}
FreeWindowResources(pWin);
@ -1455,7 +1455,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
.u.colormap.state = IsMapInstalled(cmap, pWin)
};
xE.u.u.type = ColormapNotify;
dixDeliverEvents(pWin, &xE, 1, NullWindow);
DeliverEvents(pWin, &xE, 1, NullWindow);
}
break;
case CWCursor:
@ -1851,7 +1851,7 @@ ResizeChildrenWinSize(WindowPtr pWin, int dx, int dy, int dw, int dh)
.u.gravity.y = cwsy - wBorderWidth(pSib)
};
event.u.u.type = GravityNotify;
dixDeliverEvents(pSib, &event, 1, NullWindow);
DeliverEvents(pSib, &event, 1, NullWindow);
pSib->origin.x = cwsx;
pSib->origin.y = cwsy;
}
@ -2374,7 +2374,7 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
event.u.configureNotify.y += screenInfo.screens[0]->y;
}
#endif /* XINERAMA */
dixDeliverEvents(pWin, &event, 1, NullWindow);
DeliverEvents(pWin, &event, 1, NullWindow);
}
if (mask & CWBorderWidth) {
if (action == RESTACK_WIN) {
@ -2462,7 +2462,7 @@ CirculateWindow(WindowPtr pParent, int direction, ClientPtr client)
}
event.u.u.type = CirculateNotify;
dixDeliverEvents(pWin, &event, 1, NullWindow);
DeliverEvents(pWin, &event, 1, NullWindow);
ReflectStackChange(pWin,
(direction == RaiseLowest) ? pFirst : NullWindow,
VTStack);
@ -2519,7 +2519,7 @@ ReparentWindow(WindowPtr pWin, WindowPtr pParent,
event.u.reparent.y += screenInfo.screens[0]->y;
}
#endif /* XINERAMA */
dixDeliverEvents(pWin, &event, 1, pParent);
DeliverEvents(pWin, &event, 1, pParent);
/* take out of sibling chain */
@ -2627,7 +2627,7 @@ DeliverMapNotify(WindowPtr pWin)
.u.mapNotify.override = pWin->overrideRedirect,
};
event.u.u.type = MapNotify;
dixDeliverEvents(pWin, &event, 1, NullWindow);
DeliverEvents(pWin, &event, 1, NullWindow);
}
/*****
@ -2818,7 +2818,7 @@ DeliverUnmapNotify(WindowPtr pWin, Bool fromConfigure)
.u.unmapNotify.fromConfigure = fromConfigure
};
event.u.u.type = UnmapNotify;
dixDeliverEvents(pWin, &event, 1, NullWindow);
DeliverEvents(pWin, &event, 1, NullWindow);
}
/*****
@ -3074,7 +3074,7 @@ SendVisibilityNotify(WindowPtr pWin)
.u.visibility.state = visibility
};
event.u.u.type = VisibilityNotify;
dixDeliverEvents(pWin, &event, 1, NullWindow);
DeliverEvents(pWin, &event, 1, NullWindow);
}
#define RANDOM_WIDTH 32

View File

@ -10,7 +10,7 @@ hdrs_dri3 = [
libxserver_dri3 = []
if build_dri3
libxserver_dri3 = static_library('libxserver_dri3',
libxserver_dri3 = static_library('xserver_dri3',
srcs_dri3,
include_directories: inc,
dependencies: [ common_dep, libdrm_dep ],

View File

@ -12,7 +12,7 @@ srcs_exa = [
'exa_unaccel.c',
]
libxserver_exa = static_library('libxserver_exa',
libxserver_exa = static_library('xserver_exa',
srcs_exa,
include_directories: inc,
dependencies: common_dep,

View File

@ -37,7 +37,7 @@ hdrs_fb = [
'wfbrename.h'
]
libxserver_fb = static_library('libxserver_fb',
libxserver_fb = static_library('xserver_fb',
srcs_fb,
include_directories: inc,
dependencies: common_dep,
@ -46,7 +46,7 @@ libxserver_fb = static_library('libxserver_fb',
wfb_args = '-DFB_ACCESS_WRAPPER'
libxserver_wfb = static_library('libxserver_wfb',
libxserver_wfb = static_library('xserver_wfb',
srcs_fb,
c_args: wfb_args,
include_directories: inc,

View File

@ -128,13 +128,10 @@ __glXSendReply(ClientPtr client, const void *data, size_t elements,
.retval = retval,
};
/* It is faster on almost always every architecture to just copy the 8
* bytes, even when not necessary, than check to see of the value of
* elements requires it. Copying the data when not needed will do no
* harm.
*/
(void) memcpy(&reply.pad3, data, 8);
/* Single element goes in reply padding; don't leak uninitialized data. */
if (elements == 1) {
(void) memcpy(&reply.pad3, data, element_size);
}
WriteToClient(client, sizeof(xGLXSingleReply), &reply);
if (reply_ints != 0) {
@ -176,13 +173,10 @@ __glXSendReplySwap(ClientPtr client, const void *data, size_t elements,
.retval = bswap_32(retval),
};
/* It is faster on almost always every architecture to just copy the 8
* bytes, even when not necessary, than check to see of the value of
* elements requires it. Copying the data when not needed will do no
* harm.
*/
(void) memcpy(&reply.pad3, data, 8);
/* Single element goes in reply padding; don't leak uninitialized data. */
if (elements == 1) {
(void) memcpy(&reply.pad3, data, element_size);
}
WriteToClient(client, sizeof(xGLXSingleReply), &reply);
if (reply_ints != 0) {

View File

@ -32,7 +32,7 @@ srcs_glx = [
libxserver_glx = []
if build_glx
libxserver_glx = static_library('libxserver_glx',
libxserver_glx = static_library('xserver_glx',
srcs_glx,
include_directories: inc,
dependencies: [
@ -68,7 +68,7 @@ hdrs_vnd = [
libglxvnd = []
if build_glx
libglxvnd = static_library('libglxvnd',
libglxvnd = static_library('glxvnd',
srcs_vnd,
include_directories: inc,
dependencies: [

View File

@ -105,7 +105,7 @@ __glGetMap_size(GLenum target, GLenum query)
}
break;
}
return -1;
return 0;
}
GLint
@ -164,7 +164,7 @@ __glGetPixelMap_size(GLenum map)
query = GL_PIXEL_MAP_A_TO_A_SIZE;
break;
default:
return -1;
return 0;
}
glGetIntegerv(query, &size);
return size;

View File

@ -1435,12 +1435,11 @@ MouseFini(KdPointerInfo * pi)
}
KdPointerDriver EphyrMouseDriver = {
"ephyr",
MouseInit,
MouseEnable,
MouseDisable,
MouseFini,
NULL,
.name = "ephyr",
.Init = MouseInit,
.Enable = MouseEnable,
.Disable = MouseDisable,
.Fini = MouseFini,
};
/* Keyboard */
@ -1509,12 +1508,11 @@ EphyrKeyboardBell(KdKeyboardInfo * ki, int volume, int frequency, int duration)
}
KdKeyboardDriver EphyrKeyboardDriver = {
"ephyr",
EphyrKeyboardInit,
EphyrKeyboardEnable,
EphyrKeyboardLeds,
EphyrKeyboardBell,
EphyrKeyboardDisable,
EphyrKeyboardFini,
NULL,
.name = "ephyr",
.Init = EphyrKeyboardInit,
.Enable = EphyrKeyboardEnable,
.Leds = EphyrKeyboardLeds,
.Bell = EphyrKeyboardBell,
.Disable = EphyrKeyboardDisable,
.Fini = EphyrKeyboardFini,
};

View File

@ -370,6 +370,23 @@ ddxProcessArgument(int argc, char **argv, int i)
return KdProcessArgument(argc, argv, i);
}
static int
EphyrInit(void)
{
/*
* make sure at least one screen
* has been added to the system.
*/
if (!KdCardInfoLast()) {
processScreenArg("640x480", NULL);
}
return hostx_init();
}
KdOsFuncs EphyrOsFuncs = {
.Init = EphyrInit,
};
void
OsVendorInit(void)
{
@ -381,32 +398,23 @@ OsVendorInit(void)
if (hostx_want_host_cursor())
ephyrFuncs.initCursor = &ephyrCursorInit;
if (serverGeneration == 1) {
if (!KdCardInfoLast()) {
processScreenArg("640x480", NULL);
}
hostx_init();
}
KdOsInit(&EphyrOsFuncs);
}
KdCardFuncs ephyrFuncs = {
ephyrCardInit, /* cardinit */
ephyrScreenInitialize, /* scrinit */
ephyrInitScreen, /* initScreen */
ephyrFinishInitScreen, /* finishInitScreen */
ephyrCreateResources, /* createRes */
ephyrScreenFini, /* scrfini */
ephyrCardFini, /* cardfini */
.cardinit = ephyrCardInit,
.scrinit = ephyrScreenInitialize,
.initScreen = ephyrInitScreen,
.finishInitScreen = ephyrFinishInitScreen,
.createRes = ephyrCreateResources,
0, /* initCursor */
.scrfini = ephyrScreenFini,
.cardfini = ephyrCardFini,
0, /* initAccel */
0, /* enableAccel */
0, /* disableAccel */
0, /* finiAccel */
/* no cursor or accel funcs here */
ephyrGetColors, /* getColors */
ephyrPutColors, /* putColors */
.getColors = ephyrGetColors,
.putColors = ephyrPutColors,
ephyrCloseScreen, /* closeScreen */
.closeScreen = ephyrCloseScreen,
};

View File

@ -91,6 +91,14 @@ const char *kdGlobalXkbLayout = NULL;
const char *kdGlobalXkbVariant = NULL;
const char *kdGlobalXkbOptions = NULL;
/*
* Carry arguments from InitOutput through driver initialization
* to KdScreenInit
*/
KdOsFuncs *kdOsFuncs = NULL;
void
KdDisableScreen(ScreenPtr pScreen)
{
@ -517,6 +525,19 @@ KdProcessArgument(int argc, char **argv, int i)
return 0;
}
void
KdOsInit(KdOsFuncs * pOsFuncs)
{
kdOsFuncs = pOsFuncs;
if (pOsFuncs) {
if (serverGeneration == 1) {
KdDoSwitchCmd("start");
if (pOsFuncs->Init)
(*pOsFuncs->Init) ();
}
}
}
static Bool
KdAllocatePrivates(ScreenPtr pScreen)
{

View File

@ -278,6 +278,16 @@ int KdAddConfigKeyboard(char *pointer);
int KdAddKeyboard(KdKeyboardInfo * ki);
void KdRemoveKeyboard(KdKeyboardInfo * ki);
typedef struct _KdOsFuncs {
int (*Init) (void); /* Only called when the X server is started, when serverGeneration == 1 */
void (*Enable) (void);
Bool (*SpecialKey) (KeySym);
void (*Disable) (void);
void (*Fini) (void);
void (*pollEvents) (void);
void (*Bell) (int, int, int);
} KdOsFuncs;
typedef struct _KdPointerMatrix {
int matrix[2][3];
} KdPointerMatrix;
@ -289,6 +299,8 @@ extern DevPrivateKeyRec kdScreenPrivateKeyRec;
extern Bool kdEmulateMiddleButton;
extern Bool kdDisableZaphod;
extern KdOsFuncs *kdOsFuncs;
#define KdGetScreenPriv(pScreen) ((KdPrivScreenPtr) \
dixLookupPrivate(&(pScreen)->devPrivates, kdScreenPrivateKey))
#define KdSetScreenPriv(pScreen,v) \
@ -345,6 +357,9 @@ void
int
KdProcessArgument(int argc, char **argv, int i);
void
KdOsInit(KdOsFuncs * pOsFuncs);
void
KdOsAddInputDrivers(void);

View File

@ -259,13 +259,6 @@ ddxGiveUp(enum ExitCode error)
}
}
#ifdef __APPLE__
void
DarwinHandleGUI(int argc, char *argv[])
{
}
#endif
void
OsVendorInit(void)
{

View File

@ -1 +1,5 @@
special compat code for legacy drivers, namely Nvidia proprietary
NVidia is lacking behind for at least a year and don't actually clean up
their spaghetti code. That's why we need to keep several special compat
functions to emulate prehistoric behaviour.

View File

@ -4,6 +4,8 @@
#include "dix/dix_priv.h"
#include "xf86_compat.h"
/*
* this is specifically for NVidia proprietary driver: they're again lagging
* behind a year, doing at least some minimal cleanup of their code base.
@ -13,12 +15,7 @@ _X_EXPORT void MarkClientException(ClientPtr pClient);
void MarkClientException(ClientPtr pClient)
{
LogMessageVerb(X_WARNING, 0, "Bogus driver calling DIX-internal function MarkClientException() !\n");
LogMessageVerb(X_WARNING, 0, "External drivers really should never ever call this function.\n");
LogMessageVerb(X_WARNING, 0, "Nor should they ever DIX-internal fields like ClientRec->noClientException\n");
LogMessageVerb(X_WARNING, 0, "File a bug report to driver vendor or use a FOSS driver.\n");
LogMessageVerb(X_WARNING, 0, "Proprietary drivers are inherently unstable, they just can't be done right.\n");
LogMessageVerb(X_WARNING, 0, "And just don't buy Nvidia hardware, ever.\n");
xf86NVidiaBugInternalFunc("MarkClientException()");
dixMarkClientException(pClient);
}

View File

@ -1,30 +0,0 @@
#include <dix-config.h>
#include <X11/Xfuncproto.h>
#include "dix/dix_priv.h"
/*
* this is specifically for NVidia proprietary driver: they're again lagging
* behind a year, doing at least some minimal cleanup of their code base.
* All attempts to get in direct contact with them have failed.
*/
_X_EXPORT enum EventDeliveryState DeliverEvents(WindowPtr pWindow,
xEventPtr events,
size_t nEvents,
WindowPtr otherParent);
enum EventDeliveryState DeliverEvents(WindowPtr pWindow,
xEventPtr events,
size_t nEvents,
WindowPtr otherParent)
{
LogMessageVerb(X_WARNING, 0, "Bogus driver calling DIX-internal function DeliverEvents() !\n");
LogMessageVerb(X_WARNING, 0, "External drivers really should never ever call this function.\n");
LogMessageVerb(X_WARNING, 0, "File a bug report to driver vendor or use a FOSS driver.\n");
LogMessageVerb(X_WARNING, 0, "Proprietary drivers are inherently unstable, they just can't be done right.\n");
LogMessageVerb(X_WARNING, 0, "And just don't buy Nvidia hardware, ever.\n");
return dixDeliverEvents(pWindow, events, nEvents, otherParent);
}

View File

@ -4,6 +4,8 @@
#include "include/os.h"
#include "xf86_compat.h"
#undef xf86Msg
#undef xf86MsgVerb
@ -17,9 +19,7 @@ _X_EXPORT void xf86Msg(MessageType type, const char *format, ...)
void xf86Msg(MessageType type, const char *format, ...)
{
LogMessageVerb(X_WARNING, 0, "Outdated driver still using xf86Msg() !\n");
LogMessageVerb(X_WARNING, 0, "File a bug report to driver vendor or use a FOSS driver.\n");
LogMessageVerb(X_WARNING, 0, "Proprietary drivers are inherently unstable, they just can't be done right.\n");
xf86NVidiaBugInternalFunc("xf86Msg()");
va_list ap;
@ -39,9 +39,12 @@ _X_EXPORT void xf86MsgVerb(MessageType type, int verb, const char *format, ...)
void
xf86MsgVerb(MessageType type, int verb, const char *format, ...)
{
LogMessageVerb(X_WARNING, 0, "Outdated driver still using xf86MsgVerb() !\n");
LogMessageVerb(X_WARNING, 0, "File a bug report to driver vendor or use a FOSS driver.\n");
LogMessageVerb(X_WARNING, 0, "Proprietary drivers are inherently unstable, they just can't be done right.\n");
static char reportxf86MsgVerb = 1;
if (reportxf86MsgVerb) {
xf86NVidiaBugInternalFunc("xf86MsgVerb()");
reportxf86MsgVerb = 0;
}
va_list ap;
va_start(ap, format);

View File

@ -1,7 +1,7 @@
srcs_xorg_compat = [
'clientexception.c',
'deliverevents.c',
'log.c',
'nvidiabug.c',
'ones.c',
'xf86Helper.c',
]

View File

@ -0,0 +1,31 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#include <dix-config.h>
#include "include/os.h"
#include "xf86_compat.h"
void xf86NVidiaBug(void)
{
LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] file a bug report to driver vendor or use a free Xlibre driver.\n");
LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] Proprietary drivers are inherently unstable, they just can't be done right.\n");
LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] For NVidia report here: https://forums.developer.nvidia.com/c/gpu-graphics/linux/148\n");
LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] And better don't buy NVidia HW until they've fixed their mess.\n");
}
void xf86NVidiaBugInternalFunc(const char* name)
{
LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] calling internal function: %s\n", name);
LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] this function is not supposed to be by drivers ever\n");
xf86NVidiaBug();
}
void xf86NVidiaBugObsoleteFunc(const char* name)
{
LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] calling obsolete function: %s\n", name);
LogMessageVerb(X_WARNING, 0, "[DRIVER BUG] this function is not supposed to be by drivers ever\n");
xf86NVidiaBug();
}

View File

@ -0,0 +1,12 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef __XFREE86_COMPAT_XF86_COMPAT_H
#define __XFREE86_COMPAT_XF86_COMPAT_H
void xf86NVidiaBug(void);
void xf86NVidiaBugInternalFunc(const char* name);
void xf86NVidiaBugObsoleteFunc(const char* name);
#endif /* __XFREE86_COMPAT_XF86_COMPAT_H */

View File

@ -3169,7 +3169,7 @@ drmmode_output_create_resources(xf86OutputPtr output)
static Bool
drmmode_output_set_property(xf86OutputPtr output, Atom property,
PropertyValuePtr value)
RRPropertyValuePtr value)
{
drmmode_output_private_ptr drmmode_output = output->driver_private;
drmmode_ptr drmmode = drmmode_output->drmmode;

View File

@ -417,7 +417,6 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
{
int vercode[4];
long ver = data->xf86version;
MessageType errtype;
LogMessage(X_INFO, "Module %s: vendor=\"%s\"\n",
data->modname ? data->modname : "UNKNOWN!",
@ -458,6 +457,7 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
vermaj = GET_ABI_MAJOR(ver);
vermin = GET_ABI_MINOR(ver);
if (abimaj != vermaj) {
MessageType errtype;
if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)
errtype = X_WARNING;
else
@ -469,6 +469,7 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
return FALSE;
}
else if (abimin > vermin) {
MessageType errtype;
if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)
errtype = X_WARNING;
else

View File

@ -509,7 +509,7 @@ typedef struct _xf86OutputFuncs {
*/
Bool
(*set_property) (xf86OutputPtr output,
Atom property, PropertyValuePtr value);
Atom property, RRPropertyValuePtr value);
#endif
#ifdef RANDR_13_INTERFACE
/**
@ -668,7 +668,7 @@ typedef struct _xf86ProviderFuncs {
*/
Bool
(*set_property) (ScrnInfoPtr scrn,
Atom property, PropertyValuePtr value);
Atom property, RRPropertyValuePtr value);
/**
* Callback to get an updated property value

View File

@ -1524,7 +1524,7 @@ xf86RandR12InitGamma(ScrnInfoPtr pScrn, unsigned gammaSize) {
static Bool
xf86RandR12OutputSetProperty(ScreenPtr pScreen,
RROutputPtr randr_output,
Atom property, PropertyValuePtr value)
Atom property, RRPropertyValuePtr value)
{
xf86OutputPtr output = randr_output->devPrivate;
@ -2144,7 +2144,7 @@ xf86RandR14ProviderSetOffloadSink(ScreenPtr pScreen,
static Bool
xf86RandR14ProviderSetProperty(ScreenPtr pScreen,
RRProviderPtr randr_provider,
Atom property, PropertyValuePtr value)
Atom property, RRPropertyValuePtr value)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);

View File

@ -265,9 +265,6 @@ cat > sdksyms.c << EOF
#include "xkbrules.h"
#include "xserver-properties.h"
// new SDK files
#include "property_value.h"
EOF
topdir=$(readlink -f $1)

View File

@ -148,10 +148,9 @@ xnestChangeGC(GCPtr pGC, unsigned long mask)
if (mask & GCTileStipYOrigin)
values.tile_stipple_origin_y = pGC->patOrg.y;
if (mask & GCFont) {
assert(xnestFontPriv(pGC->font));
if (mask & GCFont)
values.font = xnestFontPriv(pGC->font)->font_id;
}
if (mask & GCSubwindowMode)
values.subwindow_mode = pGC->subWindowMode;

View File

@ -190,13 +190,11 @@ xnestBitBlitHelper(GCPtr pGC)
default:
{
struct xnest_event_queue *q = malloc(sizeof(struct xnest_event_queue));
if (q) {
q->event = event;
xorg_list_add(&q->entry, &xnestUpstreamInfo.eventQueue.entry);
}
}
}
}
RegionDestroy(pTmpReg);
RegionValidate(pReg, &overlap);
@ -346,9 +344,6 @@ xnestPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
// won't get more than 254 elements, since it's already processed by doPolyText()
int const bufsize = sizeof(xTextElt) + count;
uint8_t *buffer = malloc(bufsize);
if (!buffer)
return 0;
xTextElt *elt = (xTextElt*)buffer;
elt->len = count;
elt->delta = 0;
@ -375,8 +370,6 @@ xnestPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count,
// won't get more than 254 elements, since it's already processed by doPolyText()
int const bufsize = sizeof(xTextElt) + count*2;
uint8_t *buffer = malloc(bufsize);
if (!buffer)
return 0;
xTextElt *elt = (xTextElt*)buffer;
elt->len = count;
elt->delta = 0;

View File

@ -154,13 +154,6 @@ ddxGiveUp(enum ExitCode error)
xnestCloseDisplay();
}
#ifdef __APPLE__
void
DarwinHandleGUI(int argc, char *argv[])
{
}
#endif
void
OsVendorInit(void)
{

View File

@ -293,7 +293,6 @@ breakout:
if (!found_default_visual) {
ErrorF("Xnest: can't find matching visual for user specified depth %d\n", xnestDefaultDepth);
assert(visuals);
defaultVisual = visuals[0].vid;
rootDepth = visuals[0].nplanes;
}

View File

@ -440,8 +440,7 @@ xnestShapeWindow(WindowPtr pWin)
int const num_rects = RegionNumRects(xnestWindowPriv(pWin)->bounding_shape);
BoxPtr const pBox = RegionRects(xnestWindowPriv(pWin)->bounding_shape);
xcb_rectangle_t *rects = calloc(num_rects, sizeof(xcb_rectangle_t));
if (!rects)
return;
for (int i = 0; i < num_rects; i++) {
rects[i].x = pBox[i].x1;
rects[i].y = pBox[i].y1;
@ -470,8 +469,7 @@ xnestShapeWindow(WindowPtr pWin)
int const num_rects = RegionNumRects(xnestWindowPriv(pWin)->clip_shape);
BoxPtr const pBox = RegionRects(xnestWindowPriv(pWin)->clip_shape);
xcb_rectangle_t *rects = calloc(num_rects, sizeof(xcb_rectangle_t));
if (!rects)
return;
for (int i = 0; i < num_rects; i++) {
rects[i].x = pBox[i].x1;
rects[i].y = pBox[i].y1;

View File

@ -690,7 +690,6 @@ SNotifyEvent(xAppleWMNotifyEvent *from, xAppleWMNotifyEvent *to)
static int
SProcAppleWMQueryVersion(register ClientPtr client)
{
REQUEST(xAppleWMQueryVersionReq);
return ProcAppleWMQueryVersion(client);
}

View File

@ -50,7 +50,7 @@
* needs and simply execs the startup script which then execs the main binary.
*/
static char *executable_path() {
static char *executable_path(void) {
uint32_t bufsize = PATH_MAX;
char *buf = calloc(1, bufsize);

View File

@ -303,7 +303,7 @@ QuartzUpdateScreens(void)
e.u.configureNotify.height = height;
e.u.configureNotify.borderWidth = wBorderWidth(pRoot);
e.u.configureNotify.override = pRoot->overrideRedirect;
dixDeliverEvents(pRoot, &e, 1, NullWindow);
DeliverEvents(pRoot, &e, 1, NullWindow);
quartzProcs->UpdateScreen(pScreen);

View File

@ -394,7 +394,6 @@ SNotifyEvent(xAppleDRINotifyEvent *from,
static int
SProcAppleDRIQueryVersion(register ClientPtr client)
{
REQUEST(xAppleDRIQueryVersionReq);
return ProcAppleDRIQueryVersion(client);
}

View File

@ -60,14 +60,13 @@ winMultiWindowGetClassHint(WindowPtr pWin, char **res_name, char **res_class)
while (prop) {
if (prop->propertyName == XA_WM_CLASS
&& prop->value.type == XA_STRING
&& prop->value.format == 8 && prop->value.data) {
&& prop->type == XA_STRING && prop->format == 8 && prop->data) {
/*
WM_CLASS property should consist of 2 null terminated strings, but we
must handle the cases when one or both is absent or not null terminated
*/
len_name = strlen((char *) prop->value.data);
if (len_name > prop->value.size) len_name = prop->value.size;
len_name = strlen((char *) prop->data);
if (len_name > prop->size) len_name = prop->size;
(*res_name) = calloc(1, len_name + 1);
@ -77,12 +76,12 @@ winMultiWindowGetClassHint(WindowPtr pWin, char **res_name, char **res_class)
}
/* Copy name and ensure null terminated */
strncpy((*res_name), prop->value.data, len_name);
strncpy((*res_name), prop->data, len_name);
(*res_name)[len_name] = '\0';
/* Compute length of class name, it could be that it is absent or not null terminated */
len_class = (len_name >= prop->value.size) ? 0 : (strlen(((char *) prop->value.data) + 1 + len_name));
if (len_class > prop->value.size - 1 - len_name) len_class = prop->value.size - 1 - len_name;
len_class = (len_name >= prop->size) ? 0 : (strlen(((char *) prop->data) + 1 + len_name));
if (len_class > prop->size - 1 - len_name) len_class = prop->size - 1 - len_name;
(*res_class) = calloc(1, len_class + 1);
@ -95,7 +94,7 @@ winMultiWindowGetClassHint(WindowPtr pWin, char **res_name, char **res_class)
}
/* Copy class name and ensure null terminated */
strncpy((*res_class), ((char *) prop->value.data) + 1 + len_name, len_class);
strncpy((*res_class), ((char *) prop->data) + 1 + len_name, len_class);
(*res_class)[len_class] = '\0';
return 1;
@ -120,8 +119,8 @@ winMultiWindowGetWMHints(WindowPtr pWin, WinXWMHints * hints)
memset(hints, 0, sizeof(WinXWMHints));
while (prop) {
if (prop->propertyName == XA_WM_HINTS && prop->value.data) {
memcpy(hints, prop->value.data, sizeof(WinXWMHints));
if (prop->propertyName == XA_WM_HINTS && prop->data) {
memcpy(hints, prop->data, sizeof(WinXWMHints));
return 1;
}
else
@ -144,9 +143,8 @@ winMultiWindowGetWindowRole(WindowPtr pWin, char **res_role)
*res_role = NULL;
while (prop) {
if (prop->propertyName == AtmWmWindowRole()
&& prop->value.type == XA_STRING
&& prop->value.format == 8 && prop->value.data) {
len_role = prop->value.size;
&& prop->type == XA_STRING && prop->format == 8 && prop->data) {
len_role = prop->size;
(*res_role) = calloc(1, len_role + 1);
@ -155,7 +153,7 @@ winMultiWindowGetWindowRole(WindowPtr pWin, char **res_role)
return 0;
}
strncpy((*res_role), prop->value.data, len_role);
strncpy((*res_role), prop->data, len_role);
(*res_role)[len_role] = 0;
return 1;
@ -180,8 +178,8 @@ winMultiWindowGetWMNormalHints(WindowPtr pWin, WinXSizeHints * hints)
memset(hints, 0, sizeof(WinXSizeHints));
while (prop) {
if (prop->propertyName == XA_WM_NORMAL_HINTS && prop->value.data) {
memcpy(hints, prop->value.data, sizeof(WinXSizeHints));
if (prop->propertyName == XA_WM_NORMAL_HINTS && prop->data) {
memcpy(hints, prop->data, sizeof(WinXSizeHints));
return 1;
}
else
@ -207,7 +205,7 @@ winMultiWindowGetTransientFor(WindowPtr pWin, Window *pDaddyId)
while (prop) {
if (prop->propertyName == XA_WM_TRANSIENT_FOR) {
if (pDaddyId)
memcpy(pDaddyId, prop->value.data, sizeof(Window));
memcpy(pDaddyId, prop->data, sizeof(Window));
return 1;
}
else
@ -234,8 +232,8 @@ winMultiWindowGetWMName(WindowPtr pWin, char **wmName)
while (prop) {
if (prop->propertyName == XA_WM_NAME
&& prop->value.type == XA_STRING && prop->value.data) {
len_name = prop->value.size;
&& prop->type == XA_STRING && prop->data) {
len_name = prop->size;
(*wmName) = calloc(1, len_name + 1);
@ -244,7 +242,7 @@ winMultiWindowGetWMName(WindowPtr pWin, char **wmName)
return 0;
}
strncpy((*wmName), prop->value.data, len_name);
strncpy((*wmName), prop->data, len_name);
(*wmName)[len_name] = 0;
return 1;

View File

@ -92,7 +92,7 @@ extern _X_EXPORT int XIChangeDeviceProperty(DeviceIntPtr /* dev */ ,
extern _X_EXPORT int XIGetDeviceProperty(DeviceIntPtr /* dev */ ,
Atom /* property */ ,
PropertyValuePtr * /* value */
XIPropertyValuePtr * /* value */
);
extern _X_EXPORT int XISetDevicePropertyDeletable(DeviceIntPtr /* dev */ ,
@ -105,7 +105,7 @@ extern _X_EXPORT long XIRegisterPropertyHandler(DeviceIntPtr dev,
dev,
Atom
property,
PropertyValuePtr
XIPropertyValuePtr
prop,
BOOL
checkonly),

View File

@ -55,7 +55,6 @@ SOFTWARE.
#include "dixstruct.h"
#include "cursorstr.h"
#include "privates.h"
#include "property_value.h"
#define BitIsOn(ptr, bit) (!!(((const BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))))
#define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
@ -453,24 +452,28 @@ typedef struct _ClassesRec {
} ClassesRec;
/* Device properties */
/* for backwards compat with older drivers, should not be used anymore */
typedef PropertyValueRec XIPropertyValueRec, *XIPropertyValuePtr;
typedef struct _XIPropertyValue {
Atom type; /* ignored by server */
short format; /* format of data for swapping - 8,16,32 */
long size; /* size of data in (format/8) bytes */
void *data; /* private to client */
} XIPropertyValueRec;
typedef struct _XIProperty {
struct _XIProperty *next;
Atom propertyName;
BOOL deletable; /* clients can delete this prop? */
PropertyValueRec value;
XIPropertyValueRec value;
} XIPropertyRec;
typedef XIPropertyRec *XIPropertyPtr;
typedef XIPropertyValueRec *XIPropertyValuePtr;
typedef struct _XIPropertyHandler {
struct _XIPropertyHandler *next;
long id;
int (*SetProperty) (DeviceIntPtr dev,
Atom property, PropertyValuePtr prop, BOOL checkonly);
Atom property, XIPropertyValuePtr prop, BOOL checkonly);
int (*GetProperty) (DeviceIntPtr dev, Atom property);
int (*DeleteProperty) (DeviceIntPtr dev, Atom property);
} XIPropertyHandler, *XIPropertyHandlerPtr;

View File

@ -458,7 +458,6 @@ if build_xorg
'pixmapstr.h',
'privates.h',
'property.h',
'property_value.h',
'ptrveloc.h',
'region.h',
'regionstr.h',

View File

@ -1,21 +0,0 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*
* This header is part of the SDK / public driver API
*/
#ifndef _XORG_SDK_PROPERTY_VALUE_H
#define _XORG_SDK_PROPERTY_VALUE_H
#include <stdint.h>
#include "misc.h" // ATOM type
typedef struct _PropertyValue {
ATOM type; /* ignored by server */
uint32_t format; /* format of data for swapping - 8,16,32 */
uint32_t size; /* size of data in (format/8) bytes */
void *data; /* private to client */
} PropertyValueRec, *PropertyValuePtr;
#endif /* _XORG_SDK_PROPERTY_VALUE_H */

View File

@ -46,12 +46,9 @@ SOFTWARE.
#ifndef PROPERTYSTRUCT_H
#define PROPERTYSTRUCT_H
#include "misc.h"
#include "property.h"
#include "privates.h"
#include "property_value.h"
/*
* PROPERTY -- property element
*/
@ -59,9 +56,11 @@ SOFTWARE.
typedef struct _Property {
struct _Property *next;
ATOM propertyName;
PropertyValueRec value;
ATOM type; /* ignored by server */
uint32_t format; /* format of data for swapping - 8,16,32 */
uint32_t size; /* size of data in (format/8) bytes */
void *data; /* private to client */
PrivateRec *devPrivates;
Bool deletable;
} PropertyRec;
#endif /* PROPERTYSTRUCT_H */

View File

@ -696,6 +696,10 @@ typedef struct _Screen {
CallbackListPtr hookPostCreateResources;
SetWindowVRRModeProcPtr SetWindowVRRMode;
/* additional screen post-close notify hooks (replaces wrapping CloseScreen)
should NOT be touched outside of DIX core */
CallbackListPtr hookPostClose;
} ScreenRec;
static inline RegionPtr

View File

@ -1,5 +1,3 @@
// exports scan complete
/************************************************************
Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.

View File

@ -3,10 +3,10 @@ project('xserver', 'c',
'buildtype=debugoptimized',
'c_std=gnu99',
],
version: '25.0.0.2',
version: '25.0.0.4',
meson_version: '>= 0.58.0',
)
release_date = '2025-06-30'
release_date = '2025-07-04'
add_project_arguments('-DHAVE_DIX_CONFIG_H', language: ['c', 'objc'])
cc = meson.get_compiler('c')
@ -48,16 +48,6 @@ if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
'-Werror=int-to-pointer-cast',
'-Werror=pointer-to-int-cast',
'-Wvla',
# '-fanalyzer',
# '-Wno-analyzer-mismatching-deallocation',
'-Wno-analyzer-malloc-leak',
# has some false alarms on deferred request handlers (closure on stack)
# '-Wno-error=analyzer-free-of-non-heap',
# has some false alarms on reallocarray (miinitext)
# '-Wno-error=analyzer-double-free',
# '-Wno-error=analyzer-null-dereference',
# '-Wno-error=analyzer-file-leak',
# '-Wno-error=analyzer-possible-null-dereference',
]
else
test_wflags = []
@ -787,7 +777,8 @@ endif
subdir('hw')
if host_machine.system() != 'windows'
build_tests = get_option('tests') and host_machine.system() != 'windows'
if build_tests
subdir('test')
endif

View File

@ -110,6 +110,8 @@ option('sha1', type: 'combo', choices: ['libc', 'CommonCrypto', 'CryptoAPI', 'li
description: 'SHA1 implementation')
option('xf86-input-inputtest', type: 'boolean', value: true,
description: 'Test input driver support on Xorg')
option('tests', type: 'boolean', value: true,
description: 'Build tests for the X server on platforms that support it')
option('dri1', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', description: 'Build DRI1 extension (default: auto)')
option('dri2', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', description: 'Build DRI2 extension (default: auto)')

View File

@ -40,7 +40,7 @@ hdrs_mi = [
'mizerarc.h',
]
libxserver_mi = static_library('libxserver_mi',
libxserver_mi = static_library('xserver_mi',
srcs_mi,
include_directories: inc,
dependencies: [

View File

@ -351,7 +351,7 @@ miSendExposures(WindowPtr pWin, RegionPtr pRgn, int dx, int dy)
}
#endif /* XINERAMA */
dixDeliverEvents(pWin, pEvent, numRects, NullWindow);
DeliverEvents(pWin, pEvent, numRects, NullWindow);
free(pEvent);
}

View File

@ -141,7 +141,7 @@ miPointerInitialize(ScreenPtr pScreen,
pScreenPriv->screenFuncs = screenFuncs;
pScreenPriv->waitForUpdate = waitForUpdate;
pScreenPriv->showTransparent = FALSE;
dixScreenHookClose(pScreen, miPointerCloseScreen);
dixScreenHookPostClose(pScreen, miPointerCloseScreen);
dixSetPrivate(&pScreen->devPrivates, miPointerScreenKey, pScreenPriv);
/*
* set up screen cursor method table
@ -169,7 +169,7 @@ static void miPointerCloseScreen(CallbackListPtr *pcbl, ScreenPtr pScreen, void
{
SetupScreen(pScreen);
dixScreenUnhookClose(pScreen, miPointerCloseScreen);
dixScreenUnhookPostClose(pScreen, miPointerCloseScreen);
free((void *) pScreenPriv);
dixSetPrivate(&pScreen->devPrivates, miPointerScreenKey, NULL);
FreeEventList(mipointermove_events, GetMaximumEventsNum());

View File

@ -1569,7 +1569,7 @@ damageWindowDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, WindowPtr pWindow)
static void damageCloseScreen(CallbackListPtr *pcbl, ScreenPtr pScreen, void *unused)
{
dixScreenUnhookClose(pScreen, damageCloseScreen);
dixScreenUnhookPostClose(pScreen, damageCloseScreen);
dixScreenUnhookWindowDestroy(pScreen, damageWindowDestroy);
dixScreenUnhookPixmapDestroy(pScreen, damagePixmapDestroy);
@ -1667,7 +1667,7 @@ DamageSetup(ScreenPtr pScreen)
pScrPriv->internalLevel = 0;
pScrPriv->pScreenDamage = 0;
dixScreenHookClose(pScreen, damageCloseScreen);
dixScreenHookPostClose(pScreen, damageCloseScreen);
dixScreenHookWindowDestroy(pScreen, damageWindowDestroy);
dixScreenHookPixmapDestroy(pScreen, damagePixmapDestroy);

View File

@ -7,7 +7,7 @@ hdrs_miext_damage = [
'damagestr.h',
]
libxserver_miext_damage = static_library('libxserver_miext_damage',
libxserver_miext_damage = static_library('xserver_miext_damage',
srcs_miext_damage,
include_directories: inc,
dependencies: common_dep,

View File

@ -6,7 +6,7 @@ srcs_miext_rootless = [
'rootlessWindow.c',
]
libxserver_miext_rootless = static_library('libxserver_miext_rootless',
libxserver_miext_rootless = static_library('xserver_miext_rootless',
srcs_miext_rootless,
include_directories: inc,
dependencies: common_dep,

View File

@ -29,7 +29,7 @@ hdrs_miext_shadow = [
'shadow.h',
]
libxserver_miext_shadow = static_library('libxserver_miext_shadow',
libxserver_miext_shadow = static_library('xserver_miext_shadow',
srcs_miext_shadow,
include_directories: inc,
dependencies: common_dep,

View File

@ -14,7 +14,7 @@ if build_dri3
srcs_miext_sync += 'misyncshm.c'
endif
libxserver_miext_sync = static_library('libxserver_miext_sync',
libxserver_miext_sync = static_library('xserver_miext_sync',
srcs_miext_sync,
include_directories: inc,
dependencies: [

View File

@ -410,6 +410,10 @@ vpnprintf(char *string, int size_in, const char *f, va_list args)
f_idx++;
/* silently ignore reverse justification */
if (f[f_idx] == '-')
f_idx++;
/* silently swallow minimum field width */
if (f[f_idx] == '*') {
f_idx++;

View File

@ -79,7 +79,7 @@ endif
libxlibc = []
if srcs_libc.length() > 0
libxlibc = static_library('libxlibc',
libxlibc = static_library('xlibc',
srcs_libc,
include_directories: inc,
dependencies: [
@ -92,7 +92,7 @@ if enable_input_thread
os_dep += cc.find_library('pthread')
endif
libxserver_os = static_library('libxserver_os',
libxserver_os = static_library('xserver_os',
srcs_os,
include_directories: inc,
dependencies: [

View File

@ -15,7 +15,7 @@ hdrs_present = [
'present.h',
]
libxserver_present = static_library('libxserver_present',
libxserver_present = static_library('xserver_present',
srcs_present,
include_directories: inc,
dependencies: [

View File

@ -1,4 +1,4 @@
libxserver_pseudoramix = static_library('libxserver_pseudoramiX',
libxserver_pseudoramix = static_library('xserver_pseudoramiX',
'pseudoramiX.c',
include_directories: inc,
dependencies: common_dep,

View File

@ -25,7 +25,7 @@ if build_xinerama
srcs_randr += 'rrxinerama.c'
endif
libxserver_randr = static_library('libxserver_randr',
libxserver_randr = static_library('xserver_randr',
srcs_randr,
include_directories: inc,
dependencies: common_dep,

View File

@ -42,7 +42,6 @@
#include "scrnintstr.h"
#include "windowstr.h"
#include "pixmapstr.h"
#include "property_value.h"
#include "extnsionst.h"
#include "servermd.h"
#include "rrtransform.h"
@ -72,8 +71,7 @@ typedef XID RRLease;
#define RRModeName(pMode) ((char *) (pMode + 1))
typedef struct _rrMode RRModeRec, *RRModePtr;
typedef PropertyValueRec RRPropertyValueRec; // deprecated
typedef PropertyValuePtr RRPropertyValuePtr; // deprecated
typedef struct _rrPropertyValue RRPropertyValueRec, *RRPropertyValuePtr;
typedef struct _rrProperty RRPropertyRec, *RRPropertyPtr;
typedef struct _rrCrtc RRCrtcRec, *RRCrtcPtr;
typedef struct _rrOutput RROutputRec, *RROutputPtr;
@ -88,6 +86,13 @@ struct _rrMode {
ScreenPtr userScreen;
};
struct _rrPropertyValue {
Atom type; /* ignored by server */
short format; /* format of data for swapping - 8,16,32 */
long size; /* size of data in (format/8) bytes */
void *data; /* private to client */
};
struct _rrProperty {
RRPropertyPtr next;
ATOM propertyName;
@ -96,8 +101,7 @@ struct _rrProperty {
Bool immutable;
int num_valid;
INT32 *valid_values;
PropertyValueRec current;
PropertyValueRec pending;
RRPropertyValueRec current, pending;
};
struct _rrCrtc {
@ -220,7 +224,7 @@ typedef Bool (*RRCrtcGetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc);
typedef Bool (*RROutputSetPropertyProcPtr) (ScreenPtr pScreen,
RROutputPtr output,
Atom property,
PropertyValuePtr value);
RRPropertyValuePtr value);
typedef Bool (*RROutputValidateModeProcPtr) (ScreenPtr pScreen,
RROutputPtr output,
@ -249,7 +253,7 @@ typedef Bool (*RRProviderGetPropertyProcPtr) (ScreenPtr pScreen,
typedef Bool (*RRProviderSetPropertyProcPtr) (ScreenPtr pScreen,
RRProviderPtr provider,
Atom property,
PropertyValuePtr value);
RRPropertyValuePtr value);
typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation * rotations);
typedef Bool (*RRCloseScreenProcPtr) (ScreenPtr pscreen);

View File

@ -459,7 +459,7 @@ rrGetPixmapSharingSyncProp(int numOutputs, RROutputPtr * outputs)
/* If one output doesn't want sync, no sync */
for (o = 0; o < numOutputs; o++) {
PropertyValuePtr val;
RRPropertyValuePtr val;
if ((val = RRGetOutputProperty(outputs[o], syncProp, TRUE)) &&
val->data) {
@ -715,7 +715,7 @@ rrCheckEmulated(RROutputPtr output)
{
const char *emulStr = XRANDR_EMULATION_PROP;
Atom emulProp;
PropertyValuePtr val;
RRPropertyValuePtr val;
emulProp = MakeAtom(emulStr, strlen(emulStr), FALSE);
if (emulProp == None)

View File

@ -97,7 +97,7 @@ RRDeleteAllOutputProperties(RROutputPtr output)
}
static void
RRInitOutputPropertyValue(PropertyValuePtr property_value)
RRInitOutputPropertyValue(RRPropertyValuePtr property_value)
{
property_value->type = None;
property_value->format = 0;
@ -137,7 +137,7 @@ RRDeleteOutputProperty(RROutputPtr output, Atom property)
}
static void
RRNoticePropertyChange(RROutputPtr output, Atom property, PropertyValuePtr value)
RRNoticePropertyChange(RROutputPtr output, Atom property, RRPropertyValuePtr value)
{
const char *non_desktop_str = RR_PROPERTY_NON_DESKTOP;
Atom non_desktop_prop = MakeAtom(non_desktop_str, strlen(non_desktop_str), FALSE);
@ -168,8 +168,8 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
rrScrPrivPtr pScrPriv = rrGetScrPriv(output->pScreen);
int size_in_bytes;
unsigned long total_len;
PropertyValuePtr prop_value;
PropertyValueRec new_value;
RRPropertyValuePtr prop_value;
RRPropertyValueRec new_value;
Bool add = FALSE;
size_in_bytes = format >> 3;
@ -282,8 +282,8 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
Bool
RRPostPendingProperties(RROutputPtr output)
{
PropertyValuePtr pending_value;
PropertyValuePtr current_value;
RRPropertyValuePtr pending_value;
RRPropertyValuePtr current_value;
RRPropertyPtr property;
Bool ret = TRUE;
@ -330,7 +330,7 @@ RRQueryOutputProperty(RROutputPtr output, Atom property)
return NULL;
}
PropertyValuePtr
RRPropertyValuePtr
RRGetOutputProperty(RROutputPtr output, Atom property, Bool pending)
{
RRPropertyPtr prop = RRQueryOutputProperty(output, property);
@ -621,7 +621,7 @@ ProcRRGetOutputProperty(ClientPtr client)
{
REQUEST(xRRGetOutputPropertyReq);
RRPropertyPtr prop, *prev;
PropertyValuePtr prop_value;
RRPropertyValuePtr prop_value;
unsigned long n, len, ind;
RROutputPtr output;
char *extra = NULL;

View File

@ -84,7 +84,7 @@ RRDeleteProperty(RRProviderRec * provider, RRPropertyRec * prop)
}
static void
RRInitProviderPropertyValue(PropertyValuePtr property_value)
RRInitProviderPropertyValue(RRPropertyValuePtr property_value)
{
property_value->type = None;
property_value->format = 0;
@ -135,8 +135,8 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type,
int size_in_bytes;
int total_size;
unsigned long total_len;
PropertyValuePtr prop_value;
PropertyValueRec new_value;
RRPropertyValuePtr prop_value;
RRPropertyValueRec new_value;
Bool add = FALSE;
size_in_bytes = format >> 3;
@ -256,7 +256,7 @@ RRQueryProviderProperty(RRProviderPtr provider, Atom property)
return NULL;
}
PropertyValuePtr
RRPropertyValuePtr
RRGetProviderProperty(RRProviderPtr provider, Atom property, Bool pending)
{
RRPropertyPtr prop = RRQueryProviderProperty(provider, property);
@ -528,7 +528,7 @@ ProcRRGetProviderProperty(ClientPtr client)
{
REQUEST(xRRGetProviderPropertyReq);
RRPropertyPtr prop, *prev;
PropertyValuePtr prop_value;
RRPropertyValuePtr prop_value;
unsigned long n, len, ind;
RRProviderPtr provider;
xRRGetProviderPropertyReply reply = {

View File

@ -86,7 +86,7 @@ RRSendConfigNotify(ScreenPtr pScreen)
.u.configureNotify.override = pWin->overrideRedirect
};
event.u.u.type = ConfigureNotify;
dixDeliverEvents(pWin, &event, 1, NullWindow);
DeliverEvents(pWin, &event, 1, NullWindow);
}
void

View File

@ -3,7 +3,7 @@ srcs_record = [
'set.c',
]
libxserver_record = static_library('libxserver_record',
libxserver_record = static_library('xserver_record',
srcs_record,
include_directories: inc,
dependencies: common_dep,

View File

@ -19,7 +19,7 @@ hdrs_render = [
'picturestr.h',
]
libxserver_render = static_library('libxserver_render',
libxserver_render = static_library('xserver_render',
srcs_render,
include_directories: inc,
dependencies: common_dep,

View File

@ -128,7 +128,7 @@ xtest_properties(void)
{
int rc;
char value = 1;
PropertyValuePtr prop;
XIPropertyValuePtr prop;
Atom xtest_prop;
xtest_init();

View File

@ -7,7 +7,7 @@ srcs_xfixes = [
'xfixes.c',
]
libxserver_xfixes = static_library('libxserver_xfixes',
libxserver_xfixes = static_library('xserver_xfixes',
srcs_xfixes,
include_directories: inc,
dependencies: common_dep,

View File

@ -351,10 +351,10 @@ SetUpRemap(InputLine * line, RemapSpec * remap)
static Bool
MatchOneOf(const char *wanted, const char *vals_defined)
{
const char *str, *next;
int want_len = strlen(wanted);
const char *str, *next = NULL;
for (str = vals_defined; str != NULL; str = next) {
for (str = vals_defined, next = NULL; str != NULL; str = next) {
int len;
next = strchr(str, ',');
@ -377,6 +377,11 @@ static Bool
CheckLine(InputLine * line,
RemapSpec * remap, XkbRF_RulePtr rule, XkbRF_GroupPtr group)
{
char *str, *tok;
register int nread;
_Xstrtokparams strtok_buf;
Bool append = FALSE;
if (line && line->line && line->line[0] == '!') {
if (line->line[1] == '$' ||
(line->line[1] == ' ' && line->line[2] == '$')) {
@ -419,13 +424,7 @@ CheckLine(InputLine * line,
FileSpec tmp = { 0 };
char *str = line->line;
int nread;
_Xstrtokparams strtok_buf;
char *tok;
Bool append = FALSE;
str = line->line;
for (nread = 0; (tok = _XStrtok(str, " ", strtok_buf)) != NULL; nread++) {
str = NULL;
if (strcmp(tok, "=") == 0) {
@ -481,9 +480,11 @@ CheckLine(InputLine * line,
static char *
_Concat(char *str1, const char *str2)
{
int len;
if ((!str1) || (!str2))
return str1;
int len = strlen(str1) + strlen(str2) + 1;
len = strlen(str1) + strlen(str2) + 1;
str1 = realloc(str1, len * sizeof(char));
if (str1)
strcat(str1, str2);
@ -504,10 +505,10 @@ squeeze_spaces(char *p1)
static Bool
MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs)
{
char *options;
memset((char *) mdefs, 0, sizeof(XkbRF_MultiDefsRec));
mdefs->model = defs->model;
char *options = Xstrdup(defs->options);
options = Xstrdup(defs->options);
if (options)
squeeze_spaces(options);
mdefs->options = options;
@ -517,12 +518,15 @@ MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs)
mdefs->layout[0] = defs->layout;
}
else {
char *layout = Xstrdup(defs->layout);
char *p;
char *layout;
layout = Xstrdup(defs->layout);
if (layout == NULL)
return FALSE;
squeeze_spaces(layout);
mdefs->layout[1] = layout;
char *p = layout;
p = layout;
for (int i = 2; i <= XkbNumKbdGroups; i++) {
if ((p = strchr(p, ','))) {
*p++ = '\0';
@ -542,12 +546,15 @@ MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs)
mdefs->variant[0] = defs->variant;
}
else {
char *variant = Xstrdup(defs->variant);
char *p;
char *variant;
variant = Xstrdup(defs->variant);
if (variant == NULL)
return FALSE;
squeeze_spaces(variant);
mdefs->variant[1] = variant;
char *p = variant;
p = variant;
for (int i = 2; i <= XkbNumKbdGroups; i++) {
if ((p = strchr(p, ','))) {
*p++ = '\0';

View File

@ -23,7 +23,7 @@ srcs_xkb = [
'XKBMAlloc.c',
]
libxserver_xkb = static_library('libxserver_xkb',
libxserver_xkb = static_library('xserver_xkb',
srcs_xkb,
include_directories: inc,
dependencies: common_dep,
@ -35,7 +35,7 @@ srcs_xkb_stubs = [
'ddxVT.c',
]
libxserver_xkb_stubs = static_library('libxserver_xkb_stubs',
libxserver_xkb_stubs = static_library('xserver_xkb_stubs',
srcs_xkb_stubs,
include_directories: inc,
dependencies: common_dep,