cht電腦資訊gcin
adm Find login register

關於 ubuntu 新版 systray / indicator 的研究分析

caleb
joined: 2007-09-22
posted: 630
promoted: 134
bookmarked: 90
1subject: 關於 ubuntu 新版 systray / indicator 的研究分析Promote 3 Bookmark 12011-04-15quote  

以下分析均根據 https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators

1. 絕對依賴 dbus (幹!我超痛恨 dbus 的)

2. 基本上依賴 libappindicator

2. 除非你繞過 libappindicator 自己想辦法跟 dbus 溝通,不然就要依賴 libappindicator

2. 注意,目前只有 ubuntu 有包 libappindicator,其它 distro 沒人鳥它

3. 依賴 GTK+

3. 除非你想自己實作 GtkMenu object,不然就要依賴 GTK+

3. 這點對 gcin 來說不是問題,但像 libX11 或 Qt 的 apps 怎麼辦?白痴才去依賴 GTK+

4. 有 GtkStatusIcon fallback

4. gcin 本來就有 GtkStatusIcon mode,所以 gcin 已經可以在 ubuntu 新版 systray / indicator 使用

綜上所述,ubuntu 新版 systray / indicator 是個很腦殘的東西,對 non-GTK+ apps 來說,吃飽太閒才會想去支援。

如果你想幫 gcin 加上此功能(non-GtkStatusIcon mode),請注意:

1. 用 dlopen() 之類的,避免 binary 依賴 libappindicator / dbus

2. dbus 的容錯設計無敵爛,請確定在 dbus 死亡時 gcin 仍能正常運作

 

coolcd
joined: 2008-01-21
posted: 2596
promoted: 348
bookmarked: 95
2subject: Promote 0 Bookmark 02011-04-15quote  

看來愈少人鳥他愈好

以免被強迫裝一堆東西 XD

caleb
joined: 2007-09-22
posted: 630
promoted: 134
bookmarked: 90
3subject: Promote 2 Bookmark 02011-04-15quote  

剛又發現 ubuntu 進一步的腦殘設計。

libindicator 本身就依賴 GTK+,而同一 process 是不能同時 link GTK+ 2.x 和 3.x 的,只能用其中一個。

也就是說,如果系統的 libindicator 依賴 GTK+ 2.x, 則所有 link libindicator 的 apps 也都被迫只能使用 GTK+ 2.x, 不能使用 3.x 。

同理如果系統 libindicator 依賴 GTK+ 3.x, 則所有 link libindicator 的 apps 都只能跟著用 3.x 。

系統級的 systray 綁 GTK+ 已經很腦殘了,還限定 GTK+ 版本,這已經不知該說什麼好了。

eliu

joined: 2007-08-09
posted: 11468
promoted: 617
bookmarked: 187
新竹, 台灣
4subject: Promote 0 Bookmark 02011-04-15quote  

libindicator 弄成 GTK-2 GTK-3 各一個版本?

savage
joined: 2007-09-28
posted: 60
promoted: 2
bookmarked: 1
火星
5subject: Promote 0 Bookmark 02011-04-15quote  

披著羊皮的狼,大家只看到羊皮,沒看到狼!

hansioux
joined: 2009-11-13
posted: 110
promoted: 6
bookmarked: 2
6subject: 關於 ubuntu 新版 systray / indicator 的研究分析Promote 0 Bookmark 02011-04-29quote  

caleb

以下分析均根據 https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators

1. 絕對依賴 dbus (幹!我超痛恨 dbus 的)

2. dbus 的容錯設計無敵爛,請確定在 dbus 死亡時 gcin 仍能正常運作

 

這和 gcin 無關,不過看到 caleb 對 dbus 的看法,很想知道 dbus 的缺點在哪。

 

最近看到 systemd (Fedora 已經用了),主打開機程序平行化,加速開機,開機時不用 shell 等。其中第一個提到的就是用了 D-Bus。看來以後 inter proccess 的通路還是會靠 dbus 。以後連最基本的 init (systemd) 都變成用 dbus 溝通,如果 dbus 有缺點會不會造成問題?

caleb
joined: 2007-09-22
posted: 630
promoted: 134
bookmarked: 90
7subject: 關於 ubuntu 新版 systray / indicator 的研究分析Promote 1 Bookmark 02011-04-29quote  

hansioux
這和 gcin 無關,不過看到 caleb 對 dbus 的看法,很想知道 dbus 的缺點在哪。

fedora 愛用 奇怪/不良 的東西已經是種傳統了。

