summaryrefslogtreecommitdiff
path: root/mi
AgeCommit message (Collapse)AuthorFilesLines
2024-09-02dix: unexport NewCurrentScreen()Enrico Weigelt, metux IT consult2-0/+2
It's not used by external modules/drivers, so no need to export it. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1345>
2024-09-02dix: unexport CheckCursorConfinement()Enrico Weigelt, metux IT consult2-0/+4
This function isn't used by any external module, so no need to export it. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1345>
2024-09-01dix: unexport FakeAllocColor()Enrico Weigelt, metux IT consult1-2/+3
Not used by any driver/module, so no need to keep it exported. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1581>
2024-09-01dix: unexport CreateColormap()Enrico Weigelt, metux IT consult1-0/+3
Not used by any driver/module, so no need to keep it exported. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1581>
2024-09-01os: unexport screen saver timer functionsEnrico Weigelt, metux IT consult1-0/+3
These functions aren't supposed to be used by drivers, so move them out of the public API. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1583>
2024-09-01include: move private definitions out of input.hEnrico Weigelt, metux IT consult2-0/+4
It's not good having the public server api headers clobbered with private definitions, so cleaning them up. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1354>
2024-08-29mi: drop obsolete mibitblt.cEnrico Weigelt, metux IT consult2-68/+0
This file is practically empty now, so we can remove it. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1502>
2024-08-29mi: drop unused miPutImage()Enrico Weigelt, metux IT consult2-265/+0
With removal of Xwin's NATIVEGDI (back a decade ago), the last caller is gone, and it also doesn't seem to be called by any driver. Fixes: 8465ee788fd541fa37681aa0a44103c7f944d437 Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1502>
2024-08-29mi: drop unused miGetImage()Enrico Weigelt, metux IT consult2-201/+0
With removal of Xwin's NATIVEGDI (back a decade ago), the last caller is gone, and it also doesn't seem to be called by any driver. Fixes: 8465ee788fd541fa37681aa0a44103c7f944d437 Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1502>
2024-08-29mi: drop unused miCopyArea()Enrico Weigelt, metux IT consult2-199/+0
With removal of Xwin's NATIVEGDI (back a decade ago), the last caller is gone, and it also doesn't seem to be called by any driver. Fixes: 8465ee788fd541fa37681aa0a44103c7f944d437 Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1502>
2024-08-29mi: drop unused miCopyPlane()Enrico Weigelt, metux IT consult2-91/+0
With removal of Xwin's NATIVEGDI (back a decade ago), the last caller is gone, and it also doesn't seem to be called by any driver. Fixes: 8465ee788fd541fa37681aa0a44103c7f944d437 Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1502>
2024-08-26treewide: mark pGC->ops->CopyArea() calls not using result as voidEnrico Weigelt, metux IT consult2-3/+3
We alread have several of these calls, that aren't interested in result value, explicitly casting to void. Fixing this up for the remaining ones. This is helpful for the human reader as well as quality analysis tools. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1648>
2024-07-26treewide: replace xnfalloc() calls to XNFalloc()Enrico Weigelt, metux IT consult2-2/+2
This has been nothing but an alias for two decades now (somewhere in R6.6), so there doesn't seem to be any practical need for this indirection. The macro still needs to remain, as long as (external) drivers still using it. Fixes: ded6147bfb5d75ff1e67c858040a628b61bc17d1 Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1529>
2024-06-21mi: drop unused miPolyFillRect()Enrico Weigelt, metux IT consult3-141/+0
With removal of Xwin's NATIVEGDI (back a decade ago), the last caller is gone, and it also doesn't seem to be called by any driver. Fixes: 8465ee788fd541fa37681aa0a44103c7f944d437 Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1504>
2024-06-18mi: move *_VISUALS defines into consumer source fileEnrico Weigelt, metux IT consult2-15/+5
These are only needed inside one .c source, so no need to keep thm exported. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1498>
2024-06-18mi: drop unused SWAPPT() macroEnrico Weigelt, metux IT consult1-3/+0
Leftover of dropping mfb about 1.5 decades ago. Fixes: f31bd087e8a7f65cd588bd1d022bb18e72b2a60c Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1499>
2024-06-18mi: drop unused XMAJOROCTANTSEnrico Weigelt, metux IT consult1-2/+0
It hasn't been used for really long time, the history even doesn't tell whether it ever had been used. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1500>
2024-04-30include: move private definitions out of extinit.hEnrico Weigelt, metux IT consult1-1/+1
Public server module API shouldn't be clobbered with private definitions, thus move them out to extinit_priv.h. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1289>
2024-04-30include: split out non-exported prototypes to dix_priv.hEnrico Weigelt, metux IT consult3-2/+7
Public server module API shouldn't be clobbered with private definitions, thus move them out to dix-intern.h Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1289>
2024-04-23xnest: fix segfault in miCreateScreenResources()Enrico Weigelt, metux IT consult2-0/+23
With aa3f5023e3fae0df74039702b6c8218bc14dc679, pScreen->devPrivate now is initialized only once, which uncovered a silent bug in xnestOpenScreen: It's NULL'ing the pScreen->devPrivate pointer which already had been initialized by previous miScreenDevPrivateInit() call. Fixes: aa3f5023e3fae0df74039702b6c8218bc14dc679 Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1495>
2024-04-15rename remaining RT_* defines to X11_RESTYPE_*Enrico Weigelt, metux IT consult1-1/+1
Since we already had to rename some of them, in order to fix name clashes on win32, it's now time to rename all the remaining ones. The old ones are still present as define's to the new ones, just for backwards compatibility. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1355>
2024-04-15dix: unexport some lookup functionsEnrico Weigelt, metux IT consult1-0/+2
These aren't used by any drivers, so no need to export them. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1380>
2024-04-15dix: unexport CreateGC()Enrico Weigelt, metux IT consult1-0/+3
Not used by any drivers, so no need to export it. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1365>
2024-04-14mi: decouple miCreateScreenResources from pScreen->{width,height}Tom Yan1-4/+8
This allows pScreen->{width,height} to be changed to smaller values after miScreenInit() is called but before pScreen is further set up / used by dix, so that the screen size can be fit to the mode of choice even when it does not have the maximum width and/or height among its peers. XGetImage() for one will fail once the screen is change back to a bigger size with xrandr, which prevents e.g. x11vnc to work on the server. Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/854>
2024-04-14xnest/mi: remove redundant call of miScreenDevPrivateInit()Tom Yan2-6/+1
miScreenDevPrivateInit() is also made static in this commit. Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/854>
2024-04-04mi: fix rounding issues around zero in miPointerSetPositionWillem Jan Palenstijn1-4/+4
Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/577 This patch replaces the instances of trunc in miPointerSetPosition by floor, thereby removing the incorrect behaviour with subpixel pointer locations between -1 and 0. This is the relevant code fragment: /* In the event we actually change screen or we get confined, we just * drop the float component on the floor * FIXME: only drop remainder for ConstrainCursorHarder, not for screen * crossings */ if (x != trunc(*screenx)) *screenx = x; if (y != trunc(*screeny)) *screeny = y; The behaviour of this code does not match its comment for subpixel coordinates between -1 and 0. For example, if *screenx is -0.5, the preceding code would (correctly) clamp x to 0, but this would not be detected by this condition, since 0 == trunc(-0.5), leaving *screenx at -0.5, out of bounds. This causes undesirable behaviour in GTK3 code using xi2, where negative subpixel coordinates like this would (to all appearances randomly) remove the focus from windows aligned with the zero boundary when the mouse hits the left or top screen boundaries. The other occurences of trunc in miPointerSetPosition have a more subtle effect which would prevent proper clamping if there is a pointer limit at a negative integer rather than at 0. This patch changes these to floor for consistency. Signed-off-by: Willem Jan Palenstijn <wjp@usecode.org> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1451>
2024-03-09mi: drop some dead codeEnrico Weigelt, metux IT consult1-10/+0
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1363>
2024-03-05drop remains of DMXEnrico Weigelt, metux IT consult2-12/+1
DMX has long gone, but there's still some fallout from it's removal yet to be cleaned up. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1362>
2024-02-23Revert "include: move BUG_*() macros to separate header"Peter Hutterer1-2/+0
This breaks the xf86-input-synaptics driver: synaptics.c: In function 'clickpad_guess_clickfingers': synaptics.c:2638:5: error: implicit declaration of function 'BUG_RETURN_VAL' [-Werror=implicit-function-declaration] 2638 | BUG_RETURN_VAL(hw->num_mt_mask > sizeof(close_point) * 8, 0); This reverts commit 442aec2219e0aba5482f96e1047748416237ffaa. Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1316>
2024-02-15include: move BUG_*() macros to separate headerEnrico Weigelt1-0/+2
Yet another step of uncluttering includes: move out the BUG_* macros into a separate header, which then is included as-needed. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2023-10-25mi: reset the PointerWindows reference on screen switchPeter Hutterer1-2/+15
PointerWindows[] keeps a reference to the last window our sprite entered - changes are usually handled by CheckMotion(). If we switch between screens via XWarpPointer our dev->spriteInfo->sprite->win is set to the new screen's root window. If there's another window at the cursor location CheckMotion() will trigger the right enter/leave events later. If there is not, it skips that process and we never trigger LeaveWindow() - PointerWindows[] for the device still refers to the previous window. If that window is destroyed we have a dangling reference that will eventually cause a use-after-free bug when checking the window hierarchy later. To trigger this, we require: - two protocol screens - XWarpPointer to the other screen's root window - XDestroyWindow before entering any other window This is a niche bug so we hack around it by making sure we reset the PointerWindows[] entry so we cannot have a dangling pointer. This doesn't handle Enter/Leave events correctly but the previous code didn't either. CVE-2023-5380, ZDI-CAN-21608 This vulnerability was discovered by: Sri working with Trend Micro Zero Day Initiative Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2023-07-20mi: Fix up alpha channel if needed in miPaintWindowMichel Dänzer1-0/+24
See also the previous commit log. Fixes the issues with xterm & xcalc described in the GitLab issue below. Issue: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1564
2023-03-03Allow disabling the SHAPE extension at runtimeSimon Ser1-1/+1
To correctly render a window making use of SHAPE, a compositor must query the shape rectangles. This may not be a desirable feature for a Wayland compositor. Allow SHAPE to be turned off at runtime, so that the compositor can opt-out. Signed-off-by: Simon Ser <contact@emersion.fr>
2023-02-25Remove "All rights reserved" from Oracle copyright noticesAlan Coopersmith1-1/+1
Oracle no longer includes this term in our copyright & license notices. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-20rootless: Use screen_x and screen_y instead of pixmap pointer hacksJeremy Huddleston Sequoia1-1/+1
This updates rootless to treat pixmaps consistently with COMPOSITE, using the screen_x and screen_y values rather than doing hacky math. This will allow for proper bounds checking on a given PixmapRec. Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2022-08-29mi: Use memcpy() instead of memmove() when buffers are known not to overlapAlan Coopersmith1-3/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-10-27Remove autotools supportPovilas Kanapickas1-56/+0
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2021-05-30Implement gesture processing logicPovilas Kanapickas1-0/+8
2021-04-07xquartz: Call PseudoramiXExtensionInit() through InitOutput() just like xwinJeremy Huddleston Sequoia1-9/+0
Fixes: https://github.com/XQuartz/XQuartz/issues/140 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-03-11meson: hide C API if Xorg is disabled (like autotools)Jan Beich1-1/+3
When building only Xwayland using Meson some files are always installed. This causes package conflict if Xwayland is built separately from Xorg. include/xorg/compositeext.h include/xorg/damage.h include/xorg/damagestr.h include/xorg/dbestruct.h include/xorg/dri3.h include/xorg/fb.h include/xorg/fboverlay.h include/xorg/fbpict.h include/xorg/fbrop.h include/xorg/geext.h include/xorg/geint.h include/xorg/glyphstr.h include/xorg/mi.h include/xorg/micmap.h include/xorg/micoord.h include/xorg/migc.h include/xorg/miline.h include/xorg/mioverlay.h include/xorg/mipict.h include/xorg/mipointer.h include/xorg/mipointrst.h include/xorg/mistruct.h include/xorg/misync.h include/xorg/misyncfd.h include/xorg/misyncshm.h include/xorg/misyncstr.h include/xorg/mizerarc.h include/xorg/panoramiX.h include/xorg/panoramiXsrv.h include/xorg/picture.h include/xorg/picturestr.h include/xorg/present.h include/xorg/presentext.h include/xorg/randrstr.h include/xorg/rrtransform.h include/xorg/shadow.h include/xorg/shmint.h include/xorg/syncsdk.h include/xorg/vndserver.h include/xorg/wfbrename.h include/xorg/xace.h include/xorg/xacestr.h include/xorg/xorg-server.h include/xorg/xvdix.h include/xorg/xvmcext.h share/aclocal/xorg-server.m4 Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2021-03-08Avoid sequences of malloc(0) / free() by checking the length.Matthieu Herrb1-2/+5
This has an impact on heap fragmentation. Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2021-01-29Revert "mi: Shortcut miDoCopy/miCopyArea based on clipList"Olivier Fourdan2-4/+5
This reverts commit f665a9c9e6c8643f3050378249db3088ae3057be. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Acked-by: Martin Peres <martin.peres@mupuf.org> Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1108 Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1128
2021-01-29mi: List extensions in usage messageOlivier Fourdan2-8/+101
Not all extensions can be enabled or disabled at runtime, list the extensions which can from the help message rather than on error only. v2: * Print the header message in the ListStaticExtensions() (Peter Hutterer) * Do not export ListStaticExtensions() as Xserver API Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2021-01-29mi: Don't log the full extension list on disableOlivier Fourdan1-1/+5
When enabling or disabling an extension which is not known to the Xserver, it will log an error message and list the extensions it knows about. That clutters the logs when the Xserver is Xwayland spawned by the Wayland compositor who doesn't actually know the list of extensions enabled at build time in the Xserver. Considering that disabling a non-existing extension is a no-op anyway, list all the extensions available only when attempting to enable an extension which the Xserver doesn't know about. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2020-09-24mi: Add a callback to notify driver about input event submissionPovilas Kanapickas2-0/+24
This is useful for mock input drivers that control the server in integration tests. Given that input submission happens on a different thread than processing, it's otherwise impossible for the driver to synchronize with the completion of the processing of submitted events. Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2020-07-05Fix spelling/wording issuesAlan Coopersmith8-11/+11
Most (but not all) of these were found by using codespell --builtin clear,rare,usage,informal,code,names but not everything reported by that was fixed. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-10-30misprite: Stop wrapping GetImage/GetSpansAdam Jackson1-88/+0
SourceValidate handles this for us consistently now. Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-10-30mi: Add a default no-op miSourceValidateAdam Jackson4-9/+17
Slightly simplifies the callers since they don't need to check for non-NULL anymore. I do extremely hate the workarounds here to suppress misprite taking the cursor down though. Surely there's a better way. Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-10-15mi: Fix undefined memcpy in mieqGrowQueueAdam Jackson1-5/+7
The first time we get here, eventQueue->events is NULL.
2019-10-15mi: Fix undefined shift in miSetVisualTypesAndMasksAdam Jackson1-4/+4
The masks we end up building will occupy all 32 bits of an unsigned int, which means we had better build the shifts out of unsigned ints, because left-shifting a signed int all the way into the sign bit is undefined.