xserver: Branch 'master' - 10 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Sep 2 17:37:20 UTC 2024


 Xext/saver.c                     |    1 
 Xi/exevents.c                    |    2 +
 Xi/xibarriers.c                  |    1 
 Xi/xichangecursor.c              |    1 
 Xi/xiwarppointer.c               |    1 
 dix/cursor.c                     |    1 
 dix/cursor_priv.h                |   76 +++++++++++++++++++++++++++++++++++++++
 dix/dispatch.c                   |    1 
 dix/events.c                     |   14 -------
 dix/globals.c                    |    1 
 dix/glyphcurs.c                  |    2 +
 dix/grabs.c                      |    1 
 dix/main.c                       |    1 
 dix/window.c                     |    1 
 hw/xfree86/ramdac/xf86CursorRD.c |    2 +
 hw/xnest/Events.c                |    3 +
 include/cursor.h                 |   65 ---------------------------------
 mi/mieq.c                        |    1 
 mi/mioverlay.c                   |    3 +
 mi/mipointer.c                   |    1 
 mi/miwindow.c                    |    1 
 randr/rrpointer.c                |    3 +
 record/record.c                  |    3 +
 render/animcur.c                 |    3 +
 render/render.c                  |    4 +-
 xfixes/cursor.c                  |    1 
 xkb/xkbActions.c                 |    1 
 27 files changed, 113 insertions(+), 82 deletions(-)

New commits:
commit 6c7c4fdc7ee3e63f15caa4d2e1787d6fa747729f
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 14:35:48 2024 +0100

    dix: drop superfluous XineramaGetCursorScreen()
    
    It's only used for record extension, no external callers, thus doesn't
    need to be exported. Since it's just for retrieving one struct value,
    it's not needed at all - we can do this directly (just like we do in
    many other places)
    
    Note: the check on noPanoramixExtensions is superfluous, since the only
    call site already does it.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1345>

diff --git a/dix/events.c b/dix/events.c
index 1dd1fd40c..983ce739b 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1050,19 +1050,6 @@ GetSpritePosition(DeviceIntPtr pDev, int *px, int *py)
     *py = pSprite->hotPhys.y;
 }
 
-#ifdef PANORAMIX
-int
-XineramaGetCursorScreen(DeviceIntPtr pDev)
-{
-    if (!noPanoramiXExtension) {
-        return pDev->spriteInfo->sprite->screen->myNum;
-    }
-    else {
-        return 0;
-    }
-}
-#endif                          /* PANORAMIX */
-
 #define TIMESLOP (5 * 60 * 1000)        /* 5 minutes */
 
 static void
diff --git a/include/cursor.h b/include/cursor.h
index 7167f4707..50796d047 100644
--- a/include/cursor.h
+++ b/include/cursor.h
@@ -57,8 +57,6 @@ SOFTWARE.
 /* Provide support for alpha composited cursors */
 #define ARGB_CURSOR
 
-struct _DeviceIntRec;
-
 typedef struct _Cursor *CursorPtr;
 // FUN FACT: If you typedef a pointer type, like the `CursorPtr` above
 // then `const CursorPtr` or `CursorPtr const` actually means `struct _Cursor *const`, a constant pointer
@@ -70,8 +68,4 @@ typedef struct _CursorMetric *CursorMetricPtr;
 extern _X_EXPORT int FreeCursor(void *pCurs,
                                 XID cid);
 
-#ifdef PANORAMIX
-extern _X_EXPORT int XineramaGetCursorScreen(struct _DeviceIntRec *pDev);
-#endif                          /* PANORAMIX */
-
 #endif                          /* CURSOR_H */
diff --git a/record/record.c b/record/record.c
index 284a58ba9..748088db8 100644
--- a/record/record.c
+++ b/record/record.c
@@ -36,6 +36,7 @@ and Jim Haggerty of Metheus.
 #include <dix-config.h>
 #endif
 
+#include "dix/cursor_priv.h"
 #include "dix/eventconvert.h"
 
 #include "dixstruct.h"
