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 类型 当类型为 ...
随机推荐
- node21---mongoose
01.js //引包 var mongoose = require('mongoose'); //创建一个数据库连接 mongoose.connect('mongodb://localhost/tes ...
- doT.js变量和数组混合读取方式
可以包裹任意大小的html 变量在其包裹的任意区域都有效 单个变量可以和数组分开展示 最好放置在最下方执行js 数据结构 var data = { "id": "1280 ...
- 机器翻译引擎的基本原理 ——LSTM
机器翻译引擎的基本原理 摘自:infoq 谷歌机器翻译 Zero-shot:零次 Training:训练 Google Neural Machine Translation:谷歌神经机器翻译 我们每 ...
- react-route4 按需加载配置心得
本篇文章主要记录笔者项目中使用 react-route + webpack 做路由按需加载的心得,可能只有笔者一个人看,权当日记了. 很久很久以前,react-route还是2.X和3.X版本的时 ...
- 【转】IIS初始化(预加载),解决第一次访问慢,程序池被回收问题
原地址:http://www.debugrun.com/a/mpyWXwg.html 读在最前面: 1.本文以IIS8,Windows Server 2012R2做为案例 2.IIS8 运行在 Win ...
- jQuery EasyUI 右键菜单--关闭标签/选项卡
目录结构: noContextMenu.js 文件内容如下: $(function(){ //屏蔽右键菜单 $(document).bind("contextmenu", func ...
- swift语言点评六-Numbers and Basic Values
Topics Logical Values struct Bool A value type whose instances are either true or false. Numeric Val ...
- form表单里的坑
我们在写前端表单页面的时候,为了更好的SEO,我们会使用form标签,但是我们经常的情况是:我们并不需要form标签的一些默认事件,比如: 1.form内只有一个input标签的话,回车会触发表单的提 ...
- Ncomputering 安装及参数设置
1.加域 2.添加用户:系统属性---远程
- oracle查询优化之子查询条件优化
环境:oracle 11g 现有a表与b表通过a01字段关联,要查询出a表的数据在b表没有数据的数据:sql如下 ) ) 因为flag是虚拟字段没有走不了索引导致这条sql执行起来特别慢 310W条数 ...