From 3503da411f5130ea84b210f94c9092e0b8756910 Mon Sep 17 00:00:00 2001 From: Milarin Date: Thu, 15 Aug 2024 12:42:07 +0200 Subject: [PATCH] changed window fullscreen data type to keep compatibility with hyprland v0.42.0 and greater --- model_window.go | 52 +++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/model_window.go b/model_window.go index 53d8ce9..c2429d8 100644 --- a/model_window.go +++ b/model_window.go @@ -3,30 +3,40 @@ package hypr import "encoding/json" type Window struct { - Address string `json:"address"` - Mapped bool `json:"mapped"` - Hidden bool `json:"hidden"` - At [2]int `json:"at"` - Size [2]int `json:"size"` - Workspace WorkspaceIdent `json:"workspace"` - Floating bool `json:"floating"` - MonitorID int `json:"monitor"` - Class string `json:"class"` - Title string `json:"title"` - InitialClass string `json:"initialClass"` - InitialTitle string `json:"initialTitle"` - PID int `json:"pid"` - Xwayland bool `json:"xwayland"` - Pinned bool `json:"pinned"` - Fullscreen bool `json:"fullscreen"` - FullscreenMode int `json:"fullscreenMode"` - FakeFullscreen bool `json:"fakeFullscreen"` - Grouped []interface{} `json:"grouped"` // TODO - Swallowing string `json:"swallowing"` - FocusHistoryID int `json:"focusHistoryID"` + Address string `json:"address"` + Mapped bool `json:"mapped"` + Hidden bool `json:"hidden"` + At [2]int `json:"at"` + Size [2]int `json:"size"` + Workspace WorkspaceIdent `json:"workspace"` + Floating bool `json:"floating"` + MonitorID int `json:"monitor"` + Class string `json:"class"` + Title string `json:"title"` + InitialClass string `json:"initialClass"` + InitialTitle string `json:"initialTitle"` + PID int `json:"pid"` + Xwayland bool `json:"xwayland"` + Pinned bool `json:"pinned"` + Fullscreen FullscreenState `json:"fullscreen"` + FullscreenClient FullscreenState `json:"fullscreenClient"` + FakeFullscreen bool `json:"fakeFullscreen"` + Grouped []interface{} `json:"grouped"` // TODO + Swallowing string `json:"swallowing"` + FocusHistoryID int `json:"focusHistoryID"` } func (w Window) String() string { data, _ := json.MarshalIndent(w, "", "\t") return string(data) } + +type FullscreenState int + +const ( + FullscreenCurrent FullscreenState = -1 + FullscreenNone FullscreenState = 0 + FullscreenMaximize FullscreenState = 1 + FullscreenFullscreen FullscreenState = 2 + FullscreenMaximizeFullscreen FullscreenState = 3 +)