@@ -722,7 +723,7 @@ RecordSendProtocolEvents(RecordClientsAndProtocolPtr pRCAP,
                  pev->u.u.type == ButtonPress ||
                  pev->u.u.type == ButtonRelease ||
                  pev->u.u.type == KeyPress || pev->u.u.type == KeyRelease)) {
-                int scr = XineramaGetCursorScreen(inputInfo.pointer);
+                int scr = inputInfo.pointer->spriteInfo->sprite->screen->myNum;
 
                 memcpy(&shiftedEvent, pev, sizeof(xEvent));
                 shiftedEvent.u.keyButtonPointer.rootX +=
commit eb81769b58815719b806208d05d4e91949e41084
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 14:31:05 2024 +0100

    dix: unexport GetSpritePosition()
    
    This function isn't used in any external modules, thus no need to export it.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1345>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 30b1a72dd..2f02d7ed4 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -82,6 +82,8 @@ SOFTWARE.
 #include <dix-config.h>
 #endif
 
+#include "dix/cursor_priv.h"
+
 #include <X11/X.h>
 #include <X11/Xproto.h>
 #include <X11/extensions/geproto.h>
diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c
index 5cccebdf2..0c6f8877e 100644
--- a/Xi/xibarriers.c
+++ b/Xi/xibarriers.c
@@ -45,6 +45,7 @@
 #include <dix-config.h>
 #endif
 
+#include "dix/cursor_priv.h"
 #include "dix/dix_priv.h"
 #include "dix/input_priv.h"
 
diff --git a/dix/cursor_priv.h b/dix/cursor_priv.h
index 82fb01144..58048aea9 100644
--- a/dix/cursor_priv.h
+++ b/dix/cursor_priv.h
@@ -71,4 +71,6 @@ void NewCurrentScreen(DeviceIntPtr pDev,
 
 Bool PointerConfinedToScreen(DeviceIntPtr pDev);
 
+void GetSpritePosition(DeviceIntPtr pDev, int *px, int *py);
+
 #endif /* _XSERVER_DIX_CURSOR_PRIV_H */
diff --git a/include/cursor.h b/include/cursor.h
index 9186e3bf2..7167f4707 100644
--- a/include/cursor.h
+++ b/include/cursor.h
@@ -70,10 +70,6 @@ typedef struct _CursorMetric *CursorMetricPtr;
 extern _X_EXPORT int FreeCursor(void *pCurs,
                                 XID cid);
 
-extern _X_EXPORT void GetSpritePosition(struct _DeviceIntRec * /* pDev */ ,
-                                        int * /*px */ ,
-                                        int * /*py */ );
-
 #ifdef PANORAMIX
 extern _X_EXPORT int XineramaGetCursorScreen(struct _DeviceIntRec *pDev);
 #endif                          /* PANORAMIX */
diff --git a/randr/rrpointer.c b/randr/rrpointer.c
index b301d050d..bd394530a 100644
--- a/randr/rrpointer.c
+++ b/randr/rrpointer.c
@@ -19,6 +19,9 @@
  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  * OF THIS SOFTWARE.
  */
+#include <dix-config.h>
+
+#include "dix/cursor_priv.h"
 
 #include "randrstr.h"
 #include "inputstr.h"
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index bbae03b51..bdfca425f 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -35,6 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include <X11/Xproto.h>
 #include <X11/keysym.h>
 
+#include "dix/cursor_priv.h"
 #include "dix/dix_priv.h"
 #include "dix/input_priv.h"
 #include "xkb/xkbsrv_priv.h"
commit 9673886facfeb2fba127f8c8b54afe95a8320d9a
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 13:59:41 2024 +0100

    dix: unexport PointerConfinedToScreen()
    
    It's not used by external modules, so no need to export it.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1345>

diff --git a/dix/cursor_priv.h b/dix/cursor_priv.h
index 21d0e9524..82fb01144 100644
--- a/dix/cursor_priv.h
+++ b/dix/cursor_priv.h
@@ -69,4 +69,6 @@ void NewCurrentScreen(DeviceIntPtr pDev,
                       int x,
                       int y);
 
+Bool PointerConfinedToScreen(DeviceIntPtr pDev);
+
 #endif /* _XSERVER_DIX_CURSOR_PRIV_H */
diff --git a/include/cursor.h b/include/cursor.h
index d1369d4c8..9186e3bf2 100644
--- a/include/cursor.h
+++ b/include/cursor.h
@@ -70,9 +70,6 @@ typedef struct _CursorMetric *CursorMetricPtr;
 extern _X_EXPORT int FreeCursor(void *pCurs,
                                 XID cid);
 
-extern _X_EXPORT Bool PointerConfinedToScreen(struct _DeviceIntRec * /* pDev */
-                                              );
-
 extern _X_EXPORT void GetSpritePosition(struct _DeviceIntRec * /* pDev */ ,
                                         int * /*px */ ,
                                         int * /*py */ );
commit bd3c252710efa8a2446d8110039e6e788b141079
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 13:56:57 2024 +0100

    dix: unexport NewCurrentScreen()
    
    It's not used by external modules/drivers, so no need to export it.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1345>

diff --git a/Xi/xiwarppointer.c b/Xi/xiwarppointer.c
index 1d8926935..d5597471c 100644
--- a/Xi/xiwarppointer.c
+++ b/Xi/xiwarppointer.c
@@ -38,6 +38,7 @@
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XI2proto.h>
 
+#include "dix/cursor_priv.h"
 #include "dix/dix_priv.h"
 
 #include "inputstr.h"           /* DeviceIntPtr      */
diff --git a/dix/cursor_priv.h b/dix/cursor_priv.h
index a1f15a5a6..21d0e9524 100644
--- a/dix/cursor_priv.h
+++ b/dix/cursor_priv.h
@@ -10,8 +10,10 @@
 #include <X11/Xdefs.h>
 #include <X11/Xmd.h>
 
+#include "dix/screenint_priv.h"
 #include "include/cursor.h"
 #include "include/dix.h"
+#include "include/input.h"
 #include "include/window.h"
 
 extern CursorPtr rootCursor;
@@ -62,4 +64,9 @@ Bool CursorMetricsFromGlyph(FontPtr pfont,
 
 void CheckCursorConfinement(WindowPtr pWin);
 
+void NewCurrentScreen(DeviceIntPtr pDev,
+                      ScreenPtr newScreen,
+                      int x,
+                      int y);
+
 #endif /* _XSERVER_DIX_CURSOR_PRIV_H */
diff --git a/hw/xnest/Events.c b/hw/xnest/Events.c
index 337f62a55..da4ad98a0 100644
--- a/hw/xnest/Events.c
+++ b/hw/xnest/Events.c
@@ -20,6 +20,8 @@ is" without express or implied warranty.
 #include <X11/Xdefs.h>
 #include <X11/Xproto.h>
 
+#include "dix/cursor_priv.h"
+
 #include "screenint.h"
 #include "input.h"
 #include "misc.h"
@@ -28,7 +30,6 @@ is" without express or implied warranty.
 #include "servermd.h"
 #include "inputstr.h"
 #include "inpututils.h"
-
 #include "mi.h"
 
 #include "Xnest.h"
diff --git a/include/cursor.h b/include/cursor.h
index e8674f7fc..d1369d4c8 100644
--- a/include/cursor.h
+++ b/include/cursor.h
@@ -70,11 +70,6 @@ typedef struct _CursorMetric *CursorMetricPtr;
 extern _X_EXPORT int FreeCursor(void *pCurs,
                                 XID cid);
 
-extern _X_EXPORT void NewCurrentScreen(struct _DeviceIntRec * /*pDev */ ,
-                                       ScreenPtr /*newScreen */ ,
-                                       int /*x */ ,
-                                       int /*y */ );
-
 extern _X_EXPORT Bool PointerConfinedToScreen(struct _DeviceIntRec * /* pDev */
                                               );
 
diff --git a/mi/mieq.c b/mi/mieq.c
index 4bf570215..850248ece 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -40,6 +40,7 @@ in this Software without prior written authorization from The Open Group.
 #include   <X11/Xmd.h>
 #include   <X11/Xproto.h>
 
+#include   "dix/cursor_priv.h"
 #include   "os/screensaver.h"
 
 #include   "misc.h"
diff --git a/mi/mipointer.c b/mi/mipointer.c
index 48489dc84..7c29d70d4 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -54,6 +54,7 @@ in this Software without prior written authorization from The Open Group.
 #include   <X11/Xmd.h>
 #include   <X11/Xproto.h>
 
+#include   "dix/cursor_priv.h"
 #include   "dix/dix_priv.h"
 #include   "dix/input_priv.h"
 
commit 24d1c084413dc0dfd15f106c282bfe73c8fd3400
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 13:25:49 2024 +0100

    dix: unexport CheckCursorConfinement()
    
    This function isn't used by any external module, so no need to export it.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1345>

diff --git a/dix/cursor_priv.h b/dix/cursor_priv.h
index 47386d81e..a1f15a5a6 100644
--- a/dix/cursor_priv.h
+++ b/dix/cursor_priv.h
@@ -12,6 +12,7 @@
 
 #include "include/cursor.h"
 #include "include/dix.h"
+#include "include/window.h"
 
 extern CursorPtr rootCursor;
 
@@ -59,4 +60,6 @@ Bool CursorMetricsFromGlyph(FontPtr pfont,
                             unsigned ch,
                             CursorMetricPtr cm);
 
+void CheckCursorConfinement(WindowPtr pWin);
+
 #endif /* _XSERVER_DIX_CURSOR_PRIV_H */
diff --git a/include/cursor.h b/include/cursor.h
index f2fa88d16..e8674f7fc 100644
--- a/include/cursor.h
+++ b/include/cursor.h
@@ -70,8 +70,6 @@ typedef struct _CursorMetric *CursorMetricPtr;
 extern _X_EXPORT int FreeCursor(void *pCurs,
                                 XID cid);
 
-extern _X_EXPORT void CheckCursorConfinement(WindowPtr /*pWin */ );
-
 extern _X_EXPORT void NewCurrentScreen(struct _DeviceIntRec * /*pDev */ ,
                                        ScreenPtr /*newScreen */ ,
                                        int /*x */ ,
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
index 57d07cdf3..7a86cdfed 100644
--- a/mi/mioverlay.c
+++ b/mi/mioverlay.c
@@ -4,6 +4,9 @@
 #endif
 
 #include <X11/X.h>
+
+#include "dix/cursor_priv.h"
+
 #include "scrnintstr.h"
 #include <X11/extensions/shapeproto.h>
 #include "validate.h"
diff --git a/mi/miwindow.c b/mi/miwindow.c
index 68520ae6c..32debb48e 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -51,6 +51,7 @@ SOFTWARE.
 #include <X11/X.h>
 #include <X11/extensions/shapeconst.h>
 
+#include "dix/cursor_priv.h"
 #include "dix/input_priv.h"
 
 #include "regionstr.h"
commit 0c354e9166e86d1b35115755e586b8f5e4cdb6c0
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 13:19:17 2024 +0100

    dix: unexport CursorMetricsFromGlyph()
    
    This function isn't used by external modules, thus no need to export it.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1345>

diff --git a/dix/cursor_priv.h b/dix/cursor_priv.h
index 8dfd90120..47386d81e 100644
--- a/dix/cursor_priv.h
+++ b/dix/cursor_priv.h
@@ -7,6 +7,7 @@
 
 #include <X11/fonts/font.h>
 #include <X11/X.h>
+#include <X11/Xdefs.h>
 #include <X11/Xmd.h>
 
 #include "include/cursor.h"
@@ -54,4 +55,8 @@ int ServerBitsFromGlyph(FontPtr pfont,
                         CursorMetricPtr cm,
                         unsigned char **ppbits);
 
+Bool CursorMetricsFromGlyph(FontPtr pfont,
+                            unsigned ch,
+                            CursorMetricPtr cm);
+
 #endif /* _XSERVER_DIX_CURSOR_PRIV_H */
diff --git a/include/cursor.h b/include/cursor.h
index 81a3c18d7..f2fa88d16 100644
--- a/include/cursor.h
+++ b/include/cursor.h
@@ -70,10 +70,6 @@ typedef struct _CursorMetric *CursorMetricPtr;
 extern _X_EXPORT int FreeCursor(void *pCurs,
                                 XID cid);
 
-extern _X_EXPORT Bool CursorMetricsFromGlyph(FontPtr /*pfont */ ,
-                                             unsigned /*ch */ ,
-                                             CursorMetricPtr /*cm */ );
-
 extern _X_EXPORT void CheckCursorConfinement(WindowPtr /*pWin */ );
 
 extern _X_EXPORT void NewCurrentScreen(struct _DeviceIntRec * /*pDev */ ,
commit 974cd2b5f2c6bb28e42dec7821151a16ba1315f4
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 12:53:55 2024 +0100

    dix: unexport ServerBitsFromGlyph()
    
    This function isn't used by external modules/drivers, so no need to export it.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1345>

diff --git a/dix/cursor_priv.h b/dix/cursor_priv.h
index d5e38d549..8dfd90120 100644
--- a/dix/cursor_priv.h
+++ b/dix/cursor_priv.h
@@ -5,6 +5,7 @@
 #ifndef _XSERVER_DIX_CURSOR_PRIV_H
 #define _XSERVER_DIX_CURSOR_PRIV_H
 
+#include <X11/fonts/font.h>
 #include <X11/X.h>
 #include <X11/Xmd.h>
 
@@ -48,4 +49,9 @@ int AllocGlyphCursor(Font source,
 
 CursorPtr CreateRootCursor(void);
 
+int ServerBitsFromGlyph(FontPtr pfont,
+                        unsigned int ch,
+                        CursorMetricPtr cm,
+                        unsigned char **ppbits);
+
 #endif /* _XSERVER_DIX_CURSOR_PRIV_H */
diff --git a/dix/glyphcurs.c b/dix/glyphcurs.c
index 3ff6ae83e..879279269 100644
--- a/dix/glyphcurs.c
+++ b/dix/glyphcurs.c
@@ -48,6 +48,8 @@ SOFTWARE.
 #include <dix-config.h>
 #endif
 
+#include "dix/cursor_priv.h"
+
 #include "misc.h"
 #include <X11/fonts/fontstruct.h>
 #include "dixfontstr.h"
diff --git a/include/cursor.h b/include/cursor.h
index bcd98114c..81a3c18d7 100644
--- a/include/cursor.h
+++ b/include/cursor.h
@@ -70,11 +70,6 @@ typedef struct _CursorMetric *CursorMetricPtr;
 extern _X_EXPORT int FreeCursor(void *pCurs,
                                 XID cid);
 
-extern _X_EXPORT int ServerBitsFromGlyph(FontPtr /*pfont */ ,
-                                         unsigned int /*ch */ ,
-                                         CursorMetricPtr /*cm */ ,
-                                         unsigned char ** /*ppbits */ );
-
 extern _X_EXPORT Bool CursorMetricsFromGlyph(FontPtr /*pfont */ ,
                                              unsigned /*ch */ ,
                                              CursorMetricPtr /*cm */ );
commit 24f3c4a508fa5a759fed20449a5f4b848badfbb5
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 12:31:22 2024 +0100

    dix: unexport cursor allocation functions
    
    These functions aren't used by external modules, so no need to export them.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1345>

diff --git a/dix/cursor_priv.h b/dix/cursor_priv.h
index 89cb59198..d5e38d549 100644
--- a/dix/cursor_priv.h
+++ b/dix/cursor_priv.h
@@ -5,7 +5,11 @@
 #ifndef _XSERVER_DIX_CURSOR_PRIV_H
 #define _XSERVER_DIX_CURSOR_PRIV_H
 
+#include <X11/X.h>
+#include <X11/Xmd.h>
+
 #include "include/cursor.h"
+#include "include/dix.h"
 
 extern CursorPtr rootCursor;
 
@@ -14,4 +18,34 @@ CursorPtr RefCursor(CursorPtr cursor);
 CursorPtr UnrefCursor(CursorPtr cursor);
 int CursorRefCount(ConstCursorPtr cursor);
 
+int AllocARGBCursor(unsigned char *psrcbits,
+                    unsigned char *pmaskbits,
+                    CARD32 *argb,
+                    CursorMetricPtr cm,
+                    unsigned foreRed,
+                    unsigned foreGreen,
+                    unsigned foreBlue,
+                    unsigned backRed,
+                    unsigned backGreen,
+                    unsigned backBlue,
+                    CursorPtr *ppCurs,
+                    ClientPtr client,
+                    XID cid);
+
+int AllocGlyphCursor(Font source,
+                     unsigned int sourceChar,
+                     Font mask,
+                     unsigned int maskChar,
+                     unsigned foreRed,
+                     unsigned foreGreen,
+                     unsigned foreBlue,
+                     unsigned backRed,
+                     unsigned backGreen,
+                     unsigned backBlue,
+                     CursorPtr *ppCurs,
+                     ClientPtr client,
+                     XID cid);
+
+CursorPtr CreateRootCursor(void);
+
 #endif /* _XSERVER_DIX_CURSOR_PRIV_H */
diff --git a/dix/dispatch.c b/dix/dispatch.c
index f41d3704d..6810c1924 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -106,6 +106,7 @@ Equipment Corporation.
 #include <X11/fonts/libxfont2.h>
 
 #include "dix/colormap_priv.h"
+#include "dix/cursor_priv.h"
 #include "dix/dix_priv.h"
 #include "dix/input_priv.h"
 #include "dix/gc_priv.h"
diff --git a/include/cursor.h b/include/cursor.h
index 9c7169ec8..bcd98114c 100644
--- a/include/cursor.h
+++ b/include/cursor.h
@@ -70,36 +70,6 @@ typedef struct _CursorMetric *CursorMetricPtr;
 extern _X_EXPORT int FreeCursor(void *pCurs,
                                 XID cid);
 
-extern _X_EXPORT int AllocARGBCursor(unsigned char * /*psrcbits */ ,
-                                     unsigned char * /*pmaskbits */ ,
-                                     CARD32 * /*argb */ ,
-                                     CursorMetricPtr /*cm */ ,
-                                     unsigned /*foreRed */ ,
-                                     unsigned /*foreGreen */ ,
-                                     unsigned /*foreBlue */ ,
-                                     unsigned /*backRed */ ,
-                                     unsigned /*backGreen */ ,
-                                     unsigned /*backBlue */ ,
-                                     CursorPtr * /*ppCurs */ ,
-                                     ClientPtr /*client */ ,
-                                     XID /*cid */ );
-
-extern _X_EXPORT int AllocGlyphCursor(Font /*source */ ,
-                                      unsigned int /*sourceChar */ ,
-                                      Font /*mask */ ,
-                                      unsigned int /*maskChar */ ,
-                                      unsigned /*foreRed */ ,
-                                      unsigned /*foreGreen */ ,
-                                      unsigned /*foreBlue */ ,
-                                      unsigned /*backRed */ ,
-                                      unsigned /*backGreen */ ,
-                                      unsigned /*backBlue */ ,
-                                      CursorPtr * /*ppCurs */ ,
-                                      ClientPtr /*client */ ,
-                                      XID /*cid */ );
-
-extern _X_EXPORT CursorPtr CreateRootCursor(void);
-
 extern _X_EXPORT int ServerBitsFromGlyph(FontPtr /*pfont */ ,
                                          unsigned int /*ch */ ,
                                          CursorMetricPtr /*cm */ ,
diff --git a/render/render.c b/render/render.c
index e6ace92a9..122bfead1 100644
--- a/render/render.c
+++ b/render/render.c
@@ -26,12 +26,14 @@
 #include <dix-config.h>
 #endif
 
+#include <stdint.h>
 #include <X11/X.h>
 #include <X11/Xproto.h>
 #include <X11/extensions/render.h>
 #include <X11/extensions/renderproto.h>
 #include <X11/Xfuncproto.h>
 
+#include "dix/cursor_priv.h"
 #include "dix/dix_priv.h"
 
 #include "misc.h"
@@ -56,8 +58,6 @@
 #include "panoramiXsrv.h"
 #endif
 
-#include <stdint.h>
-
 static int ProcRenderQueryVersion(ClientPtr pClient);
 static int ProcRenderQueryPictFormats(ClientPtr pClient);
 static int ProcRenderQueryPictIndexValues(ClientPtr pClient);
commit 4aadbeb8aad36906dcb43b5faf158a506c672597
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 12:14:47 2024 +0100

    dix: unexport cursor refcounting functions
    
    These aren't used externally (drivers/modules), thus no need to export them.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1345>

diff --git a/Xext/saver.c b/Xext/saver.c
index 0802551ea..f76ff8e10 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -36,6 +36,7 @@ in this Software without prior written authorization from the X Consortium.
 #include <X11/extensions/saverproto.h>
 
 #include "dix/colormap_priv.h"
+#include "dix/cursor_priv.h"
 #include "dix/dix_priv.h"
 #include "os/screensaver.h"
 
diff --git a/dix/cursor.c b/dix/cursor.c
index 05e15ea69..2e202036d 100644
--- a/dix/cursor.c
+++ b/dix/cursor.c
@@ -51,6 +51,7 @@ SOFTWARE.
 #include <X11/X.h>
 #include <X11/Xmd.h>
 
+#include "dix/cursor_priv.h"
 #include "dix/dix_priv.h"
 
 #include "servermd.h"
diff --git a/dix/cursor_priv.h b/dix/cursor_priv.h
index bd685dbe1..89cb59198 100644
--- a/dix/cursor_priv.h
+++ b/dix/cursor_priv.h
@@ -9,4 +9,9 @@
 
 extern CursorPtr rootCursor;
 
+/* reference counting */
+CursorPtr RefCursor(CursorPtr cursor);
+CursorPtr UnrefCursor(CursorPtr cursor);
+int CursorRefCount(ConstCursorPtr cursor);
+
 #endif /* _XSERVER_DIX_CURSOR_PRIV_H */
diff --git a/dix/events.c b/dix/events.c
index 3a9c47cc1..1dd1fd40c 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -114,6 +114,7 @@ Equipment Corporation.
 #include <X11/extensions/XIproto.h>
 #include <X11/extensions/XI2proto.h>
 
+#include "dix/cursor_priv.h"
 #include "dix/dix_priv.h"
 #include "dix/input_priv.h"
 #include "dix/eventconvert.h"
diff --git a/dix/grabs.c b/dix/grabs.c
index af2f3138b..4e63e7203 100644
--- a/dix/grabs.c
+++ b/dix/grabs.c
@@ -53,6 +53,7 @@ SOFTWARE.
 #include <X11/Xproto.h>
 #include <X11/extensions/XI2.h>
 
+#include "dix/cursor_priv.h"
 #include "dix/dix_priv.h"
 #include "dix/exevents_priv.h"
 #include "os/auth.h"
diff --git a/hw/xfree86/ramdac/xf86CursorRD.c b/hw/xfree86/ramdac/xf86CursorRD.c
index d423ad204..880e23b04 100644
--- a/hw/xfree86/ramdac/xf86CursorRD.c
+++ b/hw/xfree86/ramdac/xf86CursorRD.c
@@ -3,6 +3,8 @@
 #include <xorg-config.h>
 #endif
 
+#include "dix/cursor_priv.h"
+
 #include "xf86.h"
 #include "xf86CursorPriv.h"
 #include "colormapst.h"
diff --git a/include/cursor.h b/include/cursor.h
index af3529bac..9c7169ec8 100644
--- a/include/cursor.h
+++ b/include/cursor.h
@@ -70,10 +70,6 @@ typedef struct _CursorMetric *CursorMetricPtr;
 extern _X_EXPORT int FreeCursor(void *pCurs,
                                 XID cid);
 
-extern _X_EXPORT CursorPtr RefCursor(CursorPtr /* cursor */);
-extern _X_EXPORT CursorPtr UnrefCursor(CursorPtr /* cursor */);
-extern _X_EXPORT int CursorRefCount(ConstCursorPtr /* cursor */);
-
 extern _X_EXPORT int AllocARGBCursor(unsigned char * /*psrcbits */ ,
                                      unsigned char * /*pmaskbits */ ,
                                      CARD32 * /*argb */ ,
diff --git a/render/animcur.c b/render/animcur.c
index c1d32e9b0..f02383c35 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -37,6 +37,9 @@
 
 #include <X11/X.h>
 #include <X11/Xmd.h>
+
+#include "dix/cursor_priv.h"
+
 #include "servermd.h"
 #include "scrnintstr.h"
 #include "dixstruct.h"
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 652525b5b..05f79d36c 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -46,6 +46,7 @@
 #include <dix-config.h>
 #endif
 
+#include "dix/cursor_priv.h"
 #include "dix/dix_priv.h"
 
 #include "xfixesint.h"
commit a2f72755a904e19e9b28b50b5e604803c4dab40b
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Feb 29 10:20:49 2024 +0100

    dix: unexport rootCursor
    
    This field is only used by DIX and XI, thus no need to export it.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1345>

diff --git a/Xi/xichangecursor.c b/Xi/xichangecursor.c
index 9f2a616d9..3638f9e20 100644
--- a/Xi/xichangecursor.c
+++ b/Xi/xichangecursor.c
@@ -38,6 +38,7 @@
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XI2proto.h>
 
+#include "dix/cursor_priv.h"
 #include "dix/dix_priv.h"
 
 #include "inputstr.h"           /* DeviceIntPtr      */
diff --git a/dix/cursor_priv.h b/dix/cursor_priv.h
new file mode 100644
index 000000000..bd685dbe1
--- /dev/null
+++ b/dix/cursor_priv.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: MIT OR X11
+ *
+ * Copyright © 2024 Enrico Weigelt, metux IT consult <info at metux.net>
+ */
+#ifndef _XSERVER_DIX_CURSOR_PRIV_H
+#define _XSERVER_DIX_CURSOR_PRIV_H
+
+#include "include/cursor.h"
+
+extern CursorPtr rootCursor;
+
+#endif /* _XSERVER_DIX_CURSOR_PRIV_H */
diff --git a/dix/globals.c b/dix/globals.c
index 65edfc11f..86312b9ee 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -51,6 +51,7 @@ SOFTWARE.
 #include <X11/X.h>
 #include <X11/Xmd.h>
 
+#include "dix/cursor_priv.h"
 #include "dix/dix_priv.h"
 
 #include "misc.h"
diff --git a/dix/main.c b/dix/main.c
index 7a6e338c5..65ce34aa2 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -87,6 +87,7 @@ Equipment Corporation.
 #include <X11/fonts/libxfont2.h>
 
 #include "dix/callback_priv.h"
+#include "dix/cursor_priv.h"
 #include "dix/dix_priv.h"
 #include "dix/input_priv.h"
 #include "dix/gc_priv.h"
diff --git a/dix/window.c b/dix/window.c
index 1bb9cb090..21e09631b 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -101,6 +101,7 @@ Equipment Corporation.
 #endif
 
 #include "dix/colormap_priv.h"
+#include "dix/cursor_priv.h"
 #include "dix/dix_priv.h"
 #include "dix/exevents_priv.h"
 #include "dix/input_priv.h"
diff --git a/include/cursor.h b/include/cursor.h
index 31bd5d20e..af3529bac 100644
--- a/include/cursor.h
+++ b/include/cursor.h
@@ -67,8 +67,6 @@ typedef struct _Cursor *CursorPtr;
 typedef struct _Cursor const *ConstCursorPtr;
 typedef struct _CursorMetric *CursorMetricPtr;
 
-extern _X_EXPORT CursorPtr rootCursor;
-
 extern _X_EXPORT int FreeCursor(void *pCurs,
                                 XID cid);
 


More information about the xorg-commit mailing list