]> git.lyx.org Git - lyx.git/commitdiff
Fix detection of xcb during configure
authorEnrico Forestieri <forenr@lyx.org>
Mon, 28 Aug 2023 08:52:08 +0000 (10:52 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Mon, 28 Aug 2023 08:52:08 +0000 (10:52 +0200)
The QT_FEATURE_xcb macro is not in the private headers anymore.
They keep changing APIs...

config/qt.m4
src/frontends/qt/GuiApplication.cpp
src/frontends/qt/GuiApplication.h

index e73872347f954c56d11f6cc5d274c69bced915e0..b33be23ebaf3fce7bce096b5ef9d1a9245c44623 100644 (file)
@@ -218,16 +218,13 @@ AC_DEFUN([QT_DO_IT_ALL],
        save_CPPFLAGS=$CPPFLAGS
        CPPFLAGS="$save_CPPFLAGS $QT_CORE_INCLUDES"
        AC_CHECK_HEADER(QtGui/qtgui-config.h,
-         [lyx_qt5_config=QtGui/qtgui-config.h],
-         [lyx_qt5_config=qconfig.h])
-       AC_CHECK_HEADER(QtGui/private/qtgui-config_p.h,
-         [lyx_qt6_config=QtGui/private/qtgui-config_p.h],
-         [lyx_qt6_config=qconfig.h])
+         [lyx_qt_config=QtGui/qtgui-config.h],
+         [lyx_qt_config=qconfig.h])
        AC_MSG_CHECKING([whether Qt uses the X Window system])
        if test x$USE_QT6 = xyes ; then
          dnl FIXME: Check whether defining QPA_XCB makes sense with Qt6
          AC_PREPROC_IFELSE([AC_LANG_SOURCE([
-           [#include <$lyx_qt6_config>]
+           [#include <$lyx_qt_config>]
            [#if !defined(QT_FEATURE_xcb) || QT_FEATURE_xcb < 0]
            [#error Fail]
            [#endif]])],
@@ -236,7 +233,7 @@ AC_DEFUN([QT_DO_IT_ALL],
            [AC_MSG_RESULT(no)])
        else
          AC_EGREP_CPP(xcb,
-           [#include <$lyx_qt5_config>
+           [#include <$lyx_qt_config>
            QT_QPA_DEFAULT_PLATFORM_NAME],
            [AC_MSG_RESULT(yes)
             AC_DEFINE(QPA_XCB, 1, [Define if Qt uses the X Window System])],
index a2372429f3a3a56b314792212e3b515304e38957..57eaaf65587d51bcc1b881f6b60bdf5fd60c87ef 100644 (file)
@@ -3495,7 +3495,7 @@ bool GuiApplication::longOperationStarted() {
 
 #if defined(QPA_XCB)
 bool GuiApplication::nativeEventFilter(const QByteArray & eventType,
-                                      void * message, long *)
+                                      void * message, QINTPTR *)
 {
        if (!current_view_ || eventType != "xcb_generic_event_t")
                return false;
index a77b0c7b7e998b29d1993d6fca4e0c7080cf1d39..b27964dde4ceaa0c88e68d4da4fcb0b6d03ab370 100644 (file)
@@ -121,8 +121,13 @@ public:
        bool notify(QObject * receiver, QEvent * event) override;
        void commitData(QSessionManager & sm);
 #if defined(QPA_XCB)
+#if (QT_VERSION < 0x060000)
+#define QINTPTR long
+#else
+#define QINTPTR qintptr
+#endif
        virtual bool nativeEventFilter(const QByteArray & eventType, void * message,
-                                      long * result) override;
+                                      QINTPTR * result) override;
 #endif
        //@}