Skip to content
New issue

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

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

Already on GitHub? # to your account

wayland.idle_notify: Update to version 2 #1618

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

PolyMeilex
Copy link
Member

@jjramsey
Copy link

I found a problem when trying to compile my own fork of Niri against this fork of Smithay:

error[E0599]: no variant named `GetInputIdleNotification` found for enum `wayland_protocols::ext::idle_notify::v1::server::ext_idle_notifier_v1::Request`
   --> /niri/.cargo/git/checkouts/smithay-59e1c6e9803bea8c/d7fa8ae/src/wayland/idle_notify/mod.rs:301:44
    |
301 |             ext_idle_notifier_v1::Request::GetInputIdleNotification { id, timeout, seat } => {
    |                                            ^^^^^^^^^^^^^^^^^^^^^^^^
    |
help: there is a variant with a similar name
    |
301 |             ext_idle_notifier_v1::Request::GetIdleNotification { id, timeout, seat } => {
    |                                            ~~~~~~~~~~~~~~~~~~~

   Compiling pango v0.20.4
   Compiling pangocairo v0.20.4
For more information about this error, try `rustc --explain E0599`.
error: could not compile `smithay` (lib) due to 1 previous error

(FWIW, I'm using a modified PKGBUILD of the niri-git AUR package to do the build of Niri, which I've done before.)

My rustc version is 1.83.0.

@PolyMeilex
Copy link
Member Author

This uses patched version of wayland-rs, so perhaps try to include this in niri cargo.toml:

[patch.crates-io]
wayland-egl = { git = "https://github.com/PolyMeilex/wayland-rs.git", branch = "ext-idle-notify-2" }
wayland-protocols = { git = "https://github.com/PolyMeilex/wayland-rs.git", branch = "ext-idle-notify-2" }
wayland-protocols-wlr = { git = "https://github.com/PolyMeilex/wayland-rs.git", branch = "ext-idle-notify-2" }
wayland-protocols-misc = { git = "https://github.com/PolyMeilex/wayland-rs.git", branch = "ext-idle-notify-2" }
wayland-server = { git = "https://github.com/PolyMeilex/wayland-rs.git", branch = "ext-idle-notify-2" }
wayland-cursor = { git = "https://github.com/PolyMeilex/wayland-rs.git", branch = "ext-idle-notify-2" }
wayland-client = { git = "https://github.com/PolyMeilex/wayland-rs.git", branch = "ext-idle-notify-2" }
wayland-sys = { git = "https://github.com/PolyMeilex/wayland-rs.git", branch = "ext-idle-notify-2" }
wayland-backend = { git = "https://github.com/PolyMeilex/wayland-rs.git", branch = "ext-idle-notify-2" }
wayland-scanner = { git = "https://github.com/PolyMeilex/wayland-rs.git", branch = "ext-idle-notify-2" }

@jjramsey
Copy link

Good news and bad news: I got Niri to compile and run, but my fork of Workrave doesn't behave any differently under Niri (e.g., it still does the wrong thing when using mpv to play a video). The fork of Workrave does do the right thing with Sway using my forks of wlroots, though.

@jjramsey
Copy link

Another bit of bad news. I compiled my fork of cosmic-comp against your fork of Smithay, and my fork of Workrave has the same issues on cosmic-comp as it does on Niri.

That would seem to rule out Niri being the problem.

@PolyMeilex
Copy link
Member Author

PolyMeilex commented Dec 31, 2024

My bad, forgot to bump the version, this line should have 2 instead of 1 as a first arg:
https://github.com/PolyMeilex/smithay/blob/d7fa8aeeb6f28fb17219361f828b74350baa9d21/src/wayland/idle_notify/mod.rs#L119

Like so:

let global = display.create_global::<D, ExtIdleNotifierV1, _>(2, ());

@jjramsey
Copy link

jjramsey commented Dec 31, 2024

That tracks with my own tests. When I turned tracing on in Workrave, I saw, "Falling back to version of ext-idle-notify-v1 protocol that does not support ignoring idle inhibitors" in the trace logs under both Cosmic and Niri.

If you could put the version bump into the ext-idle-notify-2 branch, that would be great.

ETA: I just tested both Niri and Cosmic with the version bumped manually in the Smithay source, and fixing the version did the trick.

@jjramsey
Copy link

jjramsey commented Jan 2, 2025

Like so:

let global = display.create_global::<D, ExtIdleNotifierV1, _>(2, ());

Do you plan to add a commit to your ext-idle-notify-2 branch with that version bump? That would insure that this merge request has all the desired changes needed for an updated ext-idle-notify protocol to work.

@PolyMeilex
Copy link
Member Author

Should be good now

@jjramsey
Copy link

draft as version 2 is still in MR phase: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/367

FYI, version 2 just got merged. This probably doesn't need to be a draft anymore.

@jjramsey
Copy link

jjramsey commented Jan 15, 2025

I tried compiling the latest Niri source against this fork of Smithay and got several compile errors, starting with this:

error[E0432]: unresolved import `smithay::backend::drm::compositor::FrameFlags`
  --> src/backend/tty.rs:21:56
   |
21 | use smithay::backend::drm::compositor::{DrmCompositor, FrameFlags, PrimaryPlaneElement};
   |                                                        ^^^^^^^^^^ no `FrameFlags` in `backend::drm::compositor`

My guess is that your fork needs to be rebased to be based on the latest Smithay source.

ETA: I was able to compile Niri against my fork of Smithay, which is basically your ext-idle-notify updates applied to the current Smithay code. So that confirms that it's just a rebasing issue.

@PolyMeilex
Copy link
Member Author

Rebased on top of Smithay master as well as wp master. This remains in draft, awaiting the next Wayland protocols release.

@jjramsey
Copy link

FYI, the new version of wayland-protocols has just been released: https://lists.freedesktop.org/archives/wayland-devel/2025-January/043966.html

Not sure how soon this will affect things, since I gather that wayland-rs will need updating.

@ids1024
Copy link
Member

ids1024 commented Jan 30, 2025

Smithay/wayland-rs#780 updates wayland-rs to wayland-protocols 1.40.

I'm still wondering when wayland is going to do a release including wl_fixes, but wayland-rs can do a release and unblock this and #1577 (and ext-workspace-v1).

@ids1024
Copy link
Member

ids1024 commented Jan 31, 2025

wayland-protocols 0.32.6 is now released on crates.io.

@PolyMeilex PolyMeilex marked this pull request as ready for review February 1, 2025 15:42
@PolyMeilex
Copy link
Member Author

Thanks! This is ready now.

@jjramsey
Copy link

Any idea what the merge conflicts are? Offhand, I can't see them for myself.

@PolyMeilex
Copy link
Member Author

Rebased

Copy link
Member

@Drakulix Drakulix left a comment

Choose a reason for hiding this comment

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

LGTM!

@Drakulix Drakulix merged commit d4bf234 into Smithay:master Feb 12, 2025
13 checks passed
@PolyMeilex PolyMeilex deleted the ext-idle-notify-2 branch February 12, 2025 13:54
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants