summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-12-16 21:01:13 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2022-07-14 19:45:03 +0200
commit202bf828b750a3f901824ac323953abe3cc51723 (patch)
tree8b96b28d95152644f993323e7ca8d4bbee1ec291 /sw
parent1a5b56b609930441c2ee70a46afb250731b5def4 (diff)
tdf#128567 sw: fix flicker of table selection highlight
Regression from commit c56bf1479cc71d1a2b0639f6383e90c1f7e3655b (tdf#105330 sw: fix lost cursor on undoing nested table insert, 2019-09-16), the problem was that in case lcl_notifyRow() invokes SwRowFrame::ModifyNotification(), then the table selection is re-created all the time, while in case it does not, then it may result in a cursor loss. The reason for the flicker is that normally sw::DocumentTimerManager::m_aDocIdle is not invoked between the SwEditWin mouse button down/move/up events, but in case the notification is done, then the idle kicks in once the page frame of the row is invalidated. Fix the problem by avoiding the notification in the table selection case: this makes the flicker go away and the original cursor loss problem remains fixed, too. [ It is not clear to me woh can I test if the flicker happens, would need some mechanism to ensure that the mouse button down/up/move chain happens without the idle kicking in, perhaps. ] Change-Id: I91e0af0d3b1b9824754c0bf0be8535d294601787 Reviewed-on: https://gerrit.libreoffice.org/85240 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit d4ea54e18346a35590933dd1e8b83d1c12a741de)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/crsr/callnk.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 81240340376f..7bc056be90dd 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -81,6 +81,15 @@ static void lcl_notifyRow(const SwContentNode* pNode, SwCursorShell const & rShe
return;
const SwTableLine* pLine = pRow->GetTabLine( );
+
+ if (rShell.IsTableMode())
+ {
+ // If we have a table selection, then avoid the notification: it's not necessary (the text
+ // cursor needs no updating) and the notification may kill the selection overlay, leading to
+ // flicker.
+ return;
+ }
+
SwFormatFrameSize aSize = pLine->GetFrameFormat()->GetFrameSize();
pRow->ModifyNotification(nullptr, &aSize);
}