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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 13 14:26:30 UTC 2019


 vcl/unx/gtk3/gtk3gtkinst.cxx |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

New commits:
commit c861c611043646eb6ac8a81ba0c76ae2050d6088
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Aug 13 12:43:35 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Aug 13 16:25:45 2019 +0200

    Resolves: tdf#126844 focus in to combobox with entries not seen in parent
    
    there isn't a focus-in on the combobox, only the entry. So use
    entry focus-in as focus-in (we already do this for the combobox dropdown)
    
    Change-Id: I09cf6eb896acbbea5aed2d3b2aa238593ddcb793
    Reviewed-on: https://gerrit.libreoffice.org/77409
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index e9d1c66478ef..044b36168aef 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -9121,6 +9121,7 @@ private:
     gulong m_nKeyPressEventSignalId;
     gulong m_nEntryInsertTextSignalId;
     gulong m_nEntryActivateSignalId;
+    gulong m_nEntryFocusInSignalId;
     gulong m_nEntryFocusOutSignalId;
     guint m_nAutoCompleteIdleId;
 
@@ -9243,6 +9244,17 @@ private:
         }
     }
 
+    static void signalEntryFocusIn(GtkWidget*, GdkEvent*, gpointer widget)
+    {
+        GtkInstanceComboBox* pThis = static_cast<GtkInstanceComboBox*>(widget);
+        pThis->signal_entry_focus_in();
+    }
+
+    void signal_entry_focus_in()
+    {
+        signal_focus_in();
+    }
+
     static void signalEntryFocusOut(GtkWidget*, GdkEvent*, gpointer widget)
     {
         GtkInstanceComboBox* pThis = static_cast<GtkInstanceComboBox*>(widget);
@@ -9260,6 +9272,7 @@ private:
             if (nMin != 0 || nMax != get_active_text().getLength())
                 select_entry_region(0, 0);
         }
+        signal_focus_out();
     }
 
     static void signalEntryActivate(GtkEntry*, gpointer widget)
@@ -9546,6 +9559,7 @@ public:
             m_bAutoComplete = true;
             m_nEntryInsertTextSignalId = g_signal_connect(pEntry, "insert-text", G_CALLBACK(signalEntryInsertText), this);
             m_nEntryActivateSignalId = g_signal_connect(pEntry, "activate", G_CALLBACK(signalEntryActivate), this);
+            m_nEntryFocusInSignalId = g_signal_connect(pEntry, "focus-in-event", G_CALLBACK(signalEntryFocusIn), this);
             m_nEntryFocusOutSignalId = g_signal_connect(pEntry, "focus-out-event", G_CALLBACK(signalEntryFocusOut), this);
             m_nKeyPressEventSignalId = 0;
         }
@@ -9553,6 +9567,7 @@ public:
         {
             m_nEntryInsertTextSignalId = 0;
             m_nEntryActivateSignalId = 0;
+            m_nEntryFocusInSignalId = 0;
             m_nEntryFocusOutSignalId = 0;
             m_nKeyPressEventSignalId = g_signal_connect(m_pWidget, "key-press-event", G_CALLBACK(signalKeyPress), this);
         }
@@ -9844,6 +9859,7 @@ public:
         {
             g_signal_handler_block(pEntry, m_nEntryInsertTextSignalId);
             g_signal_handler_block(pEntry, m_nEntryActivateSignalId);
+            g_signal_handler_block(pEntry, m_nEntryFocusInSignalId);
             g_signal_handler_block(pEntry, m_nEntryFocusOutSignalId);
         }
         else
@@ -9869,6 +9885,7 @@ public:
         if (GtkEntry* pEntry = get_entry())
         {
             g_signal_handler_unblock(pEntry, m_nEntryActivateSignalId);
+            g_signal_handler_unblock(pEntry, m_nEntryFocusInSignalId);
             g_signal_handler_unblock(pEntry, m_nEntryFocusOutSignalId);
             g_signal_handler_unblock(pEntry, m_nEntryInsertTextSignalId);
         }
@@ -9937,6 +9954,7 @@ public:
         {
             g_signal_handler_disconnect(pEntry, m_nEntryInsertTextSignalId);
             g_signal_handler_disconnect(pEntry, m_nEntryActivateSignalId);
+            g_signal_handler_disconnect(pEntry, m_nEntryFocusInSignalId);
             g_signal_handler_disconnect(pEntry, m_nEntryFocusOutSignalId);
         }
         else


More information about the Libreoffice-commits mailing list