1. hal <- 惡名昭彰, 好不容易現在差不多被幹掉了

2. iiimf <- 連 fedora/sun 自己都受不了, 摸摸鼻子棄用了

關於 dbus 缺點請看這個討論串:http://mail.gnome.org/archives/gtk-devel-list/2011-February/msg00108.html

init 依賴 dbus 是非常腦殘的行為,只要 dbus 一死,init 也跟著掛了。

IPC 百千種,完全沒必要用 dbus。

guest
8subject: Promote 0 Bookmark 02011-04-29quote  

dbus已經是"標準"了

幾乎大家都在用 看不出有什麼問題 

本人已不在此站活動

joined: 2007-09-19
posted: 4946
promoted: 325
bookmarked: 206
歸隱山林
9subject: Promote 0 Bookmark 02011-04-29quote  

建議這個 thread 移到 linux 版去。


hansioux
joined: 2009-11-13
posted: 110
promoted: 6
bookmarked: 2
10subject: 關於 ubuntu 新版 systray / indicator 的研究分析Promote 0 Bookmark 02011-04-30quote  

caleb

3. 依賴 GTK+

3. 除非你想自己實作 GtkMenu object,不然就要依賴 GTK+

3. 這點對 gcin 來說不是問題,但像 libX11 或 Qt 的 apps 怎麼辦?白痴才去依賴 GTK+

 

我看了很多地方的討論,大部份都說 Application Indicator 其實是 KDE 先提出 (據說就是 KStatusNotifierItem), Ubuntu 只是做出 gtk 版。當初希望的就是 gtk 和 qt (至少是 KDE) 的 apps 可以在 gnome 和 kde 中直接 render ,並且是採用目前使用的 Windows Manager 的 theme 來 render。應該就是說如果 Amarok 今天只有 qt 版,在 gnome 底下跑的時候不用另外寫一個 gnome 的 notify icon ,而且直接就用 gnome 的 system theme 來 render 。

 

比如這邊有 kopete 在 gnome 下執行的範例

 

我剛剛好奇試了一下,的確是如此。當我的 ubuntu 10.10 下開 kopete 時, panel 上有 indicator applet 區的話就會跑出 kopete 的 KDE StatusNotifierItem (但是 icon 是我設的 gnome 主題,而且有些圖沒有補齊)。

 

panel 上有放 indicator-applet 的時候

 

當我把 indicator applet 區從 panel 上移除時,突然又在 Notification Area 區自動生出了一顆 kopete 的 icon (這個應該就是 gtk 版)。

 

把 indicator-applet 關掉,突然會跑出一顆長得不太一樣的 applet

 

(如果看到兩隻冷凍青蛙,以上兩張圖是貼在 imageshack.us 上,現在他們規定除非網站有去他們那裡註冊(免費只是email認證而已),不然連 direct link 要用戶有在 imageshack.us 上 login 才能看到圖。)

 

不知道試著在有 gtk 版 indicator applet 的 ubuntu 版本下跑 gcin qt immodule 的 package... 會不會正常顯示 notification icon...

 

所以當初目的是希望兩邊的 apps 更容易交流,而不是讓它更困難。不過想來目前的情況對想全部支援 dev 來說變成要寫三種 notification  (gnome3 好像也和以前不同,那就變4 種)。

edited: 3
caleb
joined: 2007-09-22
posted: 630
promoted: 134
bookmarked: 90
11subject: 關於 ubuntu 新版 systray / indicator 的研究分析Promote 0 Bookmark 02011-04-30quote  

hansioux

我看了很多地方的討論,大部份都說 Application Indicator 其實是 KDE 先提出 (據說就是 KStatusNotifierItem)

那個 spec 既不依賴 libappindicator 也不依賴 GTK+(GtkMenu object), 沒依賴特定 UI toolkit, 使用的 menu spec 只是很簡單的 markup language subset, 不像 Ubuntu 腦殘地限用 GtkMenu。


guest
12subject: 關於 ubuntu 新版 systray / indicator 的研究分析Promote 0 Bookmark 02011-05-01quote  

caleb

 

那個 spec 既不依賴 libappindicator 也不依賴 GTK+(GtkMenu object), 沒依賴特定 UI toolkit, 使用的 menu spec 只是很簡單的 markup language subset, 不像 Ubuntu 腦殘地限用 GtkMenu。


 

KStatusNotifierItem 有用到 D-Bus、KMenu、QMenu 等。我以為 KMenu 就是 KDE 的 Menu spec,QMenu 是 Qt 的 menu spec ...

