Hi @romangg, I did not test this. I added inline comments explaining why the code is completely unchanged. It does 100% the same as before, just without the duplication. All you need is to invert the two conditions inside the ifs and switch the else branch with the first branch of the if and you'll arrive at this.
- Queries
- All Stories
- Search
- Advanced Search
Advanced Search
Aug 12 2019
Aug 11 2019
Remove locals.
OK, now this should apply :)
Put the check back for now, we spin a nested event loop. Let's remove the check in an independent patch - if at all.
Also add curly braces.
Removed to nullptr checks - after testing manually, I cannot get it to crash with the close menu entry, so I assume this is fine indeed.
I played with this after spending some time to get a working wayland session. I could not see any problems, decorations work, the touch point visualization also works.
The patch should apply cleanly on top of https://phabricator.kde.org/D23067
Fix up commit message
I hope this is now making the code slightly easier to read, without changing the functionallity, except for shuffling things around a tiny bit where we discussed. It also adds a few extra checks, to play safe with the smart pointers. These nullptr checks are extremely cheap.
In D23086#510317, @romangg wrote:In D23086#510314, @zzag wrote:Someone "fixed" these warnings a while ago, but you reverted the fix.
I know. I reverted because it broke functionality. So there was no fix.
This makes sense because libinput provides (non-negative) int32 ids/slots.
Even if it makes sense, the warnings have to be fixed. Comparing signed and unsigned numbers without taking extra measures is bad.
"This makes sense" as in this fix here. If libinput would provide uint32 ids it would not make sense.
Removed, cast, made if one line.
In D23085#510297, @zzag wrote:to iterate over the enum, is mostly confusing
I actually find it a bit cool because we're iterating through layers, but yeah this part can be simpler. :-)
Also removed shortCaption which was only used by tab group.
Fix up a few more places (mostly isCurrentTab related)
Aug 10 2019
Restored tabbox code
In D23069#509945, @zzag wrote:You overlooked _KDE_NET_WM_TAB_GROUP in atoms.cpp.
Attempt to remove entire tabgroup feature.
Removed first nullptr check
In D23070#509774, @romangg wrote:Ok, I believe I got it now. The QWeakPointer constructer should get either passed a QSharedPointer or QWeakPointer as argument. But here we just pass the QObject EffectWindowImpl. Thanks for explaining.
In D23070#509771, @romangg wrote:In D23070#509761, @gladhorn wrote:See https://phabricator.kde.org/D23065
Using a QWeakPointer for QObjects works, but has been deprecated for around seven years. QPointer does the same cleanly (track life-time of QObjects). If you use .toStrongRef() on a QWeakPointer to a QObject without going through QSharedPointer you are in UB land.
In other words: this API is bad and will most likely be removed from Qt in the future.Thanks for the explanation. With "except in this one case" in the description you mean which case? Using it on QObjects? The API will most likely be removed, this means the whole concept of QWeakPointer?
better commit message
improve commit message
And that's exactly it: there is no QSharedPointer involved here at all.
Improve commit message
Fix commit message
I just removed the obviously dead bits behind an if (false). If someone wants to bring it back, it's always in the git history. I don't care either way, but to me reducing lines of code is generally a good thing.
Added a pile of curly brances.
https://commits.kde.org/kwin/9002f9b99eacb2ea6ba66bbaa39a1209ce18db4b - the arc command line tool confused me yet again... sorry.
Aug 9 2019
Looks like someone added override in the meantime :)
I like the idea, I have krunner crashing every so often, but usually it manages to restart, so I never look into that. Getting a backtrace would make fixing it much more likely.