Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client::get_active() doesn't work #124

Closed
c0h2r opened this issue Oct 4, 2023 · 8 comments · Fixed by #161
Closed

Client::get_active() doesn't work #124

c0h2r opened this issue Oct 4, 2023 · 8 comments · Fixed by #161
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@c0h2r
Copy link
Contributor

c0h2r commented Oct 4, 2023

Calling the method with an active window present results in smth like that:

[src/main.rs:210] Client::get_active() = Err(
    SerdeError(
        Error("data did not match any variant of untagged enum Aux", line: 0, column: 0),
    ),
)

And when there's none, everything works fine:

[src/main.rs:210] Client::get_active() = Ok(
    None,
)

Attempts at debugging showed that the problem is with trying to deserialize json into ActiveWindow. Maybe it'd be easier to manually check if the result [edit: of the ipc call] is empty instead of doing that proxy struct thingy?

In case of inability to replicate: I'm on NixOS, and hyprctl version says

hyprctl version
Hyprland, built from branch  at commit v0.30.0  ().
Tag: ?

flags: (if any)
debug

Also, if I manually feed serde with an output of hyprctl activewindow -j, it is able to parse the output into structs provided by the crate.

[edit: Also^2: the data variable right before parsing looks fine when printed from rust-gdb.]
[edit: just in case, here's an asciinema recording]

@vars1ty
Copy link
Contributor

vars1ty commented Oct 25, 2023

@yavko ?

@H3rmt
Copy link
Contributor

H3rmt commented Oct 25, 2023

I checked against some recent commits and found that this commit broke serializing the json into ActiveWindow

seems like i64 is the correct type for monitor-ids

Here is a history which commits are broken:


# Error: SerdeError(Error("data did not match any variant of untagged enum Aux", line: 0, column: 0))
#hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", rev = "0c35ba168a11be61820da3ac7f4b9e499d232b33" }

# working fine
#hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", rev = "597720809b1c92b25eb4eb71c04e673560ae673c" }

# Error: SerdeError(Error("data did not match any variant of untagged enum Aux", line: 0, column: 0))
#hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", rev = "4580068e32a13a29ef03730158e7e8b7b30c14f1" }

# working fine
#hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", rev = "fe7e4ee945ba905499b8216ced674f22447ce16a" }

# Error: SerdeError(Error("invalid value: integer `-1`, expected u64", line: 12, column: 17))
#hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", rev = "e58d6e2798e41ca0e42c3e9455d65ddd1eba5153" }

# working fine
#hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", rev = "aae818caaf35730ac6188a18a0157ee62bf636b8" }

# Error: SerdeError(Error("invalid value: integer `-1`, expected u64", line: 12, column: 17))
#hyprland = { git = "https://github.com/hyprland-community/hyprland-rs",rev = "12afa388e5326c2f9cf7b44009a545d3f37c3779"}

# working fine
#hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", rev = "bc61818e5a9a41b4bef174b37124325365008294" }

@yavko
Copy link
Member

yavko commented Oct 26, 2023

Omg how did I never get notified about this issue....

@yavko
Copy link
Member

yavko commented Oct 26, 2023

I checked against some recent commits and found that this commit broke serializing the json into ActiveWindow

seems like i64 is the correct type for monitor-ids

Here is a history which commits are broken:


# Error: SerdeError(Error("data did not match any variant of untagged enum Aux", line: 0, column: 0))
#hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", rev = "0c35ba168a11be61820da3ac7f4b9e499d232b33" }

# working fine
#hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", rev = "597720809b1c92b25eb4eb71c04e673560ae673c" }

# Error: SerdeError(Error("data did not match any variant of untagged enum Aux", line: 0, column: 0))
#hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", rev = "4580068e32a13a29ef03730158e7e8b7b30c14f1" }

# working fine
#hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", rev = "fe7e4ee945ba905499b8216ced674f22447ce16a" }

# Error: SerdeError(Error("invalid value: integer `-1`, expected u64", line: 12, column: 17))
#hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", rev = "e58d6e2798e41ca0e42c3e9455d65ddd1eba5153" }

# working fine
#hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", rev = "aae818caaf35730ac6188a18a0157ee62bf636b8" }

# Error: SerdeError(Error("invalid value: integer `-1`, expected u64", line: 12, column: 17))
#hyprland = { git = "https://github.com/hyprland-community/hyprland-rs",rev = "12afa388e5326c2f9cf7b44009a545d3f37c3779"}

# working fine
#hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", rev = "bc61818e5a9a41b4bef174b37124325365008294" }

I can't decide on what type to use for that damn field. People keep submitting pull requests that "fix" it, but only fix it for them. Honestly, I can't even debug this as I'm temporarily not on linux. So I need someone else to figure this out for me

@yavko yavko added the help wanted Extra attention is needed label Oct 26, 2023
@yavko yavko pinned this issue Oct 26, 2023
@yavko yavko added the bug Something isn't working label Oct 26, 2023
donovanglover added a commit to donovanglover/hyprnome that referenced this issue Oct 27, 2023
H3rmt added a commit to H3rmt/hyprland-rs that referenced this issue Jan 25, 2024
fixing hyprland-community#124 (Client::get_active() doesn't work)
@H3rmt
Copy link
Contributor

H3rmt commented Jan 31, 2024

this is a known bug with serde (serde-rs/serde#1682)

@yavko yavko unpinned this issue Feb 1, 2024
@H3rmt
Copy link
Contributor

H3rmt commented Feb 1, 2024

Hi @yavko, when is the next release scheduled?
I'm currently stuck on hyprland=0.3.11, but I would like to use focus_history_id. (00505b0) (H3rmt/hyprswitch#5)

@yavko
Copy link
Member

yavko commented Feb 1, 2024

I'll create a new release when I get home

@yavko
Copy link
Member

yavko commented Feb 3, 2024

Hi @yavko, when is the next release scheduled?
I'm currently stuck on hyprland=0.3.11, but I would like to use focus_history_id. (00505b0) (H3rmt/hyprswitch#5)

There was a release yesterday btw

H3rmt added a commit to H3rmt/hyprland-rs that referenced this issue Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants