A rewrite of the Virtual Desktops KCM using the new DBus
API.
Depends on D13887.
mart | |
davidedmundson | |
ltoscano | |
zzag | |
ngraham |
Documentation |
A rewrite of the Virtual Desktops KCM using the new DBus
API.
Depends on D13887.
Lint Skipped | Excuse: Weird errors |
No Unit Test Coverage |
Buildable 5537 | |
Build 5555: arc lint + arc unit |
Please wait for others.
When you're about to push, please:
I understand what you're doing with the syncing now, it makes sense in principle.
Can you copy-paste what you typed to me into the code.
kcmkwin/kwindesktop/desktopsmodel.cpp | ||
---|---|---|
203 | this is setting it to the value it already is | |
252 | If I have 3 desktops with 3 IDs and I delete desktop2 Here I delete 3 and then sync the names, leaving me with: it looks fine within the confines of this KCM, but as soon as we rely on those IDs for external use (even just the fact that a user might have his windows on id3 and none on id2) it'll fall apart. When you make the change sending insert/remove instead of renaming we'll need to make sure we do removal before insertion. desktopCreated relies on the index of the newly created desktop to be in the same place as m_desktops has it. If we insert first, the position will be off as the server will still have the about-to-be-deleted entries |
kcmkwin/kwindesktop/desktopsmodel.cpp | ||
---|---|---|
414 | Is this right? If I remove a desktop in the KCM(without applying settings) and create a new one using the d-bus interface, the KCM will crash. |
kcmkwin/kwindesktop/desktopsmodel.cpp | ||
---|---|---|
254 | Is m_desktops.last() the right one? It can be already deleted. For example, If user has two virtual desktops:
and he or she wants to delete virtual desktop called "Pizza", then Desktop 1 will be removed instead. |
Other issues:
Fix syncing to server.
Fixes take various shapes:
Revamp KWin restart handling
The way a KWin restart is handled is now the same as the general
"stay in sync with server if the user didn't make changes, other-
wise stick to the user state and notify about the server-side
change" approach:
Some issues that I saw while testing this patch:
+---+---+---+---+---+ | | | | | | +---+---+---+---+---+ | | +---+
kcmkwin/kwindesktop/desktopsmodel.h | ||
---|---|---|
52 ↗ | (On Diff #44673) | *KWin-side |
120–125 ↗ | (On Diff #44673) | For better readability, you could create a struct to represent the state on both sides, e.g.: struct State { QStringList desktops; QHash<QString, QString> names; int rows; }; State m_clientState; State m_serverState; |
Further fixes to sync & co
I've just done a round of testing of the latest revision together my last kwin patch, including:
so, definitely lgtm (adding ship it as my personal one, still needs David's)
It turns out we all collectively forgot about the "Switching" tab in the original KCM.
Together with @ngraham we came up with a plan:
Here's a screenshot:
@ngraham would prefer to have the Animation setting in there, and I might add it back later in a seperate review before we go into freeze. For now, however, I want this reviewed and merged along with the other pending virtual desktop patches, so it gets testing in master. Please review.
- if any virtual desktop is removed, then System Settings window will be sent to the last virtual desktop.
This seems to be a bug in KWin core.
"Navigation wraps around" and the other check boxes initially don't represent the actual state, e.g. RollOverDesktops is set to false, but the corresponding checkbox is checked.
I can confirm @zzag's bug.
Overall it works very well! UI-wise, I found myself confused by the unpredictability of the Add button. With multiple rows, it was not clear which row the new desktop would be added to. Perhaps instead we could give each row an inline Add button, kind of like this:
Second issue: when adding new rows, the existing virtual desktops are unpredictably re-assigned. I would expect new empty rows to be created, without re-assigning the rows of the existing desktops.
I'm afraid that in order to do that, we have to change KWin core (and also some effects) first.
@ngraham From a UX perspective your comments make perfect sense, but unfortunately KWin currently has a flat list of desktops divided by number of rows so I need to decline that for now. It's out of scope for 5.15 for sure.
Hmm, I'm no longer able to save new settings, i.e. if any option has been changed, the Apply button is still not enabled.
Darn. Everything else looks and feels good to me. It would be nice to get the animation setting back in here for 5.15 though.
kcmkwin/kwindesktop/kcm_kwin_virtualdesktops.desktop | ||
---|---|---|
6 ↗ | (On Diff #44673) | please make sure the docs people know about this |
kcmkwin/kwindesktop/package/contents/ui/main.qml | ||
---|---|---|
223 ↗ | (On Diff #44673) | Can this be just "ms"-symbol as in Wikipedia for milliseconds to avoid confusion with plural forms? Thanks. |