summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2023-08-19 17:41:02 -0800
committerJim Raykowski <raykowj@gmail.com>2023-08-22 19:46:29 +0200
commit6761b79e7b48a5885adecf445f0206f141888613 (patch)
tree2e8f5acdc60f792b69179898f5f877cb3826e2bc /sd
parente46e663cc350d89e4997095466d675b875eb2e04 (diff)
tdf#156610 tdf#139633 SdNavigator: Fix object not selected
for entry that context menu is shown for, GtkInstance only Commit fdb504add8e21c137a37fde48fedb93638e8ee97 introduced a hack to make inplace editing work for the SalInstance of the treeview that, for Gtk3, breaks object selection before the entry popup menu is displayed which causes the menu item Rename... not to always work as expected. Sal doesn't notice this because the mouse pressed signal is seen when there is a popup menu handler set. Gtk3 does not fire the mouse pressed signal when a popup menu handler set. This patch makes object selection always happen before the popup menu is shown. Change-Id: I562ddf99bd15a48631170a7d70821021a4139295 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155867 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index e6e72c8884e0..63c26bc5635c 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -301,6 +301,7 @@ IMPL_LINK(SdPageObjsTLV, CommandHdl, const CommandEvent&, rCEvt, bool)
if (rCEvt.GetCommand() == CommandEventId::ContextMenu)
{
+ m_bMouseReleased = false;
m_xTreeView->grab_focus();
// select clicked entry
@@ -314,7 +315,9 @@ IMPL_LINK(SdPageObjsTLV, CommandHdl, const CommandEvent&, rCEvt, bool)
Select();
}
- return m_aPopupMenuHdl.Call(rCEvt);
+ bool bRet = m_aPopupMenuHdl.Call(rCEvt);
+ m_bMouseReleased = true;
+ return bRet;
}
return false;
@@ -842,7 +845,7 @@ void SdPageObjsTLV::Select()
{
m_nSelectEventId = nullptr;
- // hack to make inplace editing work for x11
+ // m_bMouseReleased is a hack to make inplace editing work for X11
if (m_bMouseReleased)
return;