include/svx/fillctrl.hxx         |    1 +
 svx/source/tbxctrls/fillctrl.cxx |    9 +++++++++
 2 files changed, 10 insertions(+)

New commits:
commit b05104facac18f40f34043be304f616530fc3a22
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Feb 21 16:34:07 2023 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Feb 21 19:56:41 2023 +0000

    Resolves: tdf#148047 don't move focus if dropdown is active
    
    a bit of a corner case, for the popover gtk sets the focus in two
    steps, one to null, then to the final widget, not in just one step.
    On seeing the interim null case we assume that focus was lost and
    set it to the parent, which causes the popover to be dismissed
    while it's still appearing. Workaround this by ignoring the grab
    to parent while the popover is active.
    
    Change-Id: I1bdef51731bf714de2df93fbe6694e9ed3e366d3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147411
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/include/svx/fillctrl.hxx b/include/svx/fillctrl.hxx
index 978f63e359e8..1a781713dbaa 100644
--- a/include/svx/fillctrl.hxx
+++ b/include/svx/fillctrl.hxx
@@ -95,6 +95,7 @@ private:
     void SetOptimalSize();
 
     virtual void DataChanged(const DataChangedEvent& rDCEvt) override;
+    virtual void GetFocus() override;
 
     static void ReleaseFocus_Impl();
 
diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index cfb7583be12c..ced69cbdf2c7 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -1084,4 +1084,13 @@ void FillControl::DataChanged(const DataChangedEvent& 
rDCEvt)
     InterimItemWindow::DataChanged(rDCEvt);
 }
 
+void FillControl::GetFocus()
+{
+    // tdf#148047 if the dropdown is active then leave the focus
+    // there and don't grab back to a different widget
+    if (mxToolBoxColor->get_menu_item_active(".uno:FillColor"))
+        return;
+    InterimItemWindow::GetFocus();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to