Hintergrund: Ich arbeite an einer Software namens ActivityWatch, die protokolliert, was Sie auf Ihrem Computer tun. Im Grunde ein Versuch, einige der Probleme mit zu adressieren: RescueTime, selfspy, arbtt, etc.Wie bekomme ich das aktive Fenster auf Gnome Wayland?
Eines der wichtigsten Dinge, die wir tun, protokolliert Informationen über das aktive Fenster (Klasse und Titel). In der Vergangenheit wurde dies unter Linux mit xprop und jetzt python-xlib ohne Problem durchgeführt.
Aber jetzt haben wir ein Problem: Wayland ist auf dem Vormarsch, und soweit ich sehen kann, hat Wayland keine Ahnung von einem aktiven Fenster. Daher befürchte ich, dass wir Support für jede für Wayland verfügbare Desktop-Umgebung implementieren müssen (vorausgesetzt, sie bieten die Möglichkeit, Informationen über das aktive Fenster zu erhalten).
Hoffentlich werden sie schließlich zusammenlaufen und einige gemeinsame Schnittstelle dieses zu erhalten getan haben, aber ich bin nicht meinen Atem halten ...
ich anticipating this issue waren. Aber heute haben wir unsere first user request for Wayland support von einem tatsächlichen Wayland Benutzer. Da größere Distributionen Wayland als Standard-Display-Server-Protokoll verwenden (Fedora 25 verwendet es bereits, Ubuntu wird in 17.10 wechseln, was bald kommt), wird die Situation mit der Zeit immer kritischer werden.
Relevante Themen für ActivityWatch:
- https://github.com/ActivityWatch/aw-watcher-window/issues/18
- https://github.com/ActivityWatch/activitywatch/issues/92
Es gibt auch andere Anwendungen wie ActivityWatch, die die gleiche Funktionalität (Rescuetime, arbtt, selfspy, etc.) erfordern würde, sie scheint Wayland gerade nicht zu unterstützen und ich kann keine Details darüber finden, dass sie das planen.
Ich bin jetzt daran interessiert, die Unterstützung für Gnome zu implementieren, um mit anzufangen und mit anderen zu folgen, während der Pfad klarer wird.
Eine ähnliche Frage Weston betreffend wurde hier gefragt: get the list of active windows in wayland weston
Edit: ich in #wayland auf Freenode fragte, bekam folgende Antwort:
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 :)
Edit 2: meldete enhancement issue in the Gnome bugtracker.
tl; dr: Wie bekomme ich das aktive Fenster auf Gnome bei der Verwendung von Wayland?
Auf den ersten Blick sieht das gut aus. Ich kann das jetzt nicht testen, aber laut [der Dokumentation zu 'screen_get_default'] (https://developer.gnome.org/libwnck/stable/WnckScreen.html#wnck-screen-get-default):" This kann NULL zurückgeben, wenn nicht auf X11. " Ich bremse meinen Optimismus für jetzt ... – erb
Dies ist die Warnung, die 'Wnck.Screen.get_default()' gibt: '(.: 9342): Wnck-WARNUNG **: libwnck ist entworfen, um nur in X11 zu arbeiten , keine gültige Anzeige gefunden – sebix