summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-04-16 17:10:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-04-16 20:29:13 +0200
commita5d3bce44bc04251fd436fabd29878429b4444f1 (patch)
treee963a682e3525050b55b86a87a57b3a3f2484fbd
parentd89a8ae8f963b3b49db920715cfdee11486764e5 (diff)
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@redhat.com>
-rw-r--r--vcl/uiconfig/ui/combobox.ui1
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx21
2 files changed, 14 insertions, 8 deletions
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)