Enable the event filtering for the movingClient
This requires to have the Client::windowEvent() take an xcb_generic_event_t* instead of XEvent*. Currently functionality is ifdefed.icc-effect-5.14.5
parent
e378cb6dba
commit
e4415d370c
2
client.h
2
client.h
|
@ -312,7 +312,7 @@ public:
|
|||
virtual QSize clientSize() const;
|
||||
QPoint inputPos() const { return input_offset; } // Inside of geometry()
|
||||
|
||||
bool windowEvent(XEvent* e);
|
||||
bool windowEvent(xcb_generic_event_t *e);
|
||||
virtual bool eventFilter(QObject* o, QEvent* e);
|
||||
#ifdef HAVE_XSYNC
|
||||
void syncEvent(XSyncAlarmNotifyEvent* e);
|
||||
|
|
20
events.cpp
20
events.cpp
|
@ -198,12 +198,20 @@ bool Workspace::workspaceEvent(xcb_generic_event_t *e)
|
|||
emit propertyNotify(re->atom);
|
||||
}
|
||||
}
|
||||
if (movingClient != NULL && movingClient->moveResizeGrabWindow() == e->xany.window
|
||||
&& (e->type == MotionNotify || e->type == ButtonPress || e->type == ButtonRelease)) {
|
||||
if (movingClient->windowEvent(e))
|
||||
return true;
|
||||
#endif
|
||||
if (movingClient) {
|
||||
if (eventType == XCB_BUTTON_PRESS || eventType == XCB_BUTTON_RELEASE) {
|
||||
if (movingClient->moveResizeGrabWindow() == reinterpret_cast<xcb_button_press_event_t*>(e)->event && movingClient->windowEvent(e)) {
|
||||
return true;
|
||||
}
|
||||
} else if (eventType == XCB_MOTION_NOTIFY) {
|
||||
if (movingClient->moveResizeGrabWindow() == reinterpret_cast<xcb_motion_notify_event_t*>(e)->event && movingClient->windowEvent(e)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if KWIN_QT5_PORTING
|
||||
switch(e->type) {
|
||||
case CreateNotify:
|
||||
if (e->xcreatewindow.parent == rootWindow() &&
|
||||
|
@ -424,8 +432,9 @@ xcb_window_t Workspace::findSpecialEventWindow(XEvent *e)
|
|||
/*!
|
||||
General handler for XEvents concerning the client window
|
||||
*/
|
||||
bool Client::windowEvent(XEvent* e)
|
||||
bool Client::windowEvent(xcb_generic_event_t *e)
|
||||
{
|
||||
#if KWIN_QT5_PORTING
|
||||
if (e->xany.window == window()) { // avoid doing stuff on frame or wrapper
|
||||
unsigned long dirty[ 2 ];
|
||||
double old_opacity = opacity();
|
||||
|
@ -550,6 +559,7 @@ bool Client::windowEvent(XEvent* e)
|
|||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
return true; // eat all events
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue