UI Framework-1: Aura Focus and Activation
Focus and Activation
Focus and Activation are closely related.
DefinitionsFocused window - this is the window that receives keyboard input. The focused window is always or is always contained by the Active window.
Active window - this is the window that is rendered as key - i.e. the one that contains the focused element. Different platforms will render this differently and may show additional affordances e.g. a different treatment in the window switcher.
NotesA "top level" window is a window that has no parent other than window manager constructs. Think of a Chrome window.
An "activatable" window is a top level window that can be activated. Not all top level windows can be activated at any given time. For instance in Ash, if the screen is locked calling GetActivatableWindow() for a window behind the lock screen may return a window in front of the lock screen, whereas GetTopLevelWindow() will return the non-activatable toplevel behind the lock screen. For this reason GetActivatableWindow is a method most useful to the focus/activation implementation, and GetTopLevelWindow is the method most useful to general application code.
In Aura, the CoreWM library provided by Views handles focus and activation changes in the class FocusController. The FocusController implements two interfaces - aura::client::FocusClient and aura::client::ActivationClient. Every RootWindow must have an associated Focus/ActivationClient implementation associated with it, though several RootWindows can share the same implementation. For Desktop-Aura, each top level DesktopNativeWidgetAura creates a separate FocusController for the associated RootWindow. For Ash, there is a single FocusController shared by all RootWindows managed by the DisplayController.
The FocusController tracks the current active and focused windows, and sends notifications when either of these change to registered implementations of aura::client::FocusChangeObserver and aura::client::ActivationChangeObserver.
Views also tracks focus, for views::View subclasses within a views::Widget. Think of it this way. In the Aura world, an aura::Window can have focus, and can have an embedded View hierarchy via NativeWidgetAura/Widget. Within that focused aura::Window there can be an individual View that has focus, e.g. the omnibox textfield vs. a button etc. Each toplevel views::Widget has a views::FocusManager which handles View focus. It also handles things like focus traversal. Focus traversal is what happens when you press Tab. The traversal code figures out what View to focus next when you press Tab or Shift+Tab.
When a views::Widget is deactivated, its FocusManager stores the focused view in ViewStorage for restoration later. The history behind this is somewhat vestigial but the storage/restoration step is still necessary. When the Widget is later reactivated, the last focused view is refocused. This is true in both non-Aura Win32 Views and in Aura Views.
As far as what can be focused or activated in Aura, FocusController delegates to an implementation of the FocusRules interface to determine what can be focused or activated. There are different implementations for Ash (AshFocusRules) and Desktop-Aura (DesktopFocusRules). These rules enforce specifics like not activating windows behind the lock screen, etc.
|
UI Framework-1: Aura Focus and Activation的更多相关文章
- Hybrid UI framework shootout: Ionic vs. Famo.us vs. F7 vs. OnsenUI
1 Introduction In the past 2 years I’ve been working intensively on mobile applications, mostly hybr ...
- 00 - Vue3 UI Framework - 阅读辅助列表
阅读列表 01 - Vue3 UI Framework - 开始 02 - Vue3 UI Framework - 顶部边栏 03 - Vue3 UI Framework - 首页 04 - Vue3 ...
- [转]Ionic – Mobile UI Framework for PhoneGap/Cordova Developers
本文转自:http://devgirl.org/2014/01/20/ionic-mobile-ui-framework-for-phonegapcordova-developers/ Ionic i ...
- 05 - Vue3 UI Framework - Button 组件
官网基本做好了,接下来开始做核心组件 返回阅读列表点击 这里 目录准备 在项目 src 目录下创建 lib 文件夹,用来存放所有的核心组件吧.然后再在 lib 文件夹下创建 Button.vue 文件 ...
- 07- Vue3 UI Framework - Switch 组件
为了更好的提升用户体验,我们这里再做一个很常用的开关组件 switch 返回阅读列表点击 这里 需求分析 开始之前我们先做一个简单的需求分析 switch 组件应分为选中/未被选中,两种状态 可以通过 ...
- 10 - Vue3 UI Framework - Tabs 组件
标签页是非常常用的组件,接下来我们来制作一个简单的 Tabs 组件 返回阅读列表点击 这里 需求分析 我们先做一个简单的需求分析 可以选择标签页排列的方向 选中的标签页应当有下划线高亮显示 切换选中时 ...
- 01 - Vue3 UI Framework - 开始
写在前面 一年多没写过博客了,工作.生活逐渐磨平了棱角. 写代码容易,写博客难,坚持写高水平的技术博客更难. 技术控决定慢慢拾起这份坚持,用作技术学习的阶段性总结. 返回阅读列表点击 这里 开始 大前 ...
- 03 - Vue3 UI Framework - 首页
顶部边栏做完了,接下来开始做官网的首页 返回阅读列表点击 这里 创建视图文件夹 让我们先新建一个 src/views 文件夹,用来存放官网的主要视图 然后在该文件夹下新建两个 vue 文件,作为我们的 ...
- 08 - Vue3 UI Framework - Input 组件
接下来再做一个常用的组件 - input 组件 返回阅读列表点击 这里 需求分析 开始之前我们先做一个简单的需求分析 input 组件有两种类型,即 input 和 textarea 类型 当类型为 ...
随机推荐
- [JZOJ NOIP2018模拟10.20 B组]
T1:原根(math) 题目链接: http://172.16.0.132/senior/#contest/show/2532/0 题目: 题解: 一个数m原根的个数是$\phi{(\phi{(m)} ...
- 关于输入getline
此函数可读取整行,包括前导和嵌入的空格,并将其存储在字符串对象中. getline 函数如下所示: getline(cin, inputLine); 其中 cin 是正在读取的输入流,而 inputL ...
- 3DES(或称为Triple DES)是三重数据加密算法(TDEA,Triple Data Encryption Algorithm)
3DES(或称为Triple DES)是三重数据加密算法(TDEA,Triple Data Encryption Algorithm)块密码的通称.它相当于是对每个数据块应用三次DES加密算法.由于计 ...
- cmd 与 网卡(netsh 命令)
1. 通过命令提示符(cmd)命令连接 Wi-Fi 1.1 连接曾经连接过的 Wi-Fi :: 查看配置的列表(::表示注释) netsh wlan show profile :: 连接 netsh ...
- 找出在使用临时表空间的SQL
SELECT a.username, a.sid, a.serial#, a.osuser, b.tablespace, b.blocks, c.sql_text FROM v$session a, ...
- ICA(独立成分分析)笔记
ICA又称盲源分离(Blind source separation, BSS) 它假设观察到的随机信号x服从模型,其中s为未知源信号,其分量相互独立,A为一未知混合矩阵. ICA的目的是通过且仅通过观 ...
- 用jQuery设置多个css样式
$("#show_one").css({"position":"fixed","top":"0px" ...
- 在学校机房联想硬盘保护下安装Linux,并配置锐捷客户端
最近几天一直在机房里刷题,空调开着非常舒服.但是机房电脑里全是windows系统,不太好用,挺膈应人的. 一直打算换个系统,刚才终于搞定网络问题了,以后用电脑就可以爽到了. 联想硬盘保护系统下u盘安装 ...
- jQuery第四课 点击 _选项卡效果一
//鼠标移到上面是显示手型cursor:pointer jquery 的函数: siblings //兄弟节点,同胞元素 :eq()选择器选取带有指定 index 值的元素.index 值从 0 开始 ...
- jQuery第二课 点击弹出一个提示框
选择器允许您对元素组或单个元素进行操作. jQuery 选择器 在前面的章节中,我们展示了一些有关如何选取 HTML 元素的实例. 关键点是学习 jQuery 选择器是如何准确地选取您希望应用效果的元 ...