Fix to show folding preview when move the mouse from bottom to top
ClosedPublic

Authored by loh.tar on Apr 26 2019, 6:57 PM.

Details

Summary

Without this patch happens in that case nothing. You have to leave the area
an hover again the folding begin to trigger the popup.

  • Fix missing cleanup in case of unvalid mouse position
  • Tried to simplify the code and improve readability
Test Plan
  • Compare what happens when you hover a folded range while the window is half behind some other window
  • Have the feeling kateview_test testDragAndDrop fails more and more often. Have already spend a lot of time in look at that but without success

TODO/QUESTIONS

  • How about a smart pointer for m_foldingRange?

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
loh.tar created this revision.Apr 26 2019, 6:57 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptApr 26 2019, 6:57 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
loh.tar requested review of this revision.Apr 26 2019, 6:57 PM
brauch added a subscriber: brauch.Apr 26 2019, 7:00 PM

I guess the intention of the highlight delay is that when you move your mouse across the border, the view doesn't flicker. The 150ms does this well enough for me, I never see a flicker at least ;)

loh.tar updated this revision to Diff 57082.Apr 27 2019, 5:57 AM
loh.tar edited the summary of this revision. (Show Details)
loh.tar edited the test plan for this revision. (Show Details)
  • Fix missing cleanup in case of unvalid mouse position
  • Give members more fitting names
  • Remove unneeded m_nextHighlightBlock
  • Remove repaint()
  • Remove commented event filter hint
dhaumann accepted this revision.Apr 27 2019, 6:34 AM
dhaumann added a subscriber: dhaumann.

Lgtm and is more readable, thanks.

This revision is now accepted and ready to land.Apr 27 2019, 6:34 AM

> Have the feeling kateview_test testDragAndDrop fails more and more often. Have already spend a lot of time in look at that but without success

Harr, with that change it looks good here. Need that a Diff here or can I commit without?

 commit a8d726dbf651fde07fe2ebb1d00a055a6a0dac5d (HEAD -> fix-drag+drop-test)
 Author: loh tar <loh.tar@googlemail.com>
 Date:   Sat Apr 27 11:47:08 2019 +0200

     Fix kateview_test testDragAndDrop
     
     Since a while has that test not reliable worked, looks now OK here

diff --git a/autotests/src/kateview_test.cpp b/autotests/src/kateview_test.cpp
 index cb7cb3d4..1b8d71eb 100644
 --- a/autotests/src/kateview_test.cpp
 +++ b/autotests/src/kateview_test.cpp
 @@ -451,6 +451,8 @@ void KateViewTest::testDragAndDrop()
     QCOMPARE(view->selectionRange(), Range(1, 0, 2, 0));
 
     QVERIFY(QTest::qWaitForWindowExposed(view));
 +    QTest::qWait(0); // For whatever reason needed
 +
     const QPoint startDragPos = internalView->mapFrom(view, view->cursorToCoordinate(KTextEditor::Cursor(1, 2)));
     const QPoint endDragPos = internalView->mapFrom(view, view->cursorToCoordinate(KTextEditor::Cursor(3, 0)));
     const QPoint gStartDragPos = internalView->mapToGlobal(startDragPos);
This revision was automatically updated to reflect the committed changes.

Harr, with that change it looks good here. Need that a Diff here or can I commit without?

> Feel free to commit that.

For unit tests: if you have small improvements for the tests that make them more stable, feel free to commit that.
As long as you take afterwards a look at the CI result on build.kde.org I think that is ok.