[wayland] Discard Force Temporarily rules for shell clients
ClosedPublic

Authored by zzag on Jan 24 2019, 10:11 AM.

Details

Summary

Force Temporarily rules have to be discarded when a client is unmapped.
Otherwise there won't be a difference between Force and Force
Temporarily rules.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
zzag created this revision.Jan 24 2019, 10:11 AM
Restricted Application added a project: KWin. · View Herald TranscriptJan 24 2019, 10:11 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Jan 24 2019, 10:11 AM

Could you please add this to the test case. IIRC we have already a few tests for force temporary.

In practice I fear force and force temporary are the same on Wayland nevertheless. I don't think that unmap will we be used a lot - unlike on X11 where e.g. minimizing a window results in it being unmapped.

zzag added a comment.Jan 24 2019, 2:29 PM

Could you please add this to the test case. IIRC we have already a few tests for force temporary.

I already added them. :-)

See test*ForceTemporarily in shell_client_rules_test.cpp

zzag added a comment.EditedJan 24 2019, 2:38 PM

In practice I fear force and force temporary are the same on Wayland nevertheless. I don't think that unmap will we be used a lot - unlike on X11 where e.g. minimizing a window results in it being unmapped.

Hmm, so when should we discard the force temporarily rules?

Hmm... I would say we need to figure out the intention behind force temporarily and whether this concept can be mapped to Wayland.

I think the history of this type could be kstart.

zzag added a comment.EditedJan 24 2019, 6:02 PM

Hmm... I would say we need to figure out the intention behind force temporarily and whether this concept can be mapped to Wayland.

As a concept, I think it's still applicable on Wayland, e.g. force the opacity for as long as the window is mapped. Though to be honest I can't imagine any real world usages.

May I ask your advice about implementing rules in ShellClient?

zzag added a comment.Jan 26 2019, 3:48 PM

I currently try to implement Position and Size rules. Would it be feasible to implement them as follows?

  • At the start of ShellClient::init, we block requesting geometry;
  • When we are about to finish initializing ShellClient, we do something like
void ShellClient::init()
{
    if (!m_internal) {
        blockRequestGeometry(); // Similar to the constructor of RequestGeometryBlocker
    }

    ...

    if (!m_internal) {
        QTimer::singleShot(0, this, &ShellClient::finishInitialization);
    }
}
  • When finishInitialization will be called, ShellClient most likely will have all necessary information to match window rules against it, so we can check window rules with init=true in finishInitialization
void ShellClient::finishInitialization()
{
    evaluateWindowRulesInit(); // see D18550

   // Send the configure event.
   unblockRequestGeometry(); // Similar to the destructor of RequestGeometryBlocker
}

(I'm still not quite sure how to apply both rules correctly if a client is mapped back again or if a client changes app id after we send the configure event)

zzag added a comment.Jan 31 2019, 10:21 PM

Answer to my question: nope, we should wait until the surface is committed.

zzag updated this revision to Diff 52806.Feb 28 2019, 12:18 PM

Rebase.

zzag retitled this revision from Discard Force Temporarily rules for shell clients to [wayland] Discard Force Temporarily rules for shell clients.Feb 28 2019, 12:23 PM
zzag updated this revision to Diff 52838.Feb 28 2019, 4:25 PM

rebase

This revision was not accepted when it landed; it landed in state Needs Review.Jul 9 2019, 12:16 PM
This revision was automatically updated to reflect the committed changes.