我記得不論是 Unity 的 sidebar 和 indicator-applets 裡的行為好像都是 markup language 來 define 的 (用的和 KStatusNotifierItem 一樣)。就類似下面:

"<ui>"
"  <menubar name='MenuBar'>"
"    <menu action='FileMenu'>"
"      <menuitem action='New'/>"
"      <menuitem action='Open'/>"
"      <menuitem action='Save'/>"
"      <separator/>"
"      <menuitem action='Quit'/>"
"    </menu>"
"  </menubar>"
"  <popup name='IndicatorPopup'>"
"    <menuitem action='New' />"
"    <menuitem action='Open' />"
"    <menuitem action='Save' />"
"    <menuitem action='Quit' />"
"  </popup>"
"</ui>";

 

http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/classKStatusNotifierItem.html

http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/classKMenu.html

還是 caleb 只是要指出 GtkMenu 有其它別腦殘之處?

caleb
joined: 2007-09-22
posted: 630
promoted: 134
bookmarked: 90
13subject: 關於 ubuntu 新版 systray / indicator 的研究分析Promote 1 Bookmark 02011-05-01quote  

回文前看到的 spec 不是指向 http://techbase.kde.org/Development/Tutorials/PortToKStatusNotifierItem [1]

而是類似 http://www.notmart.org/misc/statusnotifieritem/index.html [2]

可能我回文時 hansioux 剛編輯完?看編輯時間差不多(目前兩篇都顯示 22 hr ago)

為方便起見,下面的 spec [3] 即本討論串第一篇的 https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators [3]

guest

KStatusNotifierItem 有用到 D-Bus、KMenu、QMenu 等。我以為 KMenu 就是 KDE 的 Menu spec,QMenu 是 Qt 的 menu spec ...

spec [1] 的確有用到 QObject / QString

spec [2] 沒有依賴特定 UI toolkit

guest

我記得不論是 Unity 的 sidebar 和 indicator-applets 裡的行為好像都是 markup language 來 define 的 (用的和 KStatusNotifierItem 一樣)。就類似下面:

"<ui>"
" <menubar name='MenuBar'>"
" <menu action='FileMenu'>"
" <menuitem action='New'/>"



你列出的是 GtkUIManager, 只是產生 GtkMenu 的其中一種方法。

要注意的是 Ubuntu(spec [3]) 不收 GtkUIManager 的 markup, 只收 GtkMenu

跨平台的 tray 在通訊時依賴特定 UI toolkit 的 object 就是腦殘,跟是不是 GtkMenu 沒有關係。

至於收到通訊後,畫介面時用不用 UI toolkit 那就是 tray 的事了。

caleb
joined: 2007-09-22
posted: 630
promoted: 134
bookmarked: 90
14subject: Promote 0 Bookmark 02011-05-04quote  
來自 http://wowubuntu.com/ubuntu-gnome3.html 的說法:

「只是相对麻烦的一个问题来自于 AppIndicators,很多程序为了适应 Unity 桌面的都打了相应的 AppIndicators 补丁,但这些补丁无法正常工作于 Gnome Shell 下。」

Ubuntu 腦殘真是沒藥醫了。
guest
15subject: Promote 0 Bookmark 02011-05-04quote  

caleb

來自 http://wowubuntu.com/ubuntu-gnome3.html 的說法:

「只是相对麻烦的一个问题来自于 AppIndicators,很多程序为了适应 Unity 桌面的都打了相应的 AppIndicators 补丁,但这些补丁无法正常工作于 Gnome Shell 下。」

Ubuntu 腦殘真是沒藥醫了。

 

Ubuntu一直都有強暴其他Distro的習慣阿....(看向Notify-OSD)

 

 用戶多就無視其他人,不就是這種心態

hansioux
joined: 2009-11-13
posted: 110
promoted: 6
bookmarked: 2
16subject: Promote 0 Bookmark 02011-05-04quote  

caleb

來自 http://wowubuntu.com/ubuntu-gnome3.html 的說法:

「只是相对麻烦的一个问题来自于 AppIndicators,很多程序为了适应 Unity 桌面的都打了相应的 AppIndicators 补丁,但这些补丁无法正常工作于 Gnome Shell 下。」

Ubuntu 腦殘真是沒藥醫了。

 

