Move Window::propertyNotifyEvent to X11Window

This commit is contained in:
Vlad Zahorodnii 2023-03-28 22:16:23 +03:00
parent 005b098707
commit 551e4a8233
3 changed files with 7 additions and 25 deletions

View file

@ -749,7 +749,6 @@ void X11Window::configureRequestEvent(xcb_configure_request_event_t *e)
*/ */
void X11Window::propertyNotifyEvent(xcb_property_notify_event_t *e) void X11Window::propertyNotifyEvent(xcb_property_notify_event_t *e)
{ {
Window::propertyNotifyEvent(e);
if (e->window != window()) { if (e->window != window()) {
return; // ignore frame/wrapper return; // ignore frame/wrapper
} }
@ -784,6 +783,12 @@ void X11Window::propertyNotifyEvent(xcb_property_notify_event_t *e)
checkApplicationMenuServiceName(); checkApplicationMenuServiceName();
} else if (e->atom == atoms->kde_net_wm_appmenu_object_path) { } else if (e->atom == atoms->kde_net_wm_appmenu_object_path) {
checkApplicationMenuObjectPath(); checkApplicationMenuObjectPath();
} else if (e->atom == atoms->wm_client_leader) {
getWmClientLeader();
} else if (e->atom == atoms->kde_net_wm_shadow) {
updateShadow();
} else if (e->atom == atoms->kde_skip_close_animation) {
getSkipCloseAnimation();
} }
break; break;
} }
@ -1312,26 +1317,4 @@ void X11Window::keyPressEvent(uint key_code, xcb_timestamp_t time)
Window::keyPressEvent(key_code); Window::keyPressEvent(key_code);
} }
// ****************************************
// Window
// ****************************************
void Window::propertyNotifyEvent(xcb_property_notify_event_t *e)
{
if (e->window != window()) {
return; // ignore frame/wrapper
}
switch (e->atom) {
default:
if (e->atom == atoms->wm_client_leader) {
getWmClientLeader();
} else if (e->atom == atoms->kde_net_wm_shadow) {
updateShadow();
} else if (e->atom == atoms->kde_skip_close_animation) {
getSkipCloseAnimation();
}
break;
}
}
} // namespace } // namespace

View file

@ -1491,7 +1491,6 @@ Q_SIGNALS:
protected: protected:
void setWindowHandles(xcb_window_t client); void setWindowHandles(xcb_window_t client);
void detectShape(xcb_window_t id); void detectShape(xcb_window_t id);
virtual void propertyNotifyEvent(xcb_property_notify_event_t *e);
Xcb::Property fetchWmClientLeader() const; Xcb::Property fetchWmClientLeader() const;
void readWmClientLeader(Xcb::Property &p); void readWmClientLeader(Xcb::Property &p);
void getWmClientLeader(); void getWmClientLeader();

View file

@ -308,7 +308,7 @@ private:
void destroyNotifyEvent(xcb_destroy_notify_event_t *e); void destroyNotifyEvent(xcb_destroy_notify_event_t *e);
void configureNotifyEvent(xcb_configure_notify_event_t *e); void configureNotifyEvent(xcb_configure_notify_event_t *e);
void configureRequestEvent(xcb_configure_request_event_t *e); void configureRequestEvent(xcb_configure_request_event_t *e);
void propertyNotifyEvent(xcb_property_notify_event_t *e) override; void propertyNotifyEvent(xcb_property_notify_event_t *e);
void clientMessageEvent(xcb_client_message_event_t *e); void clientMessageEvent(xcb_client_message_event_t *e);
void enterNotifyEvent(xcb_enter_notify_event_t *e); void enterNotifyEvent(xcb_enter_notify_event_t *e);
void leaveNotifyEvent(xcb_leave_notify_event_t *e); void leaveNotifyEvent(xcb_leave_notify_event_t *e);