History doesn't use the KlipperPopup at all, it just creates it and
provides it through the ::popup() method. This can also be done by
Klipper directly turning History in a data only class.
When inserting an existing clipboard item again it became marked as a
user selected top because the call sequence to set m_topIsUserSelected
to false was incorrect.
Also when removing a user selected item it didn't get reset causing the
next (not selected) item to be marked as user selected.
The History set the m_top to the value of m_top when removing the last
history item. This would result in a crash if one would access the first
element after removing the last item (invalid pointer).
This ports the workarounds using query pointer from XLib to XCB. At the
same time the build system is adjusted to only link against XCB and
Qt5::X11Extras if we are building for X11 and the define is taken from
config-X11.h instead of setting a define through CMakeLists.txt.
REVIEW: 118637
It had custom (and incorrect) code for reading the window class of the
active window. That's provided by KWindowSystem in a better way without
the need of having windowing system dependent code.
Note: depending on the widget style this renders a regression as the
section might not be supported by the style. This is the case for
Oxygen, see bug 335400.
REVIEW: 118343
Thanks to Esben for all the work on Klipper so far. I'll do my best to
keep Klipper as the excelent tool as it is even after switching to a
new windowing system.
Following HIG recommendations: always show the filter widget in the
popup with a "Search..." click message.
Given that it is no longer hidden the code could be simplified quite
a bit.
REVIEW: 118258
Klipper is supposed to show a filter widget when starting to type.
This is done by forwarding the QKeyEvent to the not visible widget.
This seems to have broken in the Qt5 port. Instead of passing to the
widget it's send again to the KlipperPopup resulting in recursive calls
to the same method which in the end crashes Klipper.
By showing the widget before sending it the key event, everything is
fine. In case that the widget is empty after processing the key event
it gets hidden nevertheless.
REVIEW: 118204
It's important to have ensurePolished() being called before the native
XCB window gets created. The widget style (in our case Oxygen) sets the
RGBA hint during that call. Once the native window is created this would
fail.
In the case of KlipperPopup the native window gets created by accessing
the winId(), thus the ensurePolished() needs to happen before.
REVIEW: 118199