How do I get the active window on Gnome Wayland?

前端 未结 3 617
春和景丽
春和景丽 2020-12-24 12:38

Background: I\'m working on a piece of software called ActivityWatch that logs what you do on your computer. Basically an attempt at addressing some of the

3条回答
  •  独厮守ぢ
    2020-12-24 13:01

    In my opinion the best choice you have is not Wayland or any available library (there are not one). Actually who know in gnome-wayland about the active windows is Mutter, so you need to find a way to ask to Mutter the active windows. Gnome can develop an API to internally ask to mutter the active window and restore the functionality. But really, you don't have a place to ask for it. Mutter will not develop an API to access to his internal representation, because this will be pretty specific of Mutter only and not to all Wayland windows manager. So this need to be added to an external library, where this library could talk probably with the current window manager that it's in use to resolve your request in a general way.

    Another possibility is add a Wayland plugin where all windows manager will have a way to share the current active windows and in some way a library to talk directly with wayland to restore the functionality.

    So, your app is in a big problem. Most you can do is request this on mutter (where is know the active windows), but in my opinion it can not be resolved in Mutter.

    I hope this will help you and you can find a way. Good luck.

提交回复
热议问题