From f13dfb4c018080e94d8ed247984bf2f37e0653b8 Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Sun, 5 Nov 2017 14:01:42 +0530 Subject: lokdialog: Support painting parts of the dialog Pass the dimensions of the region to the paintDialog call to paint only that much of the region in the dialog. The DIALOG_INVALIDATE callback also returns a 'rectangle' field now in the payload that tells the region of the dialog invalidated. It can be used in combination with the new paintDialog call then to paint only the invalidated region in the dialog. Change-Id: Iebb228865c71684e0f75dd01271b71ae41a0f906 Reviewed-on: https://gerrit.libreoffice.org/44472 Tested-by: Jenkins Reviewed-by: pranavk --- vcl/source/control/ctrl.cxx | 4 +++- vcl/source/window/dialog.cxx | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'vcl') diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index 909cf170651a..b3d67d438961 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -440,8 +440,10 @@ void Control::LogicInvalidate(const Rectangle* /*pRectangle*/) // otherwise, for now, just invalidate the whole dialog Dialog* pParentDlg = GetParentDialog(); + + const Rectangle aRect(Point(GetOutOffXPixel(), GetOutOffYPixel()), Size(GetOutputWidthPixel(), GetOutputHeightPixel())); if (pParentDlg) - pParentDlg->LogicInvalidate(nullptr); + pParentDlg->LogicInvalidate(&aRect); } } diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 4ff9d42896a1..f08a22d188f9 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -596,7 +596,7 @@ void Dialog::dispose() if (comphelper::LibreOfficeKit::isActive() && mpDialogRenderable) { - mpDialogRenderable->notifyDialog(maID, "close"); + mpDialogRenderable->notifyDialog(maID, "close", nullptr); } SystemWindow::dispose(); @@ -970,11 +970,11 @@ void Dialog::CloseFloatingWindow() } } -void Dialog::LogicInvalidate(const Rectangle* /*pRectangle*/) +void Dialog::LogicInvalidate(const Rectangle* pRectangle) { if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogRenderable && !maID.isEmpty()) { - mpDialogRenderable->notifyDialog(maID, "invalidate"); + mpDialogRenderable->notifyDialog(maID, "invalidate", pRectangle); } } -- cgit