changed window fullscreen data type to keep compatibility with hyprland v0.42.0 and greater

This commit is contained in:
Milarin 2024-08-15 12:42:07 +02:00
parent f7662457a9
commit 3503da411f

View File

@ -3,30 +3,40 @@ package hypr
import "encoding/json" import "encoding/json"
type Window struct { type Window struct {
Address string `json:"address"` Address string `json:"address"`
Mapped bool `json:"mapped"` Mapped bool `json:"mapped"`
Hidden bool `json:"hidden"` Hidden bool `json:"hidden"`
At [2]int `json:"at"` At [2]int `json:"at"`
Size [2]int `json:"size"` Size [2]int `json:"size"`
Workspace WorkspaceIdent `json:"workspace"` Workspace WorkspaceIdent `json:"workspace"`
Floating bool `json:"floating"` Floating bool `json:"floating"`
MonitorID int `json:"monitor"` MonitorID int `json:"monitor"`
Class string `json:"class"` Class string `json:"class"`
Title string `json:"title"` Title string `json:"title"`
InitialClass string `json:"initialClass"` InitialClass string `json:"initialClass"`
InitialTitle string `json:"initialTitle"` InitialTitle string `json:"initialTitle"`
PID int `json:"pid"` PID int `json:"pid"`
Xwayland bool `json:"xwayland"` Xwayland bool `json:"xwayland"`
Pinned bool `json:"pinned"` Pinned bool `json:"pinned"`
Fullscreen bool `json:"fullscreen"` Fullscreen FullscreenState `json:"fullscreen"`
FullscreenMode int `json:"fullscreenMode"` FullscreenClient FullscreenState `json:"fullscreenClient"`
FakeFullscreen bool `json:"fakeFullscreen"` FakeFullscreen bool `json:"fakeFullscreen"`
Grouped []interface{} `json:"grouped"` // TODO Grouped []interface{} `json:"grouped"` // TODO
Swallowing string `json:"swallowing"` Swallowing string `json:"swallowing"`
FocusHistoryID int `json:"focusHistoryID"` FocusHistoryID int `json:"focusHistoryID"`
} }
func (w Window) String() string { func (w Window) String() string {
data, _ := json.MarshalIndent(w, "", "\t") data, _ := json.MarshalIndent(w, "", "\t")
return string(data) return string(data)
} }
type FullscreenState int
const (
FullscreenCurrent FullscreenState = -1
FullscreenNone FullscreenState = 0
FullscreenMaximize FullscreenState = 1
FullscreenFullscreen FullscreenState = 2
FullscreenMaximizeFullscreen FullscreenState = 3
)