kwin: delay setting attention demand as much as possible

about as late as it can be. after being minimized, stamp is updated, rules
applied once (applyWindowRules()), twice (updateWindowRules(Rules::All))
and then again (via the demandAttention() call). it does make tasks
require attention now tho

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-05-19 14:00:40 +03:00
parent 70ab393c4a
commit d86d3fb0b8

View file

@ -442,9 +442,6 @@ bool Client::manage(xcb_window_t w, bool isMapped)
if (init_minimize)
minimize(true); // No animation
if (init_demand_attention)
demandAttention();
// Other settings from the previous session
if (session) {
// Session restored windows are not considered to be new windows WRT rules,
@ -489,7 +486,6 @@ bool Client::manage(xcb_window_t w, bool isMapped)
if (info->state() & NET::Modal)
setModal(true);
setFullScreen(rules()->checkFullScreen(info->state() & NET::FullScreen, !isMapped), false);
demandAttention(init_demand_attention);
}
updateAllowedActions(true);
@ -586,6 +582,8 @@ bool Client::manage(xcb_window_t w, bool isMapped)
RuleBook::self()->discardUsed(this, false); // Remove ApplyNow rules
updateWindowRules(Rules::All); // Was blocked while !isManaged()
demandAttention(init_demand_attention);
updateCompositeBlocking(true);
// TODO: there's a small problem here - isManaged() depends on the mapping state,