Codebase list gnome-shell-extension-appindicator / c88cb16
testTool: Add case simulating lots of icon and labe updates Simulate cases similar to discord application, that it sends lots updates at a very high rate. With this code gnome-shell currently hangs totally, becoming unusable. Related to #226 and #236 Marco Trevisan (TreviƱo) 3 years ago
1 changed file(s) with 16 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
196196 item = new Gtk.SeparatorMenuItem();
197197 menu.append(item);
198198
199 /* Simulate similar behavior of #226 and #236 */
200 item = Gtk.CheckMenuItem.new_with_label('Crazy icons updates');
201 item.connect('activate', (item) => {
202 if (item.get_active()) {
203 item._timeoutID = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 16, () => {
204 setRandomIconPath();
205 indicator.set_label(`${new Date().getSeconds()}`, '');
206 return GLib.SOURCE_CONTINUE;
207 });
208 } else {
209 GLib.source_remove(item._timeoutID);
210 delete item._timeoutID;
211 }
212 });
213 menu.append(item);
214
199215 item = Gtk.MenuItem.new_with_label("Hide for some time");
200216 item.connect('activate', () => {
201217 indicator.set_status(AppIndicator.IndicatorStatus.PASSIVE);