From 77e21efcdde2589a56c029c663cd75e105edd1fd Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 14 Dec 2015 14:05:53 +0000 Subject: Related: rhbz#1289394 always provide the screen area the tip applies to this will make it easier to implement native help tips Change-Id: I984dfadaf02e9b7bf542ba82cf070911c89cb699 (cherry picked from commit 01ef12d173fb2c54a49186c8eb4fa40288b82945) --- vcl/source/window/menuwindow.cxx | 2 +- vcl/source/window/window.cxx | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'vcl/source/window') diff --git a/vcl/source/window/menuwindow.cxx b/vcl/source/window/menuwindow.cxx index 72a1baecbb3f..83ca0b610975 100644 --- a/vcl/source/window/menuwindow.cxx +++ b/vcl/source/window/menuwindow.cxx @@ -63,7 +63,7 @@ bool MenuWindow::ImplHandleHelpEvent(vcl::Window* pMenuWindow, Menu* pMenu, sal_ Rectangle aRect( aPos, Size() ); if (!pMenu->GetHelpText(nId).isEmpty()) - Help::ShowBalloon( pMenuWindow, aPos, pMenu->GetHelpText( nId ) ); + Help::ShowBalloon( pMenuWindow, aPos, aRect, pMenu->GetHelpText( nId ) ); else { // give user a chance to read the full filename diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index a064650f40bb..d1b5bc1a5842 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -2007,7 +2007,14 @@ void Window::RequestHelp( const HelpEvent& rHEvt ) if ( rStr.isEmpty() && ImplGetParent() && !ImplIsOverlapWindow() ) ImplGetParent()->RequestHelp( rHEvt ); else - Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), rStr ); + { + Point aPos = GetPosPixel(); + if ( ImplGetParent() && !ImplIsOverlapWindow() ) + aPos = ImplGetParent()->OutputToScreenPixel( aPos ); + Rectangle aRect( aPos, GetSizePixel() ); + + Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), aRect, rStr ); + } } else if ( rHEvt.GetMode() & HelpEventMode::QUICK ) { -- cgit v1.2.3