Small Atom fixes

This commit is contained in:
vaxerski 2022-04-20 17:36:53 +02:00
parent 92d9a2556f
commit a02646bd4b
2 changed files with 12 additions and 0 deletions

View file

@ -143,6 +143,13 @@ void EWMH::updateWindow(xcb_window_t win) {
if (!PWINDOW->getDock()) {
long data[] = {XCB_ICCCM_WM_STATE_NORMAL, XCB_NONE};
xcb_change_property(g_pWindowManager->DisplayConnection, XCB_PROP_MODE_REPLACE, win, HYPRATOMS["WM_STATE"], HYPRATOMS["WM_STATE"], 32, 2, data);
if (PWINDOW->getDrawable() == g_pWindowManager->LastWindow) {
uint32_t dataa[] = {HYPRATOMS["_NET_WM_STATE_FOCUSED"]};
xcb_change_property(g_pWindowManager->DisplayConnection, XCB_PROP_MODE_APPEND, PWINDOW->getDrawable(), HYPRATOMS["_NET_WM_STATE"], XCB_ATOM_ATOM, 32, 1, dataa);
} else {
removeAtom(PWINDOW->getDrawable(), HYPRATOMS["_NET_WM_STATE"], HYPRATOMS["_NET_WM_STATE_FOCUSED"]);
}
}
}

View file

@ -566,6 +566,8 @@ void CWindowManager::setFocusedWindow(xcb_drawable_t window) {
applyShapeToWindow(PWINDOW);
}
const auto LASTWINID = LastWindow;
LastWindow = window;
if (PNEWFOCUS) {
@ -580,6 +582,9 @@ void CWindowManager::setFocusedWindow(xcb_drawable_t window) {
// EWMH
EWMH::updateCurrentWindow(window);
EWMH::updateWindow(window);
EWMH::updateWindow(LASTWINID);
}
}