summaryrefslogtreecommitdiff
path: root/mi
AgeCommit message (Collapse)AuthorFilesLines
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.
2019-08-06mi: Use GC clipregion instead of drawable in miDoCopy/miCopyAreaHans de Goede2-2/+2
As discussed in issue #829 the "mi: Shortcut miDoCopy/miCopyArea based on clipList" change leads to pointer-trails (area under pointer not restored when it moves) when using a software cursor. Checking pGC->pCompositeClip instead of pDstDrawable->clipList fixes this problem. Fixes: #829 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-05-18mi: Provide ffs when compiling using MinGWJon Turney1-0/+4
I don't know how I feel about the promise made in 2e7f790b :)
2019-04-12mi: Simplify a conditional in miHandleExposuresAdam Jackson1-8/+1
miHandleExposures does two things: computes the region for which to generate expose events, and (if the destination is a window) paints the exposed regions with the background. The bit of this conditional we're deleting here asserts that the source is either a pixmap or a window without backing store. The only other possibility is a window _with_ backing store. In the old backing store implementation, this was where you would recover bits from backing store. Since our "backing store" is the redirected window pixmap, we know we've already copied all we could, because CopyArea had already seen the entire window pixmap. So now in that third case, we are still drawing to a pixmap (so there's no background to paint) and we are still not generating events, so we can exit early. The comment above the function about recovering bits from backing store is clearly misleading, so delete that too.
2019-03-11mi: Shortcut miDoCopy/miCopyArea based on clipListAdam Jackson2-5/+4
This is maybe one more comparison, but it catches FullyObscured windows slightly earlier, so it's kind of a wash. The important thing is this allows for paintable but unmapped windows, which will have non-empty clipList.
2019-01-16mi: When {en,dis}abling extensions, match names case-insensitivelyAdam Jackson1-1/+1
Both because extension names are inconsistently capitalized on the wire, and because the table we're walking spells it COMPOSITE not Composite. The latter is certainly also a bug, but there's no reason for us to be that strict. Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-28mi: Factor out miSaveScreenAdam Jackson1-1/+9
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-12mi: Hush mieqSetHandler for no-op changesAdam Jackson1-1/+1
If we set the handler to the thing it's already set to, that's fine. Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-12mibltblt: free prgnSrcClip on error path.Dave Airlie1-0/+2
Pointed out by coverity. Signed-off-by: Dave Airlie <airlied@redhat.com>
2018-04-05mi: Hush an almost certainly bogus warningAdam Jackson1-1/+1
In file included from ../mi/miexpose.c:83: ../mi/miexpose.c: In function ‘miHandleExposures’: ../include/regionstr.h:174:22: warning: ‘expBox.y2’ may be used uninitialized in this function [-Wmaybe-uninitialized] (_pReg)->extents = *(_pBox); ~~~~~~~~~~~~~~~~~^~~~~~~~~~ ../mi/miexpose.c:139:12: note: ‘expBox.y2’ was declared here BoxRec expBox; ^~~~~~ etc. It's initialized if (extents), and then only read if (extents), but gcc doesn't seem to figure that out. Whatever, bzero it to be explicit. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2018-04-02meson: Distribute more SDK headersThierry Reding1-0/+15
Install missing headers to the SDK directory to allow external modules to properly build against the SDK. After this commit, the list of files installed in the SDK include directory is the same as the list of files installed by the autotools-based build. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2018-02-21mi: Mention extension loading in verbose logsEmil Velikov1-0/+4
Listing the extensions is useful, despite being annoying for normal usecases. Print it only when extra (lvl 3) vebose is requested. v2: Move the logging to InitExtensions(), as requested by Adam. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-02-19dga: #if XFreeXDGA → #ifdef XFreeXDGALaurent Carlier1-2/+2
../include/events.h:32:14: error: #if with no expression Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
2018-02-14miinitext: Remove separate extension toggle listAdam Jackson1-122/+51
This was only separate because GLX was loadable. The frontend is now linked statically, so we can use the static extension list directly. Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14miinitext: Load GLX on the mi pathAdam Jackson1-0/+3
Add a stub for Xnest so it continues to link, but otherwise we support GLX on every server so there's no need to make every DDX add it. Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-01-22miinitext: General cleanup (v2)Adam Jackson1-19/+15
This really just wants to be the list of disable booleans and initialization functions, and nothing else. Stop including the protocol headers from extinit.h, remove a stray mention of xgl, and move an XInput declaration to a better place. v2: A bunch of drivers assume they'll get the DPMS tokens implicitly, so add it to globals.h. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-11-06dix: Remove ffs.cAdam Jackson1-4/+0
Your libc has ffs, I promise. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-05-18misprite: Clean up some preprocessor abuseAdam Jackson1-32/+37
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>