Implement urgency hint for workspaces (#1379)

When there are any unfocused windows that request activation, mark the workspace as urgent.
This commit is contained in:
Maxim Baz 2023-01-14 20:31:11 +01:00 committed by GitHub
parent b3012d97ab
commit 668d90c700
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 1 deletions

View file

@ -803,7 +803,7 @@ void Events::listener_activateXDG(wl_listener* listener, void* data) {
Debug::log(LOG, "Activate request for surface at %x", E->surface);
if (!*PFOCUSONACTIVATE || !wlr_surface_is_xdg_surface(E->surface))
if (!wlr_surface_is_xdg_surface(E->surface))
return;
const auto PWINDOW = g_pCompositor->getWindowFromSurface(E->surface);
@ -811,6 +811,16 @@ void Events::listener_activateXDG(wl_listener* listener, void* data) {
if (!PWINDOW || PWINDOW == g_pCompositor->m_pLastWindow)
return;
PWINDOW->m_bIsUrgent = true;
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(PWINDOW->m_iWorkspaceID);
if (PWORKSPACE->m_pWlrHandle) {
wlr_ext_workspace_handle_v1_set_urgent(PWORKSPACE->m_pWlrHandle, 1);
}
if (!*PFOCUSONACTIVATE)
return;
if (PWINDOW->m_bIsFloating)
g_pCompositor->moveWindowToTop(PWINDOW);