summaryrefslogtreecommitdiff
path: root/include/vcl/IDialogRenderable.hxx
AgeCommit message (Collapse)Author
2019-11-28jsdialogs: share the commands updates sending codeSzymon Kłos
Change-Id: I34c1e03a8f92efe0c0dd391d16ff907919e65b00 Reviewed-on: https://gerrit.libreoffice.org/83748 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit 880ff26edff0f7dfdd0d5b74fd9d7026fd2d8523) Reviewed-on: https://gerrit.libreoffice.org/83954 Tested-by: Jenkins
2019-08-26vcl lok: fix UB when lok notifier is deleted before its windowMiklos Vajna
During online.git's unit-copy-paste test: ==18827==ERROR: AddressSanitizer: heap-use-after-free on address 0x61c0000c88c0 at pc 0x7fcbf515fcac bp 0x7ffe9be7eef0 sp 0x7ffe9be7eee8 READ of size 8 at 0x61c0000c88c0 thread T0 (loolkit) #0 0x7fcbf515fcab in vcl::Window::PixelInvalidate(tools::Rectangle const*) core/vcl/source/window/paint.cxx:1227:20 #1 0x7fcbf515efcb in vcl::Window::LogicInvalidate(tools::Rectangle const*) core/vcl/source/window/paint.cxx:1207:9 #2 0x7fcbf5f6f9f4 in vcl::Window::queue_resize(StateChangedType) core/vcl/source/window/window2.cxx:1351:13 #3 0x7fcbf57e3a4f in DockingWindow::queue_resize(StateChangedType) core/vcl/source/window/dockwin.cxx:1046:18 #4 0x7fcbf5f6ff12 in vcl::(anonymous namespace)::queue_ungrouped_resize(vcl::Window const*) core/vcl/source/window/window2.cxx:1301:22 #5 0x7fcbf5f6e390 in vcl::Window::queue_resize(StateChangedType) core/vcl/source/window/window2.cxx:1320:26 #6 0x7fcbf5f6ff12 in vcl::(anonymous namespace)::queue_ungrouped_resize(vcl::Window const*) core/vcl/source/window/window2.cxx:1301:22 #7 0x7fcbf5f6e390 in vcl::Window::queue_resize(StateChangedType) core/vcl/source/window/window2.cxx:1320:26 #8 0x7fcbf601ebef in vcl::Window::StateChanged(StateChangedType) core/vcl/source/window/window.cxx:1929:13 #9 0x7fcbf601f761 in vcl::Window::CompatStateChanged(StateChangedType) core/vcl/source/window/window.cxx:3719:5 #10 0x7fcbf600d9b6 in vcl::Window::Show(bool, ShowFlags) core/vcl/source/window/window.cxx:2189:9 #11 0x7fcbf50ae584 in vcl::Window::Hide() core/include/vcl/window.hxx:930:50 #12 0x7fcbf5fceb7a in vcl::Window::dispose() core/vcl/source/window/window.cxx:399:5 #13 0x7fcbf629f6fb in Control::dispose() core/vcl/source/control/ctrl.cxx:62:13 #14 0x7fcbf612db90 in Button::dispose() core/vcl/source/control/button.cxx:108:14 #15 0x7fcbf617736d in RadioButton::dispose() core/vcl/source/control/button.cxx:2292:13 #16 0x7fcbf6dd52da in VclReferenceBase::disposeOnce() core/vcl/source/outdev/vclreferencebase.cxx:41:5 #17 0x7fcc1add4fa4 in VclPtr<RadioButton>::disposeAndClear() core/include/vcl/vclptr.hxx:206:19 #18 0x7fcc1adc4b3e in sfx2::sidebar::TabBar::SetDecks(std::__debug::vector<sfx2::sidebar::ResourceManager::DeckContextDescriptor, std::allocator<sfx2::sidebar::ResourceManager::DeckContextDescriptor> > const&) core/sfx2/source/sidebar/TabBar.cxx:116:27 #19 0x7fcc1abb2ebb in sfx2::sidebar::SidebarController::UpdateConfigurations() core/sfx2/source/sidebar/SidebarController.cxx:525:15 #20 0x7fcc1abb0d1e in sfx2::sidebar::SidebarController::notifyContextChangeEvent(com::sun::star::ui::ContextChangeEventObject const&) core/sfx2/source/sidebar/SidebarController.cxx:321:9 #21 0x7fcb4688906e in (anonymous namespace)::ContextChangeEventMultiplexer::BroadcastEventToSingleContainer(com::sun::star::ui::ContextChangeEventObject const&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) core/framework/source/services/ContextChangeEventMultiplexer.cxx:254:23 #22 0x7fcb46883d44 in (anonymous namespace)::ContextChangeEventMultiplexer::broadcastContextChangeEvent(com::sun::star::ui::ContextChangeEventObject const&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) core/framework/source/services/ContextChangeEventMultiplexer.cxx:237:5 #23 0x7fcc1ac67170 in sfx2::sidebar::ContextChangeBroadcaster::BroadcastContextChange(com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, rtl::OUString const&, rtl::OUString const&) core/sfx2/source/sidebar/ContextChangeBroadcaster.cxx:108:23 #24 0x7fcc1ac66021 in sfx2::sidebar::ContextChangeBroadcaster::Activate(com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) core/sfx2/source/sidebar/ContextChangeBroadcaster.cxx:53:9 #25 0x7fcc19838064 in SfxShell::BroadcastContextForActivation(bool) core/sfx2/source/control/shell.cxx:713:47 #26 0x7fcc19837b2a in SfxShell::Activate(bool) core/sfx2/source/control/shell.cxx:361:5 #27 0x7fcc19836442 in SfxShell::DoActivate_Impl(SfxViewFrame*, bool) core/sfx2/source/control/shell.cxx:314:5 #28 0x7fcc19647b7e in SfxDispatcher::DoActivate_Impl(bool) core/sfx2/source/control/dispatch.cxx:702:42 #29 0x7fcc1b125692 in SfxViewFrame::DoActivate(bool) core/sfx2/source/view/viewfrm.cxx:1173:20 #30 0x7fcc18ed323d in SfxApplication::SetViewFrame_Impl(SfxViewFrame*) core/sfx2/source/appl/app.cxx:311:21 #31 0x7fcc1b1254f7 in SfxViewFrame::SetViewFrame(SfxViewFrame*) core/sfx2/source/view/viewfrm.cxx:3266:19 #32 0x7fcc1b1412fb in SfxViewFrame::MakeActive_Impl(bool) core/sfx2/source/view/viewfrm.cxx:1877:9 #33 0x7fcc1b06d6f4 in SfxLokHelper::setView(int) core/sfx2/source/view/lokhelper.cxx:85:25 freed by thread T0 (loolkit) here: #0 0x610150 in operator delete(void*) _asan_rtl_:0 #1 0x7fcbb32e2560 in ScTabViewShell::~ScTabViewShell() core/sc/source/ui/view/tabvwsh4.cxx:1709:1 #2 0x7fcc1b121be5 in SfxViewFrame::ReleaseObjectShell_Impl() core/sfx2/source/view/viewfrm.cxx:1116:9 #3 0x7fcc1b13caf9 in SfxViewFrame::~SfxViewFrame() core/sfx2/source/view/viewfrm.cxx:1615:5 #4 0x7fcc1b13e234 in SfxViewFrame::~SfxViewFrame() core/sfx2/source/view/viewfrm.cxx:1609:1 #5 0x7fcc1b125143 in SfxViewFrame::Close() core/sfx2/source/view/viewfrm.cxx:1168:5 #6 0x7fcc1afc6a92 in SfxFrame::DoClose_Impl() core/sfx2/source/view/frame.cxx:159:35 #7 0x7fcc1b0bb60d in SfxBaseController::dispose() core/sfx2/source/view/sfxbasecontroller.cxx:983:28 #8 0x7fcb469d1e9b in (anonymous namespace)::XFrameImpl::setComponent(com::sun::star::uno::Reference<com::sun::star::awt::XWindow> const&, com::sun::star::uno::Reference<com::sun::star::frame::XController> const&) core/framework/source/services/frame.cxx:1492:33 #9 0x7fcb469dd0c0 in (anonymous namespace)::XFrameImpl::close(unsigned char) core/framework/source/services/frame.cxx:1699:12 #10 0x7fcc1b185d84 in SfxViewFrame::Exec_Impl(SfxRequest&) core/sfx2/source/view/viewfrm2.cxx:246:32 #11 0x7fcc1b06c967 in SfxLokHelper::destroyView(int) core/sfx2/source/view/lokhelper.cxx:59:25 #12 0x7fcc2bf0a551 in doc_destroyView(_LibreOfficeKitDocument*, int) core/desktop/source/lib/init.cxx:4473:5 #13 0x980e57 in lok::Document::destroyView(int) core/include/LibreOfficeKit/LibreOfficeKit.hxx:512:9 #14 0x9310e4 in Document::onUnload(ChildSession const&) online/kit/Kit.cpp:1555:29 #15 0x6175e8 in ChildSession::disconnect() online/kit/ChildSession.cpp:98:30 #16 0x616c85 in ChildSession::~ChildSession() online/kit/ChildSession.cpp:85:5 I.e. normally first the vcl::Window is deleted, and only then the view shell, and the lifecycle handled in vcl::Window::ReleaseLOKNotifier(). But at least with DockingWindow, it can happen that the vcl::Window outlives its view shell, so we need to decouple the vcl::Window and its view shell (lok notifier) in both cases, no matter which object is deleted first. Change-Id: I49701817827f8b7545d07a1d74514781551db7e9 Reviewed-on: https://gerrit.libreoffice.org/78105 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2018-11-29tdf#42949 Fix IWYU warnings in include/vcl/[i-m]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: If1b2e04872eb0dd6725802c1709a9085f4cd8c91 Reviewed-on: https://gerrit.libreoffice.org/64141 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-02-27lok sc: Post mouse events to main threadPranav Kant
Change-Id: I1311938d7c01d0e3bfd239743e6cb2148da56cdf Reviewed-on: https://gerrit.libreoffice.org/50253 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-12-04lokdialog: Simplify; make the LOK dialog API more genericPranav Kant
Merge the dialog floating window callbacks and function calls into one. Unique window ids across vcl::Window is enough to distinguish between them. Floating windows don't have a LOK notifier as they are created in the vcl itself (so we can't access them from sfx2). Use the parent LOK notifier in that case (which would be a dialog). This API should also help in autopopup filter tunneling later. Change-Id: I63a2c97ffdd84695dc967e14c793089a7c50b41b
2017-11-29lokdialog: Move the painting down to Window, and enable Calc and Impress.Jan Holesovsky
Tested with .uno:FormatCellDialog in Calc, Impress not tested. Change-Id: I6d911c29616988db0625be9e2a63cf2172c69ee8
2017-11-29lokdialog: Move the Notifier down to vcl::Window.Jan Holesovsky
We need to tunnel more than just dialogs, so this is the 1st step to get the Autofilter popup rendered. Change-Id: I6523a39ddc7a6eb2a204e48ab364130a5822f548
2017-11-29lokdialog: Make vcl::DialogID an integerPranav Kant
This will help launching multiple instances of dialog from multiple views. The earlier approach of using the UNO command strings as dialog id would not have been useful for multi-view case. Change-Id: I01cfb3c8b204d5654df2417efdac6b50dc920f0e
2017-11-29lokdialog: Changed dialog painting to allow for modal dialogsPranav Kant
Split IDialogNotifier from IDialogRenderable and make SfxViewShell implement it. We now just send the dialog UNO command to the backend and wait for core to emit a 'created' dialog callback which signals dialog creation in the backend. The client is then supposed to send the paint commands for rendering the dialog. Change-Id: I1bfbce83c17955fa0212408376d6bcd1b2d2d1dd
2017-11-15lokdialog: Expose cursor visible statusPranav Kant
Change the notifyDialog API a bit. Use a std::vector to keep track of each payload item that needs to be fed to the resulting JSON. Change-Id: If3229a88d2df5368e14290a0e80ebe6206780639 Reviewed-on: https://gerrit.libreoffice.org/44722 Reviewed-by: pranavk <pranavk@collabora.co.uk> Tested-by: pranavk <pranavk@collabora.co.uk>
2017-11-09lokdialog: Move getting dialog information in separate LOK callPranav Kant
Using outparameters to get the dialog information with the paintDialog call was quite confusing. Change-Id: Ief331b251dc66e66084b827ce5b025ba6c9ce7d2 Reviewed-on: https://gerrit.libreoffice.org/44473 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.co.uk>
2017-11-09lokdialog: Support painting parts of the dialogPranav Kant
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 <ci@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.co.uk>
2017-10-28lokdialog: Tunnel dialog title to lokclient as outparamPranav Kant
Change-Id: I1beb5ab3f06debdca7ebf999af7ac879a41ea47e Reviewed-on: https://gerrit.libreoffice.org/43959 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.co.uk>
2017-10-19Remove self-includeStephan Bergmann
...that was probably added by accident with 0f58e974a7d6a88491a97ea3d0f30755ec330253 "lokdialog: Better dialog rendering API" Change-Id: Id480e0332da5edf7fc89b685c681bc79b34869f7 Reviewed-on: https://gerrit.libreoffice.org/43554 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-10-02Change CB_DIALOG_INVALIDATE to CB_DIALOGPranav Kant
We can specify whether it is an invalidation or something else in the payload. Change-Id: I95c5fc0a0a88b5277eaa93c8d1f9b937bddce7b3
2017-10-02lokdialog: Mouse events for dialog floating child windowsPranav Kant
Change-Id: I06a081835d246f752e57f8cc289162ed31fc91d4
2017-10-02lokdialog: Support for rendering floating window dialog widgetsPranav Kant
Now gtktiledviewer can show floating window dialog widgets when user clicks any of such widget in the dialog. Change-Id: I13d756f236379bc8b2041ed41cb7b502f7fd9b24
2017-10-02lokdialog: Register IDIalogRenderable with vcl::DialogPranav Kant
Change-Id: I344f5a9c7167abfde15dcd21c747819cc79b12b1
2017-10-02lokdialog: Set up intial posting mouse events to dialogsPranav Kant
Events from the dialog in GTV are forwarded correctly, but the events are still not processed by the dialog in core. Change-Id: Ib95ac0a3cd23f6cc2763c21425a67402b15f2de2
2017-10-02lokdialog: Better dialog rendering APIPranav Kant
After painting the dialog, also write width and height of the rendered dialog. The dialog is rendered always on the top left of the given canvas, so client can crop the canvas accordingly. Change-Id: If052058a6db8a85d4e28ec88cffcca05564b17f0
2017-10-02Add IDialogRenderable interface for rendering of dialogsTomaž Vajngerl
Change-Id: I1d85729a1ac1a99d33ea2bde1b50ccf4c05ca9a9