diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-12-26 14:08:07 +0600 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-01-04 14:12:23 +0100 |
commit | 06ff6370a4ba8084890274418eec355e8468573f (patch) | |
tree | a90e248567bae8d4173b95399557310c1b462f0d /desktop/source/lib | |
parent | a5a0bb0c6577c82f5e31f1a81e31381fdf6c0c2e (diff) |
Send tooltip text to LOK
Call vcl::Window::RequestHelp from LOKPostAsyncEvent for
mouse movement. Introduce LOK_CALLBACK_TOOLTIP callback
type, and send it from SwEditWin::RequestHelp.
Intention is, that the tooltip is shown by client at the
current mouse pointer position, which is hopefully not
far away from the point that generated the mouse event.
On the next movement, the client starts a timer to hide
the tooltip. If the next tooltip message arrives, the
tooltip would be updated in the new place.
Alternatively, the payload could contain the coordinates
from the HelpEvent.
Change-Id: I8e96eb6e6983ad8d13b4c5d7be4d51ff3fd11893
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161302
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'desktop/source/lib')
-rw-r--r-- | desktop/source/lib/init.cxx | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 01ee10facc71..c6ccb29424da 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1841,6 +1841,7 @@ void CallbackFlushHandler::queue(const int type, CallbackData& aCallbackData) case LOK_CALLBACK_GRAPHIC_SELECTION: case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR: case LOK_CALLBACK_INVALIDATE_TILES: + case LOK_CALLBACK_TOOLTIP: if (removeAll(type)) SAL_INFO("lok", "Removed dups of [" << type << "]: [" << aCallbackData.getPayload() << "]."); break; @@ -1868,6 +1869,7 @@ void CallbackFlushHandler::queue(const int type, CallbackData& aCallbackData) case LOK_CALLBACK_A11Y_TEXT_SELECTION_CHANGED: case LOK_CALLBACK_A11Y_FOCUSED_CELL_CHANGED: case LOK_CALLBACK_COLOR_PALETTES: + case LOK_CALLBACK_TOOLTIP: { if (removeAll(type)) SAL_INFO("lok", "Removed dups of [" << type << "]: [" << aCallbackData.getPayload() << "]."); @@ -1877,28 +1879,26 @@ void CallbackFlushHandler::queue(const int type, CallbackData& aCallbackData) // These are safe to use the latest state and ignore previous // ones (if any) since the last overrides previous ones, // but only if the view is the same. + case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR: + // deleting the duplicate of visible cursor message can cause hyperlink popup not to show up on second/or more click on the same place. + // If the hyperlink is not empty we can bypass that to show the popup + if (aCallbackData.getPayload().indexOf("\"hyperlink\":\"\"") == -1 + && aCallbackData.getPayload().indexOf("\"hyperlink\": {}") == -1) + break; + [[fallthrough]]; case LOK_CALLBACK_CELL_VIEW_CURSOR: case LOK_CALLBACK_GRAPHIC_VIEW_SELECTION: case LOK_CALLBACK_INVALIDATE_VIEW_CURSOR: - case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR: case LOK_CALLBACK_TEXT_VIEW_SELECTION: case LOK_CALLBACK_VIEW_CURSOR_VISIBLE: case LOK_CALLBACK_CALC_FUNCTION_LIST: case LOK_CALLBACK_FORM_FIELD_BUTTON: { - // deleting the duplicate of visible cursor message can cause hyperlink popup not to show up on second/or more click on the same place. - // If the hyperlink is not empty we can bypass that to show the popup - const bool hyperLinkException = type == LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR && - aCallbackData.getPayload().indexOf("\"hyperlink\":\"\"") == -1 && - aCallbackData.getPayload().indexOf("\"hyperlink\": {}") == -1; - if(!hyperLinkException) - { - const int nViewId = aCallbackData.getViewId(); - removeAll(type, [nViewId] (const CallbackData& elemData) { - return (nViewId == elemData.getViewId()); - } - ); - } + const int nViewId = aCallbackData.getViewId(); + removeAll(type, [nViewId] (const CallbackData& elemData) { + return (nViewId == elemData.getViewId()); + } + ); } break; |