xwayland: update overrideRedirect on map and configure (#7575)

This commit is contained in:
trianta 2024-08-30 07:04:09 -05:00 committed by GitHub
parent ef33198e8f
commit 259dcd838e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View file

@ -81,6 +81,7 @@ void CXWM::handleConfigureNotify(xcb_configure_notify_event_t* e) {
return; return;
XSURF->geometry = {e->x, e->y, e->width, e->height}; XSURF->geometry = {e->x, e->y, e->width, e->height};
updateOverrideRedirect(XSURF, e->override_redirect);
XSURF->events.setGeometry.emit(); XSURF->events.setGeometry.emit();
} }
@ -115,7 +116,12 @@ void CXWM::handleMapRequest(xcb_map_request_event_t* e) {
void CXWM::handleMapNotify(xcb_map_notify_event_t* e) { void CXWM::handleMapNotify(xcb_map_notify_event_t* e) {
const auto XSURF = windowForXID(e->window); const auto XSURF = windowForXID(e->window);
if (!XSURF || XSURF->overrideRedirect) if (!XSURF)
return;
updateOverrideRedirect(XSURF, e->override_redirect);
if (XSURF->overrideRedirect)
return; return;
XSURF->setWithdrawn(false); XSURF->setWithdrawn(false);
@ -1044,6 +1050,13 @@ bool CXWM::isWMWindow(xcb_window_t w) {
return w == wmWindow || w == clipboard.window; return w == wmWindow || w == clipboard.window;
} }
void CXWM::updateOverrideRedirect(SP<CXWaylandSurface> surf, bool overrideRedirect) {
if (!surf || surf->overrideRedirect == overrideRedirect)
return;
surf->overrideRedirect = overrideRedirect;
}
void CXWM::initSelection() { void CXWM::initSelection() {
clipboard.window = xcb_generate_id(connection); clipboard.window = xcb_generate_id(connection);
uint32_t mask[1] = {XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_PROPERTY_CHANGE}; uint32_t mask[1] = {XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_PROPERTY_CHANGE};

View file

@ -82,6 +82,7 @@ class CXWM {
void focusWindow(SP<CXWaylandSurface> surf); void focusWindow(SP<CXWaylandSurface> surf);
void activateSurface(SP<CXWaylandSurface> surf, bool activate); void activateSurface(SP<CXWaylandSurface> surf, bool activate);
bool isWMWindow(xcb_window_t w); bool isWMWindow(xcb_window_t w);
void updateOverrideRedirect(SP<CXWaylandSurface> surf, bool overrideRedirect);
void sendWMMessage(SP<CXWaylandSurface> surf, xcb_client_message_data_t* data, uint32_t mask); void sendWMMessage(SP<CXWaylandSurface> surf, xcb_client_message_data_t* data, uint32_t mask);