diff --git a/client.cpp b/client.cpp index 13f8a80707..512c307cf8 100644 --- a/client.cpp +++ b/client.cpp @@ -555,6 +555,8 @@ void Client::createDecoration(const QRect& oldgeom) decoration->init(); if (decoration->widget()) { decoration->widget()->installEventFilter(this); + } else if (decoration->window()) { + decoration->window()->installEventFilter(this); } xcb_reparent_window(connection(), decoration->window()->winId(), frameId(), 0, 0); decoration->window()->lower(); diff --git a/events.cpp b/events.cpp index 7652252099..5bf411fe4f 100644 --- a/events.cpp +++ b/events.cpp @@ -1041,9 +1041,9 @@ void Client::updateMouseGrab() bool Client::eventFilter(QObject* o, QEvent* e) { if (decoration == NULL - || o != decoration->widget()) + || (o != decoration->widget() && o != decoration->window())) return false; - if (e->type() == QEvent::MouseButtonPress) { + if (e->type() == QEvent::MouseButtonPress && decoration->widget()) { QMouseEvent* ev = static_cast< QMouseEvent* >(e); return buttonPressEvent(decorationId(), qtToX11Button(ev->button()), qtToX11State(ev->buttons(), ev->modifiers()), ev->x(), ev->y(), ev->globalX(), ev->globalY()); @@ -1066,7 +1066,7 @@ bool Client::eventFilter(QObject* o, QEvent* e) ev->x(), ev->y(), ev->globalX(), ev->globalY()); return r; } - if (e->type() == QEvent::Resize) { + if (e->type() == QEvent::Resize && decoration->widget()) { QResizeEvent* ev = static_cast< QResizeEvent* >(e); // Filter out resize events that inform about size different than frame size. // This will ensure that decoration->width() etc. and decoration->widget()->width() will be in sync.