From 551e4a8233fb0490a709f406e910f431ef9c8768 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 28 Mar 2023 22:16:23 +0300 Subject: [PATCH] Move Window::propertyNotifyEvent to X11Window --- src/events.cpp | 29 ++++++----------------------- src/window.h | 1 - src/x11window.h | 2 +- 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/src/events.cpp b/src/events.cpp index ca5f5a8171..c5e2b2cd08 100644 --- a/src/events.cpp +++ b/src/events.cpp @@ -749,7 +749,6 @@ void X11Window::configureRequestEvent(xcb_configure_request_event_t *e) */ void X11Window::propertyNotifyEvent(xcb_property_notify_event_t *e) { - Window::propertyNotifyEvent(e); if (e->window != window()) { return; // ignore frame/wrapper } @@ -784,6 +783,12 @@ void X11Window::propertyNotifyEvent(xcb_property_notify_event_t *e) checkApplicationMenuServiceName(); } else if (e->atom == atoms->kde_net_wm_appmenu_object_path) { 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; } @@ -1312,26 +1317,4 @@ void X11Window::keyPressEvent(uint key_code, xcb_timestamp_t time) 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 diff --git a/src/window.h b/src/window.h index 2a0a85f253..1fb5c11353 100644 --- a/src/window.h +++ b/src/window.h @@ -1491,7 +1491,6 @@ Q_SIGNALS: protected: void setWindowHandles(xcb_window_t client); void detectShape(xcb_window_t id); - virtual void propertyNotifyEvent(xcb_property_notify_event_t *e); Xcb::Property fetchWmClientLeader() const; void readWmClientLeader(Xcb::Property &p); void getWmClientLeader(); diff --git a/src/x11window.h b/src/x11window.h index 45af0c85fb..8a4f9fad9d 100644 --- a/src/x11window.h +++ b/src/x11window.h @@ -308,7 +308,7 @@ private: void destroyNotifyEvent(xcb_destroy_notify_event_t *e); void configureNotifyEvent(xcb_configure_notify_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 enterNotifyEvent(xcb_enter_notify_event_t *e); void leaveNotifyEvent(xcb_leave_notify_event_t *e);