Merge pull request #88 from cherti/no_focus_only

Implement no_focus_only-property for tags
This commit is contained in:
Emmanuel Lepage Vallée 2019-02-01 13:31:48 -05:00 committed by GitHub
commit bafe3b6bf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -126,6 +126,10 @@ Similar to `no_focus_stealing_in`. If a tag enable this, then the tag will stay
selected no matter what event happen. This is useful for video games and video
players.
**no_tag_deselect:**
When a new client is added somewhere, that tag gets selected in addition to the
current selection of tags instead of being selected solely.
**no_autofocus:**
When a class has this flag, then new clients wont be focused when they are
launched. This is useful for download managers or background terminals tasks.
@ -277,6 +281,7 @@ Then edit this section to fit your needs.
| **master_count** | Number of master clients | number |
| **no_focus_stealing_in** | Do not select this tag when a new client is added | boolean |
| **no_focus_stealing_out** | Do not unselect when a new client is added elsewhere | boolean |
| **no_tag_deselect** | Do not unselect other tags spawning/selecting this | boolean |
| **screen** | Tag screen(s) | number or array |
| **selected** | Select when created | boolean |
| **volatile** | Destroy when the last client is closed | boolean |

View File

@ -114,7 +114,12 @@ function module.focus_client(c,properties)
local tags = c:tags()
if #tags > 0 and not has_selected(tags, c.screen) and not tags[1].no_focus_stealing_in then
c:tags()[1]:view_only()
local t = c:tags()[1]
if t.no_tag_deselect then
t.selected = true
else
t:view_only()
end
end
capi.client.focus = c