背景:は、私はあなたのコンピュータ上で何をすべきかをログに記録しますActivityWatchと呼ばれるソフトウェアに取り組んでいます。基本的にRescueTime、selfspy、arbttなどの問題の一部を解決しようとしています。Gnome Waylandでアクティブなウィンドウを取得するにはどうすればよいですか?
アクティブなウィンドウ(クラスとタイトル)に関するログ情報があります。これまでは、xpropを使っているLinuxや今はpython-xlibを使って問題なくこれを行っています。
しかし、私たちには問題があります: Waylandが増えていて、Waylandにはアクティブなウィンドウという概念がありません。だから私の恐れは、Waylandが利用できるすべてのデスクトップ環境のサポートを実装する必要があるということです(アクティブなウィンドウについての情報を得る機能を提供すると仮定した場合)。
がうまくいけば、彼らは最終的に収束し、これを成し遂げるためにいくつかの共通のインタフェースを持っているが、私はanticipating this issueをしてきた
息を...持っていないよう。しかし、今日はWaylandの実際のユーザーがfirst user request for Wayland supportを取得しました。大規模なディストリビューションがデフォルトのディスプレイサーバープロトコルとしてWaylandを採用しているので(Fedora 25は既にそれを使用しています.Ubuntuは17.10に切り替わります)、時間の経過とともに状況がますます重要になります。 ActivityWatchため
関連する問題:
- https://github.com/ActivityWatch/aw-watcher-window/issues/18
- https://github.com/ActivityWatch/activitywatch/issues/92
同じ機能を必要とするActivityWatchのような他のアプリケーション(RescueTime、arbtt、selfspy、など)がありますが、彼ら今Waylandをサポートしていないようで、私はそうすることを計画している彼らの詳細を見つけることができません。
Gnomeがで始まり、パスがより明確になるので、他の人にフォローアップするためのサポートを実装することに興味があります。
ウェストンに関する同様の質問がここに頼まれました:get the list of active windows in wayland weston
編集:
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 :)
編集2:私はFreenodeの上#waylandに尋ね、以下の返事だを提出enhancement issue in the Gnome bugtracker。
tl; dr: Waylandを使用しているときにGnomeでアクティブなウィンドウを取得するにはどうすればよいですか?
一見、これはよく見えます。私はこれを今はテストすることができませんが、[screen_get_default'のドキュメント(https://developer.gnome.org/libwnck/stable/WnckScreen.html#wnck-screen-get-default)に従って: "これはX11上になければNULLを返すことができます。 " 私は今、私の楽観主義を抑制しています... – erb
これは、 'Wnck.Screen.get_default()'が与える警告です: '(。:9342):Wnck-WARNING **:libwnckはX11のみで動作するように設計されています、有効な表示が見つかりませんでした ' – sebix