Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions actions/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ var ActionRegistry = map[string]func() Action{
"FullscreenWindow": func() Action { return &FullscreenWindow{AName: AName{Name: "FullscreenWindow"}} },
"LoadConfigFile": func() Action { return &LoadConfigFile{AName: AName{Name: "LoadConfigFile"}} },
"MaximizeColumn": func() Action { return &MaximizeColumn{AName: AName{Name: "MaximizeColumn"}} },
"MaximizeWindowToEdges": func() Action { return &MaximizeWindowToEdges{AName: AName{Name: "MaximizeWindowToEdges"}} },
"MoveColumnLeft": func() Action { return &MoveColumnLeft{AName: AName{Name: "MoveColumnLeft"}} },
"MoveColumnLeftOrToMonitorLeft": func() Action {
return &MoveColumnLeftOrToMonitorLeft{AName: AName{Name: "MoveColumnLeftOrToMonitorLeft"}}
Expand Down
8 changes: 8 additions & 0 deletions actions/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,14 @@ type MaximizeColumn struct {
AName
}

// MaximizeWindowToEdges toggles the maximized-to-edges state of the focused window.
type MaximizeWindowToEdges struct {
AName

// ID of the window to maximize.
ID uint64 `json:"id,omitempty"`
}

// SetColumnWidth changes the width of the focused column.
type SetColumnWidth struct {
AName
Expand Down
2 changes: 2 additions & 0 deletions events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,10 @@ var EventRegistry = map[string]func() Event{
"KeyboardLayoutSwitched": func() Event { return &KeyboardLayoutSwitched{EName: EName{Name: "KeyboardLayoutSwitched"}} },
"KeyboardLayoutsChanged": func() Event { return &KeyboardLayoutsChanged{EName: EName{Name: "KeyboardLayoutsChanged"}} },
"OverviewOpenedOrClosed": func() Event { return &OverviewOpenedOrClosed{EName: EName{Name: "OverviewOpenedOrClosed"}} },
"ScreenshotCaptured": func() Event { return &ScreenshotCaptured{EName: EName{Name: "ScreenshotCaptured"}} },
"WindowClosed": func() Event { return &WindowClosed{EName: EName{Name: "WindowClosed"}} },
"WindowFocusChanged": func() Event { return &WindowFocusChanged{EName: EName{Name: "WindowFocusChanged"}} },
"WindowFocusTimestampChanged": func() Event { return &WindowFocusTimestampChanged{EName: EName{Name: "WindowFocusTimestampChanged"}} },
"WindowLayoutsChanged": func() Event { return &WindowLayoutsChanged{EName: EName{Name: "WindowLayoutsChanged"}} },
"WindowOpenedOrChanged": func() Event { return &WindowOpenedOrChanged{EName: EName{Name: "WindowOpenedOrChanged"}} },
"WindowUrgencyChanged": func() Event { return &WindowUrgencyChanged{EName: EName{Name: "WindowUrgencyChanged"}} },
Expand Down
38 changes: 38 additions & 0 deletions events/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,41 @@ type ConfigLoaded struct {
// fails.
Failed bool `json:"failed"`
}

// ScreenshotCaptured when a screenshot was captured.
type ScreenshotCaptured struct {
EName
// Path indicates the file path where the screenshot was saved, if it was written to disk.
//
// If None, the screenshot was wither only copied to the clipboard, or the path couldn't be
// converted to a String (e.g. contained invalid UTF-8 bytes).
Path string `json:"path,omitempty"`
}

// Timestamp is a moment in time
type Timestamp struct {
// Secs is the number of whole seconds.
Secs uint64 `json:"secs,omitempty"`
// Nanos is the fractional part of the timestamp in nanoseconds.
Nanos uint32 `json:"nanos,omitempty"`
}

// WindowFocusTimestampChanged when the window focus timestamp changed.
//
// This event is separate from WindowFocusChanged because the focus timestamp only updates after some
// debounce time so that quick window switching doesn't mark intermediate windows as recently focused.
type WindowFocusTimestampChanged struct {
EName
// Id is the window ID.
ID uint64 `json:"id"`
// FocusTimestamp is the new focus timestamp.
FocusTimestamp Timestamp `json:"focus_timestamp"`
}

// GetPossibleKeys extracts the window ID from this event.
func (w WindowFocusTimestampChanged) GetPossibleKeys() models.PossibleKeys {
return models.PossibleKeys{
ID: w.ID,
WindowID: w.ID,
}
}