gnome3 和 Unity 目前都剛 release,連裝在一起都會爛掉,再給一點時間應該就會得到改善了吧。如果真的很不喜歡東西在 early stages 會有出現錯誤,那使用 LTS 的 distro 版本,或是不要更新到剛推出的 WM 就好。Open Source software 有推新架構的時候不都這樣。Python 版本更新舊的python script 都跑不動(連Gentoo 的 Emerge 都跑不動)。當初 KDE 4 出來的時候也造成一些 KDE 3.5 的東西不能跑(qt3 -> qt4),寧可用 KDE 3.5 不肯更新到 KDE 4.0 的人也很多。但是當初有走那步才有今日 KDE 4.6 的成功。

我覺得Gnome3和Unity兩者最大的差別還是在 mutter 和 compiz 上。其它設計理念都滿像的。都是... 比較適合觸控,對滑鼠和桌機造成 user expereince 進化。至於不相容的地方,除非大家從此就不用 Gnome 系的 Desktop Environment ,不然 life will find a way...

edited: 1
本人已不在此站活動

joined: 2007-09-19
posted: 4946
promoted: 325
bookmarked: 206
歸隱山林
17subject: Promote 0 Bookmark 02011-05-05quote  

手段很像微軟,javascript 就是要和別人有點不相容,還不都是在玩策略,這才是重點,
重點不在什麼 FS/OSS 或技術上的問題。

FS/OSS 只是無辜的被利用,別講得那麼神聖。等一下林語堂又會出來說話:

一個神聖的目標是很危險的。當一個目標變得神聖時,
要達到這個目標的手段往往會變得很卑下。(林語堂.快樂的天才)


edited: 2
本人已不在此站活動

joined: 2007-09-19
posted: 4946
promoted: 325
bookmarked: 206
歸隱山林
18subject: Promote 0 Bookmark 02011-05-05quote  

guest
Ubuntu一直都有強暴其他Distro的習慣阿....(看向Notify-OSD)

 用戶多就無視其他人,不就是這種心態

微軟的用戶更多!

Canonical/Ubuntun 只是另一個微軟罷了!看,FS/OSS 多好用,連微軟都一直想利用說。


hansioux
joined: 2009-11-13
posted: 110
promoted: 6
bookmarked: 2
19subject: Promote 0 Bookmark 02011-05-07quote  

guest

 

 

Ubuntu一直都有強暴其他Distro的習慣阿....(看向Notify-OSD)

 

 用戶多就無視其他人,不就是這種心態

 

這和 Application Indicator 好像是類似的決定,Notify-OSD 應該是想和 kNotification 互通。這一切好像都要追回 D-Bus和 D-Bus 出來給 freedesktop.org (XDG) 用的 specs。D-BUS 和 status notifier 都是 freedesktop.org 的 spec 出來的 implementation。

 

http://api.kde.org/4.0-api/kdelibs-apidocs/kdeui/html/classKNotification.html

 

要說這些是 Conanical vs 其它 distro ,不如說這是 gnome vs KDE 的延伸。KDE dev Aaron Seigo 抱怨 gnome3 reject掉了 freedesktop.org 整合  KDE 和 gnome 的specs: http://aseigo.blogspot.com/2011/03/collaborations-demise.htmlhttp://psankar.blogspot.com/2011/03/gnome-vs-canonical-freedesktoporg.html

 

不知道為什麼隨便說出 「Ubuntu一直都有強暴其他Distro的習慣」 在這個版上沒有人會吭一聲。但是說這類談話只是些 KDE vs gnome, RPM vs deb 類的宗教戰爭被會圍毆。我以為重點是不管其它人怎麼亂,想用 gcin 的人都能夠用比較重要。

edited: 2
本人已不在此站活動

joined: 2007-09-19
posted: 4946
promoted: 325
bookmarked: 206
歸隱山林
20subject: Promote 0 Bookmark 02011-05-07quote  

hansioux
不知道為什麼隨便說出 「Ubuntu一直都有強暴其他Distro的習慣」 在這個版上沒有人會吭一聲。但是說這類談話只是些 KDE vs gnome, RPM vs deb 類的宗教戰爭被會圍毆。我以為重點是不管其它人怎麼亂,想用 gcin 的人都能夠用比較重要。

我吭聲了,他的確是有這種傾向,手段很惡劣。

別故意的推給什麼該死的「宗教戰爭」和「圍毆」,這不是宗教戰爭,
我看了 20 年左右自由軟體的走向及各種 distro 的生態,沒看過這麼惡劣的。

能不能拜託留個「淨土」給我們?Ubuntu 已經是主流了,你們的 forum/chat 熱鬧多了!別到這種小站來亂了好嗎!


edited: 2
hansioux
joined: 2009-11-13
posted: 110
promoted: 6
bookmarked: 2
21subject: Promote 0 Bookmark 02011-05-07quote  

LGJ

 

我吭聲了,他的確是有這種傾向,手段很惡劣。

別故意的推給什麼該死的「宗教戰爭」和「圍毆」,這不是宗教戰爭,
我看了 20 年左右自由軟體的走向及各種 distro 的生態,沒看過這麼惡劣的。

能不能拜託留個「淨土」給我們?Ubuntu 已經是主流了,你們的 forum/chat 熱鬧多了!別到這種小站來亂了好嗎!

 

這是 gnome 的 Dan Winship (danw@gnome.org, http://danw.mysterion.org/) 對 KDE proposed notification spec 的意見,可看出整件事背後是 gnome vs KDE 在發作:http://blogs.gnome.org/bolsh/2011/03/07/has-gnome-rejected-canonical-help/#comment-3488

 

danw Says:

See my reply to the d-d-l thread, which was several months later and so is not linked to the thread you linked to.

The #1 reason we rejected appindicators was because the protocol that they are built on (the original protocol, not the additions written for Ayatana) is a joke, and when we tried to suggest changes that would make it more useful to GNOME, we were more or less told (again, by KDE people, not Ubuntu people) that we were stupid. It quickly became clear that it wasn’t worth making any further attempt to work with them, so we wrote them off.

There are various bugs in gnome-shell (eg, 630842, 641853) that cannot easily be fixed with the current trayicon system, which would be trivial to fix with appindicators. And so we are probably going to end up designing something more-or-less equivalent to libappindicator for 3.2, but sane underneath. And this is all a huge waste that would have been avoided if Canonical had discussed the idea of appindicators in GNOME with the GNOME community before implementing them rather than just trying to force us to accept extremely unfortunate technical decisions after the fact.

 

基本上 gnome 不愛 KDE 向 freedesktop.org 提出的 spec因此沒有採用(雖然最後他承認目前的 trayicon system 最後需要類似的東西來修正)。加上他不愛 Canonical 沒和他們溝通就自行按 freedesktop.org 的 spec 做出了 libappindicator 然後硬推給 gnome。不過既然一開始 gnome 就不愛那個 spec ,就算  Canonical 有溝通應該一樣是被reject掉。總之,不論怎樣,這些 specs 不是 Canonical 自行開發定義的。

本人已不在此站活動

joined: 2007-09-19
posted: 4946
promoted: 325
bookmarked: 206
歸隱山林
22subject: Promote 0 Bookmark 02011-05-07quote  

請不要跳針好嗎?人家說的是慣犯的行為模式,不是只有這個主題。這個主題只被「巧用」了!

Canonical只是在借力使力。難道這位正是 Canonical 的人?


edited: 2
guest
23subject: Promote 0 Bookmark 02011-05-08quote  

Canonical的問題一直都很多好嗎?

舉Notify-OSD的例子就是在說Canonical會為了自己高興,就把其他家的Spec給無視

實際上Notification的規範原本要讓小氣泡可以直接跟使用者回應,這是在最原本的notificaion-daemon就有實作出來的規格

(這是純粹的GTK,跟KDE/GNOME一點關係都沒有) 

Mark Shuttleworth某天出來說我們喜歡沒有辦法跟使用者作溝通的版本,做了個Notify-OSD

然後再自己重新造一個AppIndicator的輪子...??? 從頭到尾這跟KDE一點關係都沒有

哪來的 KDE vs GNOME?

caleb
joined: 2007-09-22
posted: 630
promoted: 134
bookmarked: 90
24subject: Promote 1 Bookmark 02011-05-24quote  
https://blueprints.launchpad.net/ubuntu/+spec/desktop-o-gtk3-gnome3

Ubuntu 官方文件說:
* Don't include gnome-panel 3 as it breaks Ubuntu Classic by not supporting indicators

因為 Ubuntu 亂搞 indicator spec 硬綁特定版本的 GTK+ (2.x or 3.x) 才會這樣。
coolcd
joined: 2008-01-21
posted: 2596
promoted: 348
bookmarked: 95
25subject: Promote 0 Bookmark 02011-05-24quote  

還有

launchpad
* Review our patches, and be rather aggressive about removing those which are intrusive and which we have carried for ages without upstream acceptance. Of course there are also still patches which we haven't even proposed upstream, these should be discussed in bugzilla.gnome.org.

使用 launchpad 的後遺症

edited: 1

cht電腦資訊gcin
adm Find login register
views:57871