Skip to content

Commit 07cddd6

Browse files
committed
🔧 Use CMake KWin version detection
1 parent 9d822e1 commit 07cddd6

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,9 @@ elseif(DEFINED KWin_VERSION AND KWin_VERSION VERSION_GREATER_EQUAL "6.3.0")
3131
KANDO_KWIN_HAS_TABLET_TOOL_AXIS_PROXIMITY_TABLET_EVENT)
3232
else()
3333
target_compile_definitions(kandointegration PRIVATE KANDO_KWIN_HAS_TABLET_TOOL_EVENT)
34+
endif()
35+
36+
# KWin 6.7 changed EffectHandler::clientArea() and removed the screen argument.
37+
if(DEFINED KWin_VERSION AND KWin_VERSION VERSION_GREATER_EQUAL "6.7.0")
38+
target_compile_definitions(kandointegration PRIVATE KANDO_KWIN_HAS_CLIENT_AREA_TWO_ARGS)
3439
endif()

src/plugin/KandoKWinIntegrationPlugin.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
#include "KandoKWinIntegrationPlugin.h"
1212

13-
#include <config-kwin.h>
1413
#include <effect/effecthandler.h>
1514
#include <effect/effectwindow.h>
1615

@@ -57,7 +56,7 @@ QVariantMap KandoKWinIntegrationPlugin::getWMInfo() const {
5756
const auto windowName = activeWindow ? activeWindow->caption() : QString();
5857
const auto appName = activeWindow ? activeWindow->windowClass() : QString();
5958

60-
#if (PROJECT_VERSION_MAJOR >= 6) && (PROJECT_VERSION_MINOR >= 7)
59+
#if defined(KANDO_KWIN_HAS_CLIENT_AREA_TWO_ARGS)
6160
QRectF workArea = KWin::effects->clientArea(KWin::MaximizeArea, pointerPos.toPoint());
6261
#else
6362
QRectF workArea =

0 commit comments

Comments
 (0)