Enable property notify event handling in Client and Unmanaged
This commit is contained in:
parent
94f23c1877
commit
df4b43ea78
3 changed files with 20 additions and 17 deletions
2
client.h
2
client.h
|
@ -676,7 +676,7 @@ private:
|
||||||
void unmapNotifyEvent(XUnmapEvent* e);
|
void unmapNotifyEvent(XUnmapEvent* e);
|
||||||
void destroyNotifyEvent(XDestroyWindowEvent* e);
|
void destroyNotifyEvent(XDestroyWindowEvent* e);
|
||||||
void configureRequestEvent(XConfigureRequestEvent* e);
|
void configureRequestEvent(XConfigureRequestEvent* e);
|
||||||
virtual void propertyNotifyEvent(XPropertyEvent* e);
|
virtual void propertyNotifyEvent(xcb_property_notify_event_t *e) override;
|
||||||
void clientMessageEvent(XClientMessageEvent* e);
|
void clientMessageEvent(XClientMessageEvent* e);
|
||||||
void enterNotifyEvent(XCrossingEvent* e);
|
void enterNotifyEvent(XCrossingEvent* e);
|
||||||
void leaveNotifyEvent(XCrossingEvent* e);
|
void leaveNotifyEvent(XCrossingEvent* e);
|
||||||
|
|
33
events.cpp
33
events.cpp
|
@ -490,8 +490,11 @@ bool Client::windowEvent(xcb_generic_event_t *e)
|
||||||
// ### Inform the decoration
|
// ### Inform the decoration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
switch(e->type) {
|
const uint8_t eventType = e->response_type & ~0x80;
|
||||||
|
switch(eventType) {
|
||||||
|
#if KWIN_QT5_PORTING
|
||||||
case UnmapNotify:
|
case UnmapNotify:
|
||||||
unmapNotifyEvent(&e->xunmap);
|
unmapNotifyEvent(&e->xunmap);
|
||||||
break;
|
break;
|
||||||
|
@ -504,9 +507,11 @@ bool Client::windowEvent(xcb_generic_event_t *e)
|
||||||
case ConfigureRequest:
|
case ConfigureRequest:
|
||||||
configureRequestEvent(&e->xconfigurerequest);
|
configureRequestEvent(&e->xconfigurerequest);
|
||||||
break;
|
break;
|
||||||
case PropertyNotify:
|
#endif
|
||||||
propertyNotifyEvent(&e->xproperty);
|
case XCB_PROPERTY_NOTIFY:
|
||||||
|
propertyNotifyEvent(reinterpret_cast<xcb_property_notify_event_t*>(e));
|
||||||
break;
|
break;
|
||||||
|
#if KWIN_QT5_PORTING
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
updateUserTime();
|
updateUserTime();
|
||||||
workspace()->setWasUserInteraction();
|
workspace()->setWasUserInteraction();
|
||||||
|
@ -575,8 +580,8 @@ bool Client::windowEvent(xcb_generic_event_t *e)
|
||||||
damageNotifyEvent();
|
damageNotifyEvent();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
return true; // eat all events
|
return true; // eat all events
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -736,25 +741,25 @@ void Client::configureRequestEvent(XConfigureRequestEvent* e)
|
||||||
/*!
|
/*!
|
||||||
Handles property changes of the client window
|
Handles property changes of the client window
|
||||||
*/
|
*/
|
||||||
void Client::propertyNotifyEvent(XPropertyEvent* e)
|
void Client::propertyNotifyEvent(xcb_property_notify_event_t *e)
|
||||||
{
|
{
|
||||||
Toplevel::propertyNotifyEvent(e);
|
Toplevel::propertyNotifyEvent(e);
|
||||||
if (e->window != window())
|
if (e->window != window())
|
||||||
return; // ignore frame/wrapper
|
return; // ignore frame/wrapper
|
||||||
switch(e->atom) {
|
switch(e->atom) {
|
||||||
case XA_WM_NORMAL_HINTS:
|
case XCB_ATOM_WM_NORMAL_HINTS:
|
||||||
getWmNormalHints();
|
getWmNormalHints();
|
||||||
break;
|
break;
|
||||||
case XA_WM_NAME:
|
case XCB_ATOM_WM_NAME:
|
||||||
fetchName();
|
fetchName();
|
||||||
break;
|
break;
|
||||||
case XA_WM_ICON_NAME:
|
case XCB_ATOM_WM_ICON_NAME:
|
||||||
fetchIconicName();
|
fetchIconicName();
|
||||||
break;
|
break;
|
||||||
case XA_WM_TRANSIENT_FOR:
|
case XCB_ATOM_WM_TRANSIENT_FOR:
|
||||||
readTransient();
|
readTransient();
|
||||||
break;
|
break;
|
||||||
case XA_WM_HINTS:
|
case XCB_ATOM_WM_HINTS:
|
||||||
getWMHints();
|
getWMHints();
|
||||||
getIcons(); // because KWin::icon() uses WMHints as fallback
|
getIcons(); // because KWin::icon() uses WMHints as fallback
|
||||||
break;
|
break;
|
||||||
|
@ -1534,11 +1539,9 @@ bool Unmanaged::windowEvent(xcb_generic_event_t *e)
|
||||||
case XCB_CONFIGURE_NOTIFY:
|
case XCB_CONFIGURE_NOTIFY:
|
||||||
configureNotifyEvent(reinterpret_cast<xcb_configure_notify_event_t*>(e));
|
configureNotifyEvent(reinterpret_cast<xcb_configure_notify_event_t*>(e));
|
||||||
break;
|
break;
|
||||||
#if KWIN_QT5_PORTING
|
case XCB_PROPERTY_NOTIFY:
|
||||||
case PropertyNotify:
|
propertyNotifyEvent(reinterpret_cast<xcb_property_notify_event_t*>(e));
|
||||||
propertyNotifyEvent(&e->xproperty);
|
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
default: {
|
default: {
|
||||||
if (eventType == Xcb::Extensions::self()->shapeNotifyEvent()) {
|
if (eventType == Xcb::Extensions::self()->shapeNotifyEvent()) {
|
||||||
detectShape(window());
|
detectShape(window());
|
||||||
|
@ -1574,7 +1577,7 @@ void Unmanaged::configureNotifyEvent(xcb_configure_notify_event_t *e)
|
||||||
// Toplevel
|
// Toplevel
|
||||||
// ****************************************
|
// ****************************************
|
||||||
|
|
||||||
void Toplevel::propertyNotifyEvent(XPropertyEvent* e)
|
void Toplevel::propertyNotifyEvent(xcb_property_notify_event_t *e)
|
||||||
{
|
{
|
||||||
if (e->window != window())
|
if (e->window != window())
|
||||||
return; // ignore frame/wrapper
|
return; // ignore frame/wrapper
|
||||||
|
|
|
@ -347,7 +347,7 @@ protected:
|
||||||
virtual ~Toplevel();
|
virtual ~Toplevel();
|
||||||
void setWindowHandles(Window client, Window frame);
|
void setWindowHandles(Window client, Window frame);
|
||||||
void detectShape(Window id);
|
void detectShape(Window id);
|
||||||
virtual void propertyNotifyEvent(XPropertyEvent* e);
|
virtual void propertyNotifyEvent(xcb_property_notify_event_t *e);
|
||||||
virtual void damageNotifyEvent();
|
virtual void damageNotifyEvent();
|
||||||
void discardWindowPixmap();
|
void discardWindowPixmap();
|
||||||
void addDamageFull();
|
void addDamageFull();
|
||||||
|
|
Loading…
Reference in a new issue