Split out a dedicated InternalClient class

Authored by graesslin on Jan 27 2019, 7:52 PM.



Most of the functionality which is special to internal clients is moved
from ShellClient to InternalClient. As KWin's qpa is still bound to the
Wayland protocol InternalClient inherits from ShellClient. Due to that
some aspects in ShellClient are "weird". ShellClient still detects
whether it's an internal client and uses the variable m_internal to
capture the state. This is required as we cannot use the isInternal
method. Most of m_internal usage is in init which is called from
constructor of ShellClient. Thus it's not possible to call into virtual
methods of InternalClient.

Also some of the code is duplicated and some methods are temporarily
marked as virtual.

The next step will be to remove ShmBuffer for internal windows which
should decouple the two implementations further with the long term goal
of having InternalClient inherit AbstractClient directly.

Test Plan

Run nested KWin, triggered outline (OpenGL case) and debug console (shm case).
InternalWindow unit test still passes.

Diff Detail

R108 KWin
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
graesslin created this revision.Jan 27 2019, 7:52 PM
Restricted Application added a project: KWin. · View Herald TranscriptJan 27 2019, 7:52 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
graesslin requested review of this revision.Jan 27 2019, 7:52 PM
zzag added a subscriber: zzag.Jan 27 2019, 9:20 PM

Cool stuff!

zzag added a comment.Jan 31 2019, 11:56 PM

Hmm, plasma surfaces are broken

(the panel should be at the bottom of the screen; notifications should appear in the bottom right corner of the screen)

(the panel should be at the bottom of the screen; notifications should appear in the bottom right corner of the screen)

I doubt that's from this patch, those windows aren't internal.
Do you maybe have my delayed init patch?

zzag added a comment.Feb 1 2019, 1:29 AM

Do you maybe have my delayed init patch?

No, I don't.

I don't see how this patch could cause Plasma windows to have problems. All changed code is internal windows.

zzag added inline comments.Feb 10 2019, 5:41 PM

If I add !m_internal check back, plasma surfaces are no longer misplaced.

graesslin added inline comments.Feb 11 2019, 4:09 PM

ok, will update. It means the complete if needs to go. !m_internal is always true for Plasma shell so the second part never mattered.

graesslin updated this revision to Diff 51419.Feb 11 2019, 4:10 PM

Remove rect.isValid check

zzag added inline comments.Feb 12 2019, 5:55 PM

Hmm, what about internal Plasma::Dialogs(e.g. an osd that shows up after switching between virtual desktops)? Won't this cause any issues?

graesslin added inline comments.Feb 16 2019, 1:25 PM

Yes and no. Currently this is broken. We have lots of bug reports about geometry being wrong for osd. This is in fact the main motivation for this change and the work on getting the QPA Wayland free.

I consider that this won't work after the change, but it won't be broken more than currently and will allow to fixup properly afterwards.

zzag accepted this revision.Feb 17 2019, 12:25 PM

Looks good to me.


Agreed, there are definitely some problems with OSDs, but I personally would prefer to keep things as they are. This change is about splitting internal entities in KWin, so users shouldn't see any difference before and after.

This revision is now accepted and ready to land.Feb 17 2019, 12:25 PM
zzag added a comment.Feb 17 2019, 12:27 PM

By the way, ++ for "#pragma once". :-)

This revision was automatically updated to reflect the committed changes.