sd/source/ui/dlg/sdtreelb.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 6761b79e7b48a5885adecf445f0206f141888613
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Sat Aug 19 17:41:02 2023 -0800
Commit:     Jim Raykowski <rayk...@gmail.com>
CommitDate: Tue Aug 22 19:46:29 2023 +0200

    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 <rayk...@gmail.com>

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;
 

Reply via email to