aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortrianta <[email protected]>2024-08-30 07:04:09 -0500
committerGitHub <[email protected]>2024-08-30 14:04:09 +0200
commit259dcd838eef8d6eb2f88f2c0935e32bf7985ebd (patch)
tree478d209998f3d0c0ed0c0d09fd12a1abebdb1f0c
parentef33198e8f9fa874b3ad2e2775f8474af62d7fee (diff)
downloadHyprland-259dcd838eef8d6eb2f88f2c0935e32bf7985ebd.tar.gz
Hyprland-259dcd838eef8d6eb2f88f2c0935e32bf7985ebd.zip
xwayland: update overrideRedirect on map and configure (#7575)
-rw-r--r--src/xwayland/XWM.cpp15
-rw-r--r--src/xwayland/XWM.hpp1
2 files changed, 15 insertions, 1 deletions
diff --git a/src/xwayland/XWM.cpp b/src/xwayland/XWM.cpp
index 5ad146e4..b5762762 100644
--- a/src/xwayland/XWM.cpp
+++ b/src/xwayland/XWM.cpp
@@ -81,6 +81,7 @@ void CXWM::handleConfigureNotify(xcb_configure_notify_event_t* e) {
return;
XSURF->geometry = {e->x, e->y, e->width, e->height};
+ updateOverrideRedirect(XSURF, e->override_redirect);
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) {
const auto XSURF = windowForXID(e->window);
- if (!XSURF || XSURF->overrideRedirect)
+ if (!XSURF)
+ return;
+
+ updateOverrideRedirect(XSURF, e->override_redirect);
+
+ if (XSURF->overrideRedirect)
return;
XSURF->setWithdrawn(false);
@@ -1044,6 +1050,13 @@ bool CXWM::isWMWindow(xcb_window_t w) {
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() {
clipboard.window = xcb_generate_id(connection);
uint32_t mask[1] = {XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_PROPERTY_CHANGE};
diff --git a/src/xwayland/XWM.hpp b/src/xwayland/XWM.hpp
index 4f6f3f7c..7d6b63ed 100644
--- a/src/xwayland/XWM.hpp
+++ b/src/xwayland/XWM.hpp
@@ -82,6 +82,7 @@ class CXWM {
void focusWindow(SP<CXWaylandSurface> surf);
void activateSurface(SP<CXWaylandSurface> surf, bool activate);
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);