From 302c94f280d9f0d1c558d87594952ffdca595e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 26 Jul 2013 13:56:16 +0200 Subject: [PATCH] Enable configure request event handling in Client Still needs to port an XConfigureWindow to XCB. --- client.h | 2 +- events.cpp | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/client.h b/client.h index 7178fb22ed..d4d723b371 100644 --- a/client.h +++ b/client.h @@ -675,7 +675,7 @@ private: bool mapRequestEvent(xcb_map_request_event_t *e); void unmapNotifyEvent(xcb_unmap_notify_event_t *e); void destroyNotifyEvent(xcb_destroy_notify_event_t *e); - void configureRequestEvent(XConfigureRequestEvent* e); + void configureRequestEvent(xcb_configure_request_event_t *e); virtual void propertyNotifyEvent(xcb_property_notify_event_t *e) override; void clientMessageEvent(XClientMessageEvent* e); void enterNotifyEvent(XCrossingEvent* e); diff --git a/events.cpp b/events.cpp index bbd32d876f..f478ffbc99 100644 --- a/events.cpp +++ b/events.cpp @@ -503,11 +503,9 @@ bool Client::windowEvent(xcb_generic_event_t *e) case XCB_MAP_REQUEST: // this one may pass the event to workspace return mapRequestEvent(reinterpret_cast(e)); -#if KWIN_QT5_PORTING - case ConfigureRequest: - configureRequestEvent(&e->xconfigurerequest); + case XCB_CONFIGURE_REQUEST: + configureRequestEvent(reinterpret_cast(e)); break; -#endif case XCB_PROPERTY_NOTIFY: propertyNotifyEvent(reinterpret_cast(e)); break; @@ -696,7 +694,7 @@ void Client::clientMessageEvent(XClientMessageEvent* e) /*! Handles configure requests of the client window */ -void Client::configureRequestEvent(XConfigureRequestEvent* e) +void Client::configureRequestEvent(xcb_configure_request_event_t *e) { if (e->window != window()) return; // ignore frame/wrapper @@ -713,21 +711,22 @@ void Client::configureRequestEvent(XConfigureRequestEvent* e) return; } - if (e->value_mask & CWBorderWidth) { + if (e->value_mask & XCB_CONFIG_WINDOW_BORDER_WIDTH) { + // TODO: port to XCB // first, get rid of a window border XWindowChanges wc; unsigned int value_mask = 0; wc.border_width = 0; - value_mask = CWBorderWidth; + value_mask = XCB_CONFIG_WINDOW_BORDER_WIDTH; XConfigureWindow(display(), window(), value_mask, & wc); } - if (e->value_mask & (CWX | CWY | CWHeight | CWWidth)) + if (e->value_mask & (XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_HEIGHT | XCB_CONFIG_WINDOW_WIDTH)) configureRequest(e->value_mask, e->x, e->y, e->width, e->height, 0, false); - if (e->value_mask & CWStackMode) - restackWindow(e->above, e->detail, NET::FromApplication, userTime(), false); + if (e->value_mask & XCB_CONFIG_WINDOW_STACK_MODE) + restackWindow(e->sibling, e->stack_mode, NET::FromApplication, userTime(), false); // Sending a synthetic configure notify always is fine, even in cases where // the ICCCM doesn't require this - it can be though of as 'the WM decided to move