-
Notifications
You must be signed in to change notification settings - Fork 1
/
client.go
41 lines (31 loc) · 1.1 KB
/
client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (c) 2018, Mark "Happy-Ferret" Bauermeister
//
// This software may be modified and distributed under the terms
// of the BSD license. See the LICENSE file for details.
package focus
import (
"github.com/BurntSushi/xgb/xproto"
"github.com/BurntSushi/xgbutil/xwindow"
)
// Client is the minimal implementation necessary for any particular window
// to be tracked by the focus package.
type Client interface {
Id() xproto.Window
Win() *xwindow.Window
// Called whenever the client should represent themselves as having
// the input focus.
Focused()
// Called whenever the client should represent themselves as NOT
// having the input focus.
Unfocused()
// Returns true if the client should be considered for focus.
CanFocus() bool
// Returns true if the client participates in the WM_TAKE_FOCUS
// protocol as specified by the ICCCM.
SendFocusNotify() bool
// Whatever action needs to occur before the client can accept input
// focus. (Usually showing its workspace or deiconifying.)
PrepareForFocus()
// Whether the client believes it has input focus or not.
IsActive() bool
}