Skip to content

Wayland support #92

Closed
Closed

Description

@vith

Wayland is now the default display server on some popular distros such as Fedora 25.

It would be great if ActivityWatch worked on Wayland!

On v0.7.0b1 I just get this log line repeatedly:

2017-08-02 09:35:59,457 [WARNING]: Failed to find active window, id found was 0x0 (aw_watcher_window.lib:19)


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Activity

  1. ErikBjare commented on Aug 2, 2017

    @ErikBjare
    Member

    I've been anticipating this... See this issue: ActivityWatch/aw-watcher-window#18

    Unfortunately, I'm not sure how to solve this. It seems like we can't have Wayland-support since Wayland itself doesn't have any notion of active window.

    Are you using Gnome? I'd be interested in getting this working on Gnome or some other large desktop environment with Wayland support to start with and then see how we should go from there.

    Edit: It seems Gnome is deprecating their get_active_window API which only ever worked on X11. Will investigate further.

    Edit 2: Done quite a few searches but have come up emptyhanded. Considering asking a question on Stack Exchange and/or sending a mail to some Gnome mailinglist.

  2. vith commented on Aug 2, 2017

    @vith
    Author

    Ah, that does complicate things.

    Yep, I'm using Gnome on Arch Linux actually. ActivityWatch is the only thing keeping me using the Gnome on Xorg session.

  3. ErikBjare commented on Aug 2, 2017

    @ErikBjare
    Member

    Created a question on Stack Overflow, will try to find someone on IRC to help.

    Edit: Also asked on the Gnome IRC, seems a bit quiet right now.

    Edit: Has now been ~20h since I asked, no one replied to me in that channel. Might want to try a mailinglist further down the line.

  4. ErikBjare commented on Aug 3, 2017

    @ErikBjare
    Member

    Alright, just asked in the #wayland channel on Freenode. Got a response at least, but the situation seems pretty bad.

    15:20:44  ErikBjare    Hello everybody. I'm working on a piece of self-tracking software called ActivityWatch (https://github.com/ActivityWatch/activitywatch). I know this isn't exactly the right place to ask, but I was wondering if anyone knew anything about getting the active window in any Wayland-using DE.
    15:20:57  ErikBjare    Created a question on SO: https://stackoverflow.com/questions/45465016/how-do-i-get-the-active-window-on-gnome-wayland
    15:21:25  ErikBjare    Here's the issue in my repo for it: https://github.com/ActivityWatch/activitywatch/issues/92
    15:22:54  ErikBjare    There are a bunch of other applications that depend on it (RescueTime, selfspy, arbtt, ulogme, etc.) so they'd need it as well
    15:24:23  blocage      ErikBjare, in the core protocol you cannot know which windnow has the keyboard or cursor focus
    15:24:39  blocage      ErikBjare, in the wayland core protocol *
    15:25:10  blocage      ErikBjare, you can just know if your window has the focus or not, it a design choise
    15:25:23  blocage      avoid client spying each other
    15:25:25  ErikBjare    blocage: I'm aware, that's my reason for concern. I'm not saying it should be included or anything, but as it looks now every DE would need to implement it themselves if these kind of applications are to be supported
    15:25:46  ErikBjare    So wondering if anyone knew the teams working with Wayland on Gnome for example
    15:26:11  ErikBjare    But thanks for confirming
    15:26:29  blocage      ErikBjare, DE should create a custom extension, or use D-bus or other IPC
    15:27:31  blocage      ErikBjare, I guess some compositor are around here, but I do not know myself if there is such extension already
    15:27:44  blocage      compositor developers *
    15:28:36  ErikBjare    I don't think there is (I've done quite a bit of searching), so I guess I need to catch the attention of some DE developers
    15:29:16  ErikBjare    Thanks a lot though
    15:29:42  ErikBjare    blocage: Would you mind if I shared logs of our conversation in the issue?                                     
    15:30:05  blocage      just use it :) it's public                                                                                               
    15:30:19  ErikBjare    ty :)                                                                                                            
    

    I guess our only option is to contact some DE developers and petition them to create a way to get the info.

  5. ErikBjare commented on Aug 15, 2017

    @ErikBjare
    Member

    @osule Unfortunately that won't work. That Gnome API is X11 only (that's why its deprecated) and that thing you found in weston is just xwayland.

    Wayland has no concept of active window, and Gnome has no internal concept of it that it exposes. The reasons for this seems to be privacy as blocage mentioned in the IRC convo I pasted.

  6. ErikBjare commented on Oct 4, 2017

    @ErikBjare
    Member
  7. Awerick commented on Nov 8, 2017

    @Awerick

    Hi @ErikBjare, I stumbled upon this issue while searching for a related problem.

    Excuse me, in case this is completely off track but I just came across the "Wayland Security Module" ("WSM", see below for links) and thought, this might be interesting / relevant for this issue as well:
    Its a proposal for a standardized, secure way to let programs perform "sensitive" tasks under Wayland (if the Desktop Environments/Wayland compositors would support the WSM).
    Maybe long-term this could also be a solution for this issue of "getting the active window under Wayland".

    More info on Wayland Security Module:
    X.Org Presentation 2014 ; official GitHub repo ; Wikipedia: Wayland#WSM

  8. ErikBjare commented on Nov 9, 2017

    @ErikBjare
    Member

    @Awerick Thanks a lot for reaching out!

    WSM looks like a great initiative, and I had no idea it existed. It's probably the closest thing to a solution I've seen so far. Let's hope there is interest in it from the Wayland community, I might try prodding them in the future and see if they have considered our usecase 🙂

  9. 52 remaining items

  10. 2e3s commented on Dec 4, 2025

    @2e3s

    The first link for this: Wayland: An Accessibility Nightmare, with lots of philosophical talks and workarounds. Getting a few bits of an active window's metadata seems like a much easier goal than a consistent a11y support.

  11. Aneeqasif commented on Feb 20, 2026

    @Aneeqasif

    Has anyone successfully set this up on wayland? coming back to this software after about 5 years, and I am using wayland right now. Please guide.

  12. flexagoon commented on Feb 20, 2026

    @flexagoon

    Has anyone successfully set this up on wayland? coming back to this software after about 5 years, and I am using wayland right now. Please guide.

    @Aneeqasif use https://github.com/2e3s/awatcher

  13. Aneeqasif commented on Feb 20, 2026

    @Aneeqasif

    Has anyone successfully set this up on wayland? coming back to this software after about 5 years, and I am using wayland right now. Please guide.

    @Aneeqasif use https://github.com/2e3s/awatcher

    does it support niri?

  14. zocker-160 commented on Feb 20, 2026

    @zocker-160

    does it support niri?

    Any compositor which supports wlr-foreign-toplevel-management-unstable-v1 and ext-idle-notify-v1 protocols will work.

  15. real-or-random commented on Feb 23, 2026

    @real-or-random

    does it support niri?

    Any compositor which supports wlr-foreign-toplevel-management-unstable-v1 and ext-idle-notify-v1 protocols will work.

    For the record, this includes niri (though I haven't tested it on niri).

  16. beedell-roke commented on Oct 17, 2026

    @beedell-roke

    #92 (comment)

    @dework-integration, in which commit[s], and/or PR[s]?

  17. ErikBjare commented on Oct 17, 2026

    @ErikBjare
    Member

    Strange, disabling the integration.

    Edit: Done. However, Wayland support is supported in the Tauri distribution which is shipped and stable since v0.14.0, so I'm going to keep this closed. Bringing Wayland support to aw-qt is incoming.

  18. ErikBjare commented on Oct 17, 2026

    @ErikBjare
    Member

    @TimeToBuildBob I realized that system package managers for commonly Wayland systems may be tempted to only list the tauri dist if aw-qt is broken in Wayland. We should probably get ahead of this. Get on implementing Wayland support in aw-qt, should be as easy as bundling awatcher or something and adding the detection to aw-qt, or implement Wayland support proper in aw-watcher-window.

  19. TimeToBuildBob commented on Oct 17, 2026

    @TimeToBuildBob
    Contributor

    @ErikBjare Done — ActivityWatch/aw-qt#142

    aw-qt now auto-detects Wayland (WAYLAND_DISPLAY or XDG_SESSION_TYPE=wayland) and transparently substitutes aw-watcher-window + aw-watcher-afk with aw-watcher-window-wayland at startup. The default autostart_modules config is unchanged; the swap happens at runtime. If the Wayland watcher is not installed, aw-qt falls back gracefully with a warning.

    12 new unit tests, all existing tests still pass.

  20. added a commit that references this issue on Oct 18, 2026
    b0b405c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions