Kaydet (Commit) 35a45a45 authored tarafından Faisal M. Al-Otaibi's avatar Faisal M. Al-Otaibi Kaydeden (comit) Norbert Thiebaud

fdo#60213- fix the right-click misbehavior

Change-Id: Iea44c9e70efeb84482aefc70b311f1781241b030
Reviewed-on: https://gerrit.libreoffice.org/1971Reviewed-by: 's avatarNorbert Thiebaud <nthiebaud@gmail.com>
Tested-by: 's avatarNorbert Thiebaud <nthiebaud@gmail.com>
üst 7b235eec
......@@ -857,13 +857,15 @@ void LayoutMenu::Command (const CommandEvent& rEvent)
{
if (GetShellManager() != NULL)
GetShellManager()->MoveToTop(this);
Point aPosition (0,0);
if (rEvent.IsMouseEvent())
{
// Do not show the context menu when the mouse was not
// pressed over an item.
// We have to explicitly specify the location of the menu
// when the LayoutMenu is undocked
if (GetItemId(rEvent.GetMousePosPixel()) > 0)
mrBase.GetViewFrame()->GetDispatcher()->ExecutePopup(
SdResId(RID_TASKPANE_LAYOUTMENU_POPUP));
aPosition = rEvent.GetMousePosPixel();
}
else
{
......@@ -873,13 +875,13 @@ void LayoutMenu::Command (const CommandEvent& rEvent)
if (GetSelectItemId() != (sal_uInt16)-1)
{
Rectangle aBBox (GetItemRect(GetSelectItemId()));
Point aPosition (aBBox.Center());
mrBase.GetViewFrame()->GetDispatcher()->ExecutePopup(
aPosition = aBBox.Center();
}
}
mrBase.GetViewFrame()->GetDispatcher()->ExecutePopup(
SdResId(RID_TASKPANE_LAYOUTMENU_POPUP),
this,
&aPosition);
}
}
}
break;
......
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