From: Enrico Forestieri Date: Mon, 28 Aug 2023 08:52:08 +0000 (+0200) Subject: Fix detection of xcb during configure X-Git-Tag: 2.4-beta4~2 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=c088cc4413b96fab8fcee2d4f5547d6ddd7fc922;p=lyx.git Fix detection of xcb during configure The QT_FEATURE_xcb macro is not in the private headers anymore. They keep changing APIs... --- diff --git a/config/qt.m4 b/config/qt.m4 index e73872347f..b33be23eba 100644 --- a/config/qt.m4 +++ b/config/qt.m4 @@ -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])], diff --git a/src/frontends/qt/GuiApplication.cpp b/src/frontends/qt/GuiApplication.cpp index a2372429f3..57eaaf6558 100644 --- a/src/frontends/qt/GuiApplication.cpp +++ b/src/frontends/qt/GuiApplication.cpp @@ -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; diff --git a/src/frontends/qt/GuiApplication.h b/src/frontends/qt/GuiApplication.h index a77b0c7b7e..b27964dde4 100644 --- a/src/frontends/qt/GuiApplication.h +++ b/src/frontends/qt/GuiApplication.h @@ -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 //@}