diff --git a/CMakeLists.txt b/CMakeLists.txt
index dfb6ce8bc6..d71a2ca437 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -246,7 +246,6 @@ set(kwin_KDE_LIBS
set(kwin_XLIB_LIBS
${X11_X11_LIB}
${X11_Xcursor_LIB}
- ${X11_Xext_LIB} # XShapeSelectInput
${X11_ICE_LIB}
${X11_SM_LIB}
)
diff --git a/events.cpp b/events.cpp
index c7f2510044..bcb1931d5f 100644
--- a/events.cpp
+++ b/events.cpp
@@ -53,7 +53,6 @@ along with this program. If not, see .
#include
-#include
#include
#include
#include
diff --git a/manage.cpp b/manage.cpp
index c385a83f49..2033cd2c0d 100644
--- a/manage.cpp
+++ b/manage.cpp
@@ -25,7 +25,6 @@ along with this program. If not, see .
#include
#include
-#include
#ifdef KWIN_BUILD_ACTIVITIES
#include "activities.h"
@@ -39,6 +38,8 @@ along with this program. If not, see .
#include "workspace.h"
#include "xcbutils.h"
+#include
+
namespace KWin
{
@@ -117,7 +118,7 @@ bool Client::manage(xcb_window_t w, bool isMapped)
setCaption(cap_normal, true);
if (Xcb::Extensions::self()->isShapeAvailable())
- XShapeSelectInput(display(), window(), ShapeNotifyMask);
+ xcb_shape_select_input(connection(), window(), true);
detectShape(window());
detectNoBorder();
fetchIconicName();
diff --git a/scene.cpp b/scene.cpp
index 78657157c7..904b4b070f 100644
--- a/scene.cpp
+++ b/scene.cpp
@@ -68,8 +68,6 @@ along with this program. If not, see .
#include "scene.h"
-#include
-
#include
#include
@@ -594,17 +592,16 @@ const QRegion &Scene::Window::shape() const
if (!shape_valid) {
Client* c = dynamic_cast< Client* >(toplevel);
if (toplevel->shape() || (c != NULL && !c->mask().isEmpty())) {
- int count, order;
- XRectangle* rects = XShapeGetRectangles(display(), toplevel->frameId(),
- ShapeBounding, &count, &order);
- if (rects) {
+ auto cookie = xcb_shape_get_rectangles_unchecked(connection(), toplevel->frameId(), XCB_SHAPE_SK_BOUNDING);
+ ScopedCPointer reply(xcb_shape_get_rectangles_reply(connection(), cookie, nullptr));
+ if (!reply.isNull()) {
shape_region = QRegion();
+ auto *rects = xcb_shape_get_rectangles_rectangles(reply.data());
for (int i = 0;
- i < count;
+ i < xcb_shape_get_rectangles_rectangles_length(reply.data());
++i)
shape_region += QRegion(rects[ i ].x, rects[ i ].y,
rects[ i ].width, rects[ i ].height);
- XFree(rects);
// make sure the shape is sane (X is async, maybe even XShape is broken)
shape_region &= QRegion(0, 0, width(), height());
} else
diff --git a/unmanaged.cpp b/unmanaged.cpp
index ffbb029250..2c737d124b 100644
--- a/unmanaged.cpp
+++ b/unmanaged.cpp
@@ -28,7 +28,7 @@ along with this program. If not, see .
#include
#include
-#include
+#include
namespace KWin
{
@@ -77,7 +77,7 @@ bool Unmanaged::track(Window w)
getWmClientLeader();
getWmClientMachine();
if (Xcb::Extensions::self()->isShapeAvailable())
- XShapeSelectInput(display(), w, ShapeNotifyMask);
+ xcb_shape_select_input(connection(), w, true);
detectShape(w);
getWmOpaqueRegion();
setupCompositing();
@@ -97,7 +97,7 @@ void Unmanaged::release(bool on_shutdown)
finishCompositing();
if (!QWidget::find(window())) { // don't affect our own windows
if (Xcb::Extensions::self()->isShapeAvailable())
- XShapeSelectInput(display(), window(), NoEventMask);
+ xcb_shape_select_input(connection(), window(), false);
Xcb::selectInput(window(), XCB_EVENT_MASK_NO_EVENT);
}
if (!on_shutdown) {
diff --git a/utils.cpp b/utils.cpp
index 0a4c8f9f32..0f2a475e91 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -36,7 +36,6 @@ along with this program. If not, see .
#include
#include
-#include
#include