While the SplitterProxy is active, it intercepts all relevant events, so that
the underlying widget still thinks it's in the same "on splitter" state. When
the SplitterProxy is left, the underlying widget is sent a HoverLeave/HoverMove
event to make it aware of the new current cursor position. Without this, it
doesn't know that it's not supposed to be in the "on splitter" state, and when
it regains focus it just re-activates the SplitterProxy at the current cursor
position.
This was broken by accident in d201a1f187 ("Fix SplitterProxy not clearing
when above another QSplitterHandle"), which moved the hide() call past the
call to QCoreApplication::sendEvent. Previously that made isVisible() false,
which also prevented the interception of the HoverLeave/HoverMove events.
BUG: 436473
When two SplitterHandles are next to each other, like at the intersection of a
horizontal and vertical splitter (|-), then it's possible that hiding the proxy
of one of those handles causes the other handle to gain focus immediately,
which activates the SplitterProxy again. Before this patch, it would then
continue clearing after reenabling itself, leading to an inconsistent state.
BUG: 431921
It clears the splitter when enabling it, that seems wrong.
Despite this bug, it still mostly worked before because the eventFilter checked
for _enabled anyway.
The constructor of QMouseEvent actually expects windowPos and/or screenPos but never globalPos.
By only supplying a localPos we have Qt figure it out correctly on its own.
Differential Revision: https://phabricator.kde.org/D22851
- removed useless "virtual" specifications
- removed useless destructors
- cleanup variable initializations
- moved protected methods as private when possible for better encapsulation
Summary:
In Qt 4, the compiler detection macros have no value, so they can't be compared
against. So just use the compiler-specific ones.
It also makes use of the fact that undefined tokens evaluate to 0 in
comparisons.
Test Plan: jriddell built it with GCC 5 and 7 against Qt 4 and 5.
Reviewers: #breeze, davidedmundson
Reviewed By: davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D12277
Summary:
Qt has its own macro to tell the compiler that the lack of the break
statement is intentional. One of the advantages of using Q_FALLTHROUGH
is that it explicitly says other developers that the break statement is
missing on purpose. Another advantage is that we can use directives,
see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77817
Test Plan:
Compiled Breeze with GCC 7 and Clang, no "this statement may fall
through" warnings whatsoever.
Reviewers: #breeze, davidedmundson
Reviewed By: davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D11860
- only resize proxy widget on mouse press
- do not clear splitter in leave event if mouseGrabber is still set
- do not disable/enable updates while resizeing the splitter handle