[gnome-shell/wip/carlosg/im-candidates-paging] ibusCandidatePopup: Make pagination buttons clickable without stealing focus




commit d0672c54d4b7237b5bd74c6e473f9f48ed18f53f
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Sep 20 17:40:10 2022 +0200

    ibusCandidatePopup: Make pagination buttons clickable without stealing focus
    
    The default StButton event handlers will create a temporary grab that will
    steal the keyboard focus out of the client, and cause it to pop down the
    candidates window.
    
    Avoid the default grabbing behavior, so that focus stays on the Wayland
    client while interacting with the ibusCandidatesPopup with the pointer.
    
    Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2244

 js/ui/ibusCandidatePopup.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/ibusCandidatePopup.js b/js/ui/ibusCandidatePopup.js
index 6d7c0e0fa9..bb771bd38e 100644
--- a/js/ui/ibusCandidatePopup.js
+++ b/js/ui/ibusCandidatePopup.js
@@ -69,11 +69,13 @@ var CandidateArea = GObject.registerClass({
 
         this.add(this._buttonBox);
 
-        this._previousButton.connect('clicked', () => {
+        this._previousButton.connect('button-press-event', () => {
             this.emit('previous-page');
+            return Clutter.EVENT_STOP;
         });
-        this._nextButton.connect('clicked', () => {
+        this._nextButton.connect('button-press-event', () => {
             this.emit('next-page');
+            return Clutter.EVENT_STOP;
         });
 
         this._orientation = -1;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]