Commit 88563ec7 authored by mjash's avatar mjash Committed by Florian Müllner

serverRoomManager: Fix double-toggling of checkboxes

As activating a checkbox via keyboard navigation does not emit
the ::row-activated signal, we need to handle ::toggled as well.
However as clicking a row will emit both signals, we currently
end up toggling the checkbox twice in that case (that is, back
to its original state). Address this by only handling ::toggled
in response to keyboard events.

https://bugzilla.gnome.org/show_bug.cgi?id=782969
parent 4741eb5c
const GLib = imports.gi.GLib;
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
const Gdk = imports.gi.Gdk;
const Pango = imports.gi.Pango;
const Tp = imports.gi.TelepathyGLib;
......@@ -189,7 +190,10 @@ const ServerRoomList = new Lang.Class({
});
this._toggleRenderer.connect('toggled', (cell, pathStr) => {
this._toggleChecked(Gtk.TreePath.new_from_string(pathStr));
// For pointer devices, ::row-activated is emitted as well
let dev = Gtk.get_current_event_device();
if (dev && dev.input_source == Gdk.InputSource.KEYBOARD)
this._toggleChecked(Gtk.TreePath.new_from_string(pathStr));
});
this._manager = getDefault();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment