Kaydet (Commit) a088f9e7 authored tarafından Pranav Kant's avatar Pranav Kant Kaydeden (comit) pranavk

lokdialog: Callback for dialog cursor invalidation

Change-Id: Iecadb68737ed7b1a425d9ea633976fb24d1055c6
Reviewed-on: https://gerrit.libreoffice.org/44721Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarpranavk <pranavk@collabora.co.uk>
üst 8aa381f8
...@@ -97,6 +97,7 @@ public: ...@@ -97,6 +97,7 @@ public:
void LOKKeyInput(const KeyEvent& rKeyEvent); void LOKKeyInput(const KeyEvent& rKeyEvent);
void LOKKeyUp(const KeyEvent& rKeyEvent); void LOKKeyUp(const KeyEvent& rKeyEvent);
void LOKCursorInvalidate(const tools::Rectangle& rRect);
protected: protected:
explicit Dialog( WindowType nType ); explicit Dialog( WindowType nType );
......
...@@ -266,7 +266,7 @@ bool SvpSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) ...@@ -266,7 +266,7 @@ bool SvpSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents)
{ {
// first, process current user events // first, process current user events
bool bEvent = DispatchUserEvents( bHandleAllCurrentEvents ); bool bEvent = DispatchUserEvents( bHandleAllCurrentEvents );
if ( !bHandleAllCurrentEvents &&bEvent ) if ( !bHandleAllCurrentEvents && bEvent )
return true; return true;
bEvent = CheckTimeout() || bEvent; bEvent = CheckTimeout() || bEvent;
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <comphelper/lok.hxx>
#include <vcl/decoview.hxx> #include <vcl/decoview.hxx>
#include <vcl/event.hxx> #include <vcl/event.hxx>
#include <vcl/cursor.hxx> #include <vcl/cursor.hxx>
...@@ -1143,6 +1145,18 @@ void Edit::ImplShowCursor( bool bOnlyIfVisible ) ...@@ -1143,6 +1145,18 @@ void Edit::ImplShowCursor( bool bOnlyIfVisible )
pCursor->SetSize( Size( nCursorWidth, nTextHeight ) ); pCursor->SetSize( Size( nCursorWidth, nTextHeight ) );
pCursor->Show(); 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() void Edit::ImplAlign()
......
...@@ -1015,6 +1015,16 @@ void Dialog::LOKKeyUp(const KeyEvent& rKeyEvent) ...@@ -1015,6 +1015,16 @@ void Dialog::LOKKeyUp(const KeyEvent& rKeyEvent)
ImplWindowFrameProc(this, SalEvent::ExternalKeyUp, &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() void Dialog::ensureRepaint()
{ {
// ensure repaint // ensure repaint
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment