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

feat: handle createworkspacev2 #242

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

xabufr
Copy link

@xabufr xabufr commented Jun 18, 2024

Handle createworkspacev2

I've also fixed some tests, and added some tests for events parsing, and done some refactoring.

Related to #193

Copy link
Member

@yavko yavko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've already implemented this locally and was going to push my changes soon, so I can't really accept this PR, if you could instead keep all the tests and derive additions only that would work.

@xabufr
Copy link
Author

xabufr commented Jun 19, 2024

Ok I'll wait for your changes and then rebase this branch to keep tests ;)

@fr13ndxd
Copy link

fr13ndxd commented Aug 9, 2024

Whats the status on this? its been 2 months @yavko

@yavko
Copy link
Member

yavko commented Sep 3, 2024

Whats the status on this? its been 2 months @yavko

Its been added in #177 along with various rewrites and refactors. Testing would be really helpful so I can get this update out faster.

@fr13ndxd
Copy link

fr13ndxd commented Sep 4, 2024

@yavko just ported my stuff to the add-events branch and everything seems to work fine, will let you know if theres any bug/issue.

@yavko
Copy link
Member

yavko commented Sep 4, 2024

Great

@fr13ndxd
Copy link

fr13ndxd commented Sep 7, 2024

use hyprland::event_listener::EventListener;

fn main() {
    let mut listener = EventListener::new();

    listener.add_workspace_changed_handler(|ws| {
        println!("{}", ws.id);
    });

    listener.start_listener().unwrap();
}

seems to panic (only when i open new window) with:

thread 'main' panicked at src/main.rs:10:31:
called `Result::unwrap()` on an `Err` value: Internal("could not get the event arg of index 1")

im on on hyprland commit b0fca6eaf00a2c5061f499c76ec8d60772b6a719

@yavko
Copy link
Member

yavko commented Sep 7, 2024

use hyprland::event_listener::EventListener;

fn main() {
    let mut listener = EventListener::new();

    listener.add_workspace_changed_handler(|ws| {
        println!("{}", ws.id);
    });

    listener.start_listener().unwrap();
}

seems to panic (only when i open new window) with:

thread 'main' panicked at src/main.rs:10:31:
called `Result::unwrap()` on an `Err` value: Internal("could not get the event arg of index 1")

im on on hyprland commit b0fca6eaf00a2c5061f499c76ec8d60772b6a719

r u using this PR, or maaster?

@fr13ndxd
Copy link

fr13ndxd commented Sep 8, 2024

@yavko im using the add-events branch

@yavko
Copy link
Member

yavko commented Sep 10, 2024

@yavko im using the add-events branch

i see, can you provide a stack trace?

@fr13ndxd
Copy link

i see, can you provide a stack trace?

there you go

thread 'main' panicked at src/main.rs:10:31:
called `Result::unwrap()` on an `Err` value: Internal("could not get the event arg of index 1")
stack backtrace:
   0:     0x56225f6d3c05 - std::backtrace_rs::backtrace::libunwind::trace::h23054e327d0d4b55
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x56225f6d3c05 - std::backtrace_rs::backtrace::trace_unsynchronized::h0cc587407d7f7f64
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x56225f6d3c05 - std::sys_common::backtrace::_print_fmt::h4feeb59774730d6b
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x56225f6d3c05 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd736fd5964392270
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x56225f6f100b - core::fmt::rt::Argument::fmt::h105051d8ea1ade1e
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/fmt/rt.rs:165:63
   5:     0x56225f6f100b - core::fmt::write::hc6043626647b98ea
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/fmt/mod.rs:1168:21
   6:     0x56225f6d1adf - std::io::Write::write_fmt::h0d24b3e0473045db
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/io/mod.rs:1835:15
   7:     0x56225f6d39de - std::sys_common::backtrace::_print::h62df6fc36dcebfc8
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x56225f6d39de - std::sys_common::backtrace::print::h45eb8174d25a1e76
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x56225f6d4d79 - std::panicking::default_hook::{{closure}}::haf3f0170eb4f3b53
  10:     0x56225f6d4b1a - std::panicking::default_hook::hb5d3b27aa9f6dcda
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:298:9
  11:     0x56225f6d5213 - std::panicking::rust_panic_with_hook::h6b49d59f86ee588c
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:795:13
  12:     0x56225f6d50f4 - std::panicking::begin_panic_handler::{{closure}}::hd4c2f7ed79b82b70
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:664:13
  13:     0x56225f6d40c9 - std::sys_common::backtrace::__rust_end_short_backtrace::h2946d6d32d7ea1ad
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:171:18
  14:     0x56225f6d4e27 - rust_begin_unwind
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:652:5
  15:     0x56225f67e063 - core::panicking::panic_fmt::ha02418e5cd774672
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/panicking.rs:72:14
  16:     0x56225f67e556 - core::result::unwrap_failed::h55f86ada3ace5ed2
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/result.rs:1679:5
  17:     0x56225f68094d - core::result::Result<T,E>::unwrap::h212ba8991a3f0418
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/result.rs:1102:23
  18:     0x56225f68094d - rust_hyprlandrs::main::he865cdbd38b005e6
                               at /home/fr13nd/Desktop/rust-hyprlandrs/src/main.rs:10:5
  19:     0x56225f67eebb - core::ops::function::FnOnce::call_once::h4b4b677a7f1825c4
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/ops/function.rs:250:5
  20:     0x56225f68053e - std::sys_common::backtrace::__rust_begin_short_backtrace::hb6fbc949a3d59357
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:155:18
  21:     0x56225f680511 - std::rt::lang_start::{{closure}}::h526a86ce15e04f9b
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/rt.rs:159:18
  22:     0x56225f6ceedd - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hf57beef1b8c334ce
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/ops/function.rs:284:13
  23:     0x56225f6ceedd - std::panicking::try::do_call::h65791b6ab5d9b39f
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:559:40
  24:     0x56225f6ceedd - std::panicking::try::h5a3dd25e8a379a23
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:523:19
  25:     0x56225f6ceedd - std::panic::catch_unwind::he2ce8403bab77de2
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panic.rs:149:14
  26:     0x56225f6ceedd - std::rt::lang_start_internal::{{closure}}::h0b55d0da19178545
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/rt.rs:141:48
  27:     0x56225f6ceedd - std::panicking::try::do_call::h33cbeb674c7644e0
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:559:40
  28:     0x56225f6ceedd - std::panicking::try::h530c58b4c9daadba
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:523:19
  29:     0x56225f6ceedd - std::panic::catch_unwind::h92e02677901e11e4
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panic.rs:149:14
  30:     0x56225f6ceedd - std::rt::lang_start_internal::hcee5ed89fc25829a
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/rt.rs:141:20
  31:     0x56225f6804ea - std::rt::lang_start::h9b1264cc574b0611
                               at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/rt.rs:158:17
  32:     0x56225f6809ee - main
  33:     0x7fcc9f78c14e - __libc_start_call_main
  34:     0x7fcc9f78c209 - __libc_start_main@@GLIBC_2.34
  35:     0x56225f67e955 - _start

@yavko
Copy link
Member

yavko commented Sep 15, 2024

Okay, ig ill just spin up a VM, to run hyprland, cuz i need a debugger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants