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:
parent
b3012d97ab
commit
668d90c700
4 changed files with 35 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue