Blame SOURCES/0001-apps-menu-Explicitly-set-label_actor.patch

f6a177
From c6d579383b1e3f092cc289291d8f701011d37a67 Mon Sep 17 00:00:00 2001
f6a177
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
f6a177
Date: Thu, 17 Mar 2016 17:15:38 +0100
f6a177
Subject: [PATCH] apps-menu: Explicitly set label_actor
f6a177
f6a177
For some reason orca fails to pick up the label of category items,
f6a177
so set the label_actor explicitly as workaround.
f6a177
---
f6a177
 extensions/apps-menu/extension.js | 8 ++++++--
f6a177
 1 file changed, 6 insertions(+), 2 deletions(-)
f6a177
f6a177
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
f6a177
index 5067b63..49a05c7 100644
f6a177
--- a/extensions/apps-menu/extension.js
f6a177
+++ b/extensions/apps-menu/extension.js
f6a177
@@ -7,61 +7,63 @@ const Shell = imports.gi.Shell;
f6a177
 const St = imports.gi.St;
f6a177
 const Clutter = imports.gi.Clutter;
f6a177
 const Main = imports.ui.main;
f6a177
 const Meta = imports.gi.Meta;
f6a177
 const PanelMenu = imports.ui.panelMenu;
f6a177
 const PopupMenu = imports.ui.popupMenu;
f6a177
 const Gtk = imports.gi.Gtk;
f6a177
 const GLib = imports.gi.GLib;
f6a177
 const Gio = imports.gi.Gio;
f6a177
 const Signals = imports.signals;
f6a177
 const Pango = imports.gi.Pango;
f6a177
 
f6a177
 const Gettext = imports.gettext.domain('gnome-shell-extensions');
f6a177
 const _ = Gettext.gettext;
f6a177
 
f6a177
 const ExtensionUtils = imports.misc.extensionUtils;
f6a177
 const Me = ExtensionUtils.getCurrentExtension();
f6a177
 const Convenience = Me.imports.convenience;
f6a177
 
f6a177
 const appSys = Shell.AppSystem.get_default();
f6a177
 
f6a177
 const APPLICATION_ICON_SIZE = 32;
f6a177
 const HORIZ_FACTOR = 5;
f6a177
 const MENU_HEIGHT_OFFSET = 132;
f6a177
 const NAVIGATION_REGION_OVERSHOOT = 50;
f6a177
 
f6a177
 class ActivitiesMenuItem extends PopupMenu.PopupBaseMenuItem {
f6a177
     constructor(button) {
f6a177
         super();
f6a177
         this._button = button;
f6a177
-        this.actor.add_child(new St.Label({ text: _("Activities Overview") }));
f6a177
+        let label = new St.Label({ text: _("Activities Overview") });
f6a177
+        this.actor.add_child(label);
f6a177
+        this.actor.label_actor = label;
f6a177
     }
f6a177
 
f6a177
     activate(event) {
f6a177
         this._button.menu.toggle();
f6a177
         Main.overview.toggle();
f6a177
         super.activate(event);
f6a177
     }
f6a177
 };
f6a177
 
f6a177
 class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem {
f6a177
     constructor(button, app) {
f6a177
         super();
f6a177
         this._app = app;
f6a177
         this._button = button;
f6a177
 
f6a177
         this._iconBin = new St.Bin();
f6a177
         this.actor.add_child(this._iconBin);
f6a177
 
f6a177
         let appLabel = new St.Label({ text: app.get_name(), y_expand: true,
f6a177
                                       y_align: Clutter.ActorAlign.CENTER });
f6a177
         this.actor.add_child(appLabel);
f6a177
         this.actor.label_actor = appLabel;
f6a177
 
f6a177
         let textureCache = St.TextureCache.get_default();
f6a177
         let iconThemeChangedId = textureCache.connect('icon-theme-changed',
f6a177
                                                       this._updateIcon.bind(this));
f6a177
         this.actor.connect('destroy', () => {
f6a177
             textureCache.disconnect(iconThemeChangedId);
f6a177
         });
f6a177
         this._updateIcon();
f6a177
@@ -102,61 +104,63 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem {
f6a177
     }
f6a177
 
f6a177
     getDragActor() {
f6a177
         return this._app.create_icon_texture(APPLICATION_ICON_SIZE);
f6a177
     }
f6a177
 
f6a177
     getDragActorSource() {
f6a177
         return this._iconBin;
f6a177
     }
f6a177
 
f6a177
     _updateIcon() {
f6a177
         this._iconBin.set_child(this.getDragActor());
f6a177
     }
f6a177
 };
f6a177
 
f6a177
 class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
f6a177
     constructor(button, category) {
f6a177
         super();
f6a177
         this._category = category;
f6a177
         this._button = button;
f6a177
 
f6a177
         this._oldX = -1;
f6a177
         this._oldY = -1;
f6a177
 
f6a177
         let name;
f6a177
         if (this._category)
f6a177
             name = this._category.get_name();
f6a177
         else
f6a177
             name = _("Favorites");
f6a177
 
f6a177
-        this.actor.add_child(new St.Label({ text: name }));
f6a177
+        let label = new St.Label({ text: name });
f6a177
+        this.actor.add_child(label);
f6a177
+        this.actor.label_actor = label;
f6a177
         this.actor.connect('motion-event', this._onMotionEvent.bind(this));
f6a177
     }
f6a177
 
f6a177
     activate(event) {
f6a177
         this._button.selectCategory(this._category, this);
f6a177
         this._button.scrollToCatButton(this);
f6a177
         super.activate(event);
f6a177
     }
f6a177
 
f6a177
     _isNavigatingSubmenu([x, y]) {
f6a177
         let [posX, posY] = this.actor.get_transformed_position();
f6a177
 
f6a177
         if (this._oldX == -1) {
f6a177
             this._oldX = x;
f6a177
             this._oldY = y;
f6a177
             return true;
f6a177
         }
f6a177
 
f6a177
         let deltaX = Math.abs(x - this._oldX);
f6a177
         let deltaY = Math.abs(y - this._oldY);
f6a177
 
f6a177
         this._oldX = x;
f6a177
         this._oldY = y;
f6a177
 
f6a177
         // If it lies outside the x-coordinates then it is definitely outside.
f6a177
         if (posX > x || posX + this.actor.width < x)
f6a177
             return false;
f6a177
 
f6a177
         // If it lies inside the menu item then it is definitely inside.
f6a177
         if (posY <= y && posY + this.actor.height >= y)
f6a177
-- 
f6a177
2.17.1
f6a177