Add "SkipSwitcher" to API
ClosedPublic

Authored by sharvey on Apr 4 2018, 2:11 PM.

Details

Summary

Adding "SkipSwitcher" to the API, following discussion in
BUG 375921

Related to D11925 and D11924

Depends on D11925

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.
sharvey created this revision.Apr 4 2018, 2:11 PM
Restricted Application added a project: KWin. · View Herald TranscriptApr 4 2018, 2:11 PM
Restricted Application added subscribers: KWin, kwin. · View Herald Transcript
sharvey requested review of this revision.Apr 4 2018, 2:11 PM
NOTE: This is a junior job and a work in progress!

Following discussion in BUG 375921 , it was decided to add SkipSwitcher to the API. As this is my first submission to KWin/KWayland/KWindowSystem, @hein has volunteered to help me through this.

From what I'm able to tell from the autotests, this patch appears successful. It's part of a set including D11925 and D11924.

As Martin wrote in the bug report, it was reasonably straightforward, following the implementation of SkipTaskbar.

sharvey added inline comments.Apr 4 2018, 2:23 PM
abstract_client.h
1042

Was accidentally duplicated during patching. Moved above Unaffected comment, following example of m_skipTaskbar

sharvey marked an inline comment as done.Apr 4 2018, 9:39 PM
sharvey added a subscriber: ngraham.
ngraham added a reviewer: KWin.Apr 5 2018, 3:31 PM

Polite "bump" for my reviewers. Please see D12363 - the Kubuntu team has had to manually disable some autotests stemming from D11924.

sharvey added a subscriber: Plasma.Apr 19 2018, 9:45 PM
graesslin requested changes to this revision.Apr 22 2018, 3:34 PM

Sorry for the delay in review, I was on vacations.

abstract_client.cpp
147–149

why do you move it to the top of the FocusChain? This looks like a completely unrelated logical change

abstract_client.h
1042

I don't think the originalSkipSwitcher is needed.

client.cpp
878–887

this is not needed. KWin won't show such hidden windows in the switcher. For the taskbar it's needed as taskbar is in plasmashell and doesn't know about KWin's workaround.

This revision now requires changes to proceed.Apr 22 2018, 3:34 PM
sharvey marked 2 inline comments as done.Apr 22 2018, 5:15 PM
sharvey added inline comments.
abstract_client.cpp
147–149

To the best of my recollection, I was trying to reproduce the code used for skipTaskBar, beginning at original line 165. I confess I don't fully understand what this code does. Please clarify for me where it properly belongs and I'll resubmit the patch.

166

SkipSwitcher focus chain borrowed from here.

client.cpp
878–887

Removed both references to skipSwitcher

sharvey updated this revision to Diff 32831.Apr 22 2018, 5:21 PM
sharvey marked 2 inline comments as done.
  • Correct incorrect skipSwitcher hidden flag usage
graesslin added inline comments.Apr 22 2018, 7:15 PM
abstract_client.cpp
147–149

The skipTaksBar is not the perfect example, the skipPager seems to be better suited. The main reason for the weird issue is that KWin is doing some adjustments for window tabs (which are currently not available). If the window is not the active tab it gets visually hidden and the skip taskbar is set to remove it from the taskbar. Due to that there is all the original skip taksbar, making it the first in focus chain, etc.

For skipSwitcher we don't need all of that. Switcher is KWin internal and KWin knows the state of the window.

Martin:

I can no longer get these patches to compile, even without addressing your inline comments from earlier today. I've pulled down a fresh master of KWin and the arc patch D11926 applied cleanly. However, attempting to build it generates

/home/bundito/kde/src/kde/workspace/kwin/abstract_client.cpp: In member function ‘void KWin::AbstractClient::setupWindowManagementInterface()’:
/home/bundito/kde/src/kde/workspace/kwin/abstract_client.cpp:721:8: error: ‘class KWayland::Server::PlasmaWindowInterface’ has no member named ‘setSkipSwitcher’; did you mean ‘setSkipTaskbar’?
     w->setSkipSwitcher(skipSwitcher());
        ^~~~~~~~~~~~~~~
        setSkipTaskbar
/home/bundito/kde/src/kde/workspace/kwin/abstract_client.cpp: In lambda function:
/home/bundito/kde/src/kde/workspace/kwin/abstract_client.cpp:737:16: error: ‘class KWayland::Server::PlasmaWindowInterface’ has no member named ‘setSkipSwitcher’; did you mean ‘setSkipTaskbar’?
             w->setSkipSwitcher(skipSwitcher());
                ^~~~~~~~~~~~~~~
                setSkipTaskbar

Thinking it might be a problem related to KWayland, I tried recompiling and reinstalling that as well. I followed the same procedure (fresh master -> arc patch D11925). That also fails, in a more cryptic manner:

/home/bundito/kde/src/frameworks/kwayland/src/server/plasmashell_interface.cpp:172:1: error: invalid conversion from ‘void (*)(wl_client*, wl_resource*, uint32_t) {aka void (*)(wl_client*, wl_resource*, unsigned int)}’ to ‘void (*)(wl_client*, wl_resource*)’ [-fpermissive]
 };
 ^
/home/bundito/kde/src/frameworks/kwayland/src/server/plasmashell_interface.cpp:172:1: error: invalid conversion from ‘void (*)(wl_client*, wl_resource*)’ to ‘void (*)(wl_client*, wl_resource*, uint32_t) {aka void (*)(wl_client*, wl_resource*, unsigned int)}’ [-fpermissive]

As the keeper of the KWin/KWayland systems, I hope you can shed some light onto what's happened since I wrote these patches. Have other updates made to the master branch made my patches incompatible?

KWindowSystem, which was also part of this three-part patch (D11924) compiles fine.

Please let me know how I can troubleshoot and rework these patches. If you're still out-of-sync from being on holiday, I can ask @hein if you prefer. I've also had some correspondence with @davidedmundson , if he can be of help.

sharvey retitled this revision from [WIP] Add "SkipSwitcher" to API to Add "SkipSwitcher" to API.Apr 22 2018, 9:48 PM

Removed [WIP] from title at suggestion of @davidedmundson .

As the keeper of the KWin/KWayland systems, I hope you can shed some light onto what's happened since I wrote these patches. Have other updates made to the master branch made my patches incompatible?

Can you try a clean rebuild of KWayland? Maybe some of the auto-generated files cause the issue.

sharvey updated this revision to Diff 32913.Apr 23 2018, 8:55 PM
sharvey marked an inline comment as done.
  • Remove originalSkipSwitcher; move SkipSwitcher to bottom of focus test list
sharvey marked 3 inline comments as done.Apr 23 2018, 8:59 PM

A fresh rebuild of KWayland resolved my compilation problems.

graesslin added inline comments.Apr 24 2018, 4:20 AM
abstract_client.cpp
139

Please move the skipSwitcher method back to here. So that the diff shows what really changed

199

We don't need any adjustments for the focus chain. Just remove the if and the update

abstract_client.h
293

Empty newline added

1038

There's no need to move this variable around

client.cpp
884

Unrelated change

sharvey updated this revision to Diff 32947.Apr 24 2018, 6:51 AM
sharvey marked 6 inline comments as done.
  • Misc code cleanup; removal of SkipSwitcher from focus chain
sharvey updated this revision to Diff 32949.Apr 24 2018, 7:01 AM
  • Further cleanup
graesslin added inline comments.Apr 24 2018, 3:31 PM
abstract_client.cpp
145

we still need the updateWindowRules

sharvey updated this revision to Diff 32997.Apr 24 2018, 4:54 PM
  • Restore accidentally removed updateWindowRules call
sharvey marked an inline comment as done.Apr 24 2018, 4:55 PM
graesslin accepted this revision.Apr 25 2018, 4:25 AM
This revision is now accepted and ready to land.Apr 25 2018, 4:25 AM
This revision was automatically updated to reflect the committed changes.
sharvey edited the summary of this revision. (Show Details)Apr 28 2018, 4:09 PM