[Libreoffice-commits] core.git: vcl/uiconfig vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 16 18:29:54 UTC 2020


 vcl/uiconfig/ui/combobox.ui  |    1 -
 vcl/unx/gtk3/gtk3gtkinst.cxx |   21 ++++++++++++++-------
 2 files changed, 14 insertions(+), 8 deletions(-)

New commits:
commit a5d3bce44bc04251fd436fabd29878429b4444f1
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Apr 16 17:10:33 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Apr 16 20:29:13 2020 +0200

    hover selection start off in the wrong place in long lists
    
    Change-Id: I61d93b45d32cfb29e436ae71b83c8d0b252386c6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92385
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/uiconfig/ui/combobox.ui b/vcl/uiconfig/ui/combobox.ui
index 167ae1a7f5ac..e5d31743fcf1 100644
--- a/vcl/uiconfig/ui/combobox.ui
+++ b/vcl/uiconfig/ui/combobox.ui
@@ -89,7 +89,6 @@
             <property name="headers_clickable">False</property>
             <property name="enable_search">False</property>
             <property name="search_column">0</property>
-            <property name="hover_selection">True</property>
             <property name="show_expanders">False</property>
             <property name="activate_on_single_click">True</property>
             <child internal-child="selection">
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index e38911f1c4b1..0ab70cdb8500 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -12818,12 +12818,6 @@ private:
         }
         else
         {
-            if (!m_bHoverSelection)
-            {
-                gtk_tree_view_set_hover_selection(m_pTreeView, true);
-                m_bHoverSelection = true;
-            }
-
             GtkWidget* pComboBox = GTK_WIDGET(getContainer());
 
             gint nComboWidth = gtk_widget_get_allocated_width(pComboBox);
@@ -12836,8 +12830,21 @@ private:
             gtk_widget_set_size_request(GTK_WIDGET(m_pMenuWindow), nPopupWidth, nPopupHeight);
 
             m_nPrePopupCursorPos = get_active();
+
             m_bActivateCalled = false;
             show_menu(pComboBox, m_pMenuWindow);
+
+            // under wayland I see that the cursor pos in super
+            // long treeview menus ends up in the wrong place
+            // but letting all pending events get processed
+            // before enabling hover selection solve it
+            Scheduler::ProcessEventsToIdle();
+
+            if (!m_bHoverSelection)
+            {
+                gtk_tree_view_set_hover_selection(m_pTreeView, true);
+                m_bHoverSelection = true;
+            }
         }
     }
 
@@ -13369,7 +13376,7 @@ public:
         , m_pEntry(GTK_WIDGET(gtk_builder_get_object(pComboBuilder, "entry")))
         , m_pCellView(nullptr)
         , m_aQuickSelectionEngine(*this)
-        , m_bHoverSelection(true)
+        , m_bHoverSelection(false)
         , m_bPopupActive(false)
         , m_bAutoComplete(false)
         , m_bAutoCompleteCaseSensitive(false)


More information about the Libreoffice-commits mailing list