diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-07-09 16:35:02 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-07-09 20:58:35 +0200 |
commit | e875df09fc230639455a7084919bacd81c18c61e (patch) | |
tree | 89bfe31e4f058c50b8599126fb66d321c3289fc5 /vcl/unx | |
parent | 8c9588cceaad5a9155c8d22a44a2e7dc54a56aa0 (diff) |
gtk4: use m_bPopupActive rather than repeatedly call toggle_button_get_active
Change-Id: Ia6b2df875da5af6bfb2198df503d59f34a762262
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118697
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk3/gtkinst.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 47be0fd7ed25..1ee5072aed7f 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -17482,7 +17482,7 @@ private: void fire_signal_changed() { m_bUserSelectEntry = true; - m_bChangedByMenu = toggle_button_get_active(); + m_bChangedByMenu = m_bPopupActive; signal_changed(); m_bChangedByMenu = false; } @@ -17545,7 +17545,7 @@ private: void menu_toggled() { - if (!toggle_button_get_active()) + if (!m_bPopupActive) { #if 0 if (m_bHoverSelection) @@ -17584,12 +17584,13 @@ private: { m_aQuickSelectionEngine.Reset(); + bool bOldPopupActive = m_bPopupActive; + m_bPopupActive = toggle_button_get_active(); + menu_toggled(); - bool bIsShown = toggle_button_get_active(); - if (m_bPopupActive != bIsShown) + if (bOldPopupActive != m_bPopupActive) { - m_bPopupActive = bIsShown; ComboBox::signal_popup_toggled(); // restore focus to the GtkEntry when the popup is gone, which // is what the vcl case does, to ease the transition a little, |