[Libreoffice-commits] core.git: include/vcl vcl/headless vcl/source
Pranav Kant
pranavk at collabora.co.uk
Wed Nov 15 12:45:34 UTC 2017
include/vcl/dialog.hxx | 1 +
vcl/headless/svpinst.cxx | 2 +-
vcl/source/control/edit.cxx | 14 ++++++++++++++
vcl/source/window/dialog.cxx | 10 ++++++++++
4 files changed, 26 insertions(+), 1 deletion(-)
New commits:
commit a088f9e729084f950ee58afb8f80e64d4d134144
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Tue Nov 14 16:00:57 2017 +0530
lokdialog: Callback for dialog cursor invalidation
Change-Id: Iecadb68737ed7b1a425d9ea633976fb24d1055c6
Reviewed-on: https://gerrit.libreoffice.org/44721
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: pranavk <pranavk at collabora.co.uk>
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 92d9138e3e8f..48ae4fec43fd 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -97,6 +97,7 @@ public:
void LOKKeyInput(const KeyEvent& rKeyEvent);
void LOKKeyUp(const KeyEvent& rKeyEvent);
+ void LOKCursorInvalidate(const tools::Rectangle& rRect);
protected:
explicit Dialog( WindowType nType );
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index e20592b51b67..9912186c729c 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -266,7 +266,7 @@ bool SvpSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents)
{
// first, process current user events
bool bEvent = DispatchUserEvents( bHandleAllCurrentEvents );
- if ( !bHandleAllCurrentEvents &&bEvent )
+ if ( !bHandleAllCurrentEvents && bEvent )
return true;
bEvent = CheckTimeout() || bEvent;
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 8edf98b274e1..cf8a153ee256 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <comphelper/lok.hxx>
+
#include <vcl/decoview.hxx>
#include <vcl/event.hxx>
#include <vcl/cursor.hxx>
@@ -1143,6 +1145,18 @@ void Edit::ImplShowCursor( bool bOnlyIfVisible )
pCursor->SetSize( Size( nCursorWidth, nTextHeight ) );
pCursor->Show();
}
+
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ const long X = GetOutOffXPixel() + pCursor->GetPos().X();
+ const long Y = GetOutOffYPixel() + pCursor->GetPos().Y();
+ if (nCursorWidth == 0)
+ nCursorWidth = 2;
+ const tools::Rectangle aRect(Point(X, Y), Size(nCursorWidth, pCursor->GetHeight()));
+ Dialog* pParentDlg = GetParentDialog();
+ if (pParentDlg)
+ pParentDlg->LOKCursorInvalidate(aRect);
+ }
}
void Edit::ImplAlign()
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index a409bdc6e126..8e6d5f101012 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1015,6 +1015,16 @@ void Dialog::LOKKeyUp(const KeyEvent& rKeyEvent)
ImplWindowFrameProc(this, SalEvent::ExternalKeyUp, &rKeyEvent);
}
+void Dialog::LOKCursorInvalidate(const tools::Rectangle& aRect)
+{
+ assert(comphelper::LibreOfficeKit::isActive());
+
+ if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogRenderable && !maID.isEmpty())
+ {
+ mpDialogRenderable->notifyDialog(maID, "cursor_invalidate", &aRect);
+ }
+}
+
void Dialog::ensureRepaint()
{
// ensure repaint
More information about the Libreoffice-commits
mailing list