Bug 20410 - Use DBus Menu (via StatusNotifier 1.0) for mgaapplet and net_applet
Summary: Use DBus Menu (via StatusNotifier 1.0) for mgaapplet and net_applet
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: Mageia 6
Assignee: Frédéric "LpSolit" Buclin
QA Contact:
URL: https://github.com/jjk-jacky/statusno...
Whiteboard: Must be pushed at the same time as St...
Keywords:
Depends on: 20459
Blocks:
  Show dependency treegraph
 
Reported: 2017-03-07 14:53 CET by Frédéric "LpSolit" Buclin
Modified: 2017-03-13 18:27 CET (History)
3 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments
Use DBus Menu from mgaapplet (3.20 KB, patch)
2017-03-11 20:00 CET, Frédéric "LpSolit" Buclin
Details | Diff
Use DBus Menu from net_applet (3.69 KB, patch)
2017-03-11 20:03 CET, Frédéric "LpSolit" Buclin
Details | Diff
Use DBus Menu from net_applet, v2 (4.78 KB, patch)
2017-03-13 17:08 CET, Frédéric "LpSolit" Buclin
Details | Diff
Use DBus Menu from net_applet, v2 (4.79 KB, patch)
2017-03-13 17:16 CET, Frédéric "LpSolit" Buclin
Details | Diff

Description Frédéric "LpSolit" Buclin 2017-03-07 14:53:20 CET
StatusNotifier 1.0 adds support for DBus Menu, which lets us pass the GtkMenu object to the DE via DBus and let the DE display the menu natively. This means that mgaapplet and net_applet do not have to manage this themselves anymore, and their menu will be visually identical to other menus from other apps, for a better integration with the DE. Moreover, this also means a much lower virtual memory usage. In my testing with a simple script, the virtual memory usage is 300 MB lower (500 MB instead of 800 MB). The resident memory is only 5-10 MB lower (~45 MB instead of 55 MB).

I will also edit the code a bit to only load StatusNotifier if SNI is supported, i.e. on Plasma only for now.

I will work on topic/systray again as we must sync their release with StatusNotifier 1.0 (my new code won't work with the current StatusNotifier 0.1 currently in Cauldron).
Comment 1 Frédéric "LpSolit" Buclin 2017-03-07 18:42:50 CET
The maintainer of StatusNotifier just told me that 1.0 should be released this week-end if nothing goes wrong meanwhile. :)

URL: https://github.com/jjk-jacky/statusnotifier/tree/introspection => https://github.com/jjk-jacky/statusnotifier/tree/next

Thierry Vignaud 2017-03-08 19:23:51 CET

CC: (none) => thierry.vignaud

Comment 2 Frédéric "LpSolit" Buclin 2017-03-10 20:26:34 CET
1.0.0 released a few hours ago:

https://github.com/jjk-jacky/statusnotifier/releases/tag/1.0.0

URL: https://github.com/jjk-jacky/statusnotifier/tree/next => https://github.com/jjk-jacky/statusnotifier/releases/tag/1.0.0

Comment 3 Frédéric "LpSolit" Buclin 2017-03-11 20:00:43 CET
Created attachment 9069 [details]
Use DBus Menu from mgaapplet

Here is the patch for mgaapplet. It requires StatusNotifier 1.0.

Some stats, for comparison, after a right-click on the status icon:

StatusNotifier without DBus Menu:

VIRT  922 MB
RES  98.1 MB
SHR  35.9 MB

StatusNotifier with DBus Menu: (without displaying the About dialog)

VIRT  637 MB
RES  91.1 MB
SHR  29.6 MB

GtkStatusIcon:

VIRT  918 MB
RES  99.6 MB
SHR  36.4 MB
Comment 4 Frédéric "LpSolit" Buclin 2017-03-11 20:03:04 CET
Created attachment 9070 [details]
Use DBus Menu from net_applet

And here is the patch for net_applet. It also requires StatusNotifier 1.0.

Some more stats, after a right-click on the status icon:

StatusNotifier without DBus Menu:

VIRT  902 MB
RES  84.3 MB
SHR  30.0 MB

StatusNotifier with DBus Menu:

VIRT  546 MB
RES  77.6 MB
SHR  24.3 MB

GtkStatusIcon:

VIRT  824 MB
RES  84.5 MB
SHR  30.4 MB
Comment 5 Frédéric "LpSolit" Buclin 2017-03-11 20:14:19 CET
Note that both patches are incompatible with the version of StatusNotifier currently in Cauldron (0.1). They both require 1.0, but compiled with the

  ./configure --enable-introspection=yes --enable-dbusmenu --enable-gtk-doc

command, else DBus Menu won't be enabled. Also note the new --enable-introspection=yes argument which will let you clean the spec a bit.


Also, the current mgaapplet and net_applet scripts in Cauldron won't work with StatusNotifier 1.0, so conflicts in the RPM spec files must be set accordingly.


Please do not forget to include the fix for bug 20434 before pushing new RPMs. The dependency should ideally be put in a place where we don't need to worry about it again.

CC: (none) => mageia, rverschelde
Whiteboard: (none) => Must be pushed at the same time as StatusNotifier 1.0 (not backward compatible)

Comment 6 Frédéric "LpSolit" Buclin 2017-03-12 03:24:37 CET
For some reason, the right-click doesn't trigger anything on a clean reboot. It looks like the DBus Menu is not working if net_applet is launched too early. Still investigating.

Do not commit anything yet, please.

Status comment: (none) => Not ready for checkin, see comment 6!

Comment 7 Nicolas Lécureuil 2017-03-12 08:42:56 CET
maybe you can do a branch in git this will be simpler and will be merged when ready ;)
Comment 8 Frédéric "LpSolit" Buclin 2017-03-12 10:35:52 CET
(In reply to Nicolas Lécureuil from comment #7)
> maybe you can do a branch in git this will be simpler and will be merged
> when ready ;)

Nan, this won't help me find the problem. :)
Frédéric "LpSolit" Buclin 2017-03-12 16:42:02 CET

Depends on: (none) => 20459

Comment 9 Frédéric "LpSolit" Buclin 2017-03-12 17:18:47 CET
(In reply to Frédéric Buclin from comment #6)
> For some reason, the right-click doesn't trigger anything on a clean reboot.
> It looks like the DBus Menu is not working if net_applet is launched too
> early. Still investigating.

If I put a sleep(3) early in net_applet, then things are working fine. I wonder if there is some latency with something else (what?) which is not ready yet when net_applet is called.
Comment 10 Frédéric "LpSolit" Buclin 2017-03-13 17:08:56 CET
Created attachment 9084 [details]
Use DBus Menu from net_applet, v2

With a timer, things are working fine on my machine. I kept the code for the context_menu signal, just in case there is something wrong with DBusMenu.

I will check if mgaapplet needs the same fix or not.

Attachment 9070 is obsolete: 0 => 1

Comment 11 Frédéric "LpSolit" Buclin 2017-03-13 17:16:15 CET
Created attachment 9085 [details]
Use DBus Menu from net_applet, v2

(rebased due to the release of 2.29)

Attachment 9084 is obsolete: 0 => 1

Comment 12 Frédéric "LpSolit" Buclin 2017-03-13 17:21:32 CET
Looks like mgaapplet doesn't need this fix, so we are good to go. :)
Comment 13 Mageia Robot 2017-03-13 17:36:52 CET
commit 8baa7d8813dee41c9150ddb0a8139c8895cb1b93
Author: Frédéric Buclin <LpSolit@...>
Date:   Sat Mar 11 19:52:30 2017 +0100

    Use DBus Menu + StatusNotifier 1.0 (mga#20410)
---
 Commit Link:
   http://gitweb.mageia.org/software/drakx-net/commit/?id=8baa7d8813dee41c9150ddb0a8139c8895cb1b93
Comment 14 Mageia Robot 2017-03-13 17:38:06 CET
commit 74fafa20c2a11d9c59db1016342eca1d240d7ce7
Author: Frédéric Buclin <LpSolit@...>
Date:   Sat Mar 11 19:45:14 2017 +0100

    Use DBus Menu + StatusNotifier 1.0 (mga#20410)
---
 Commit Link:
   http://gitweb.mageia.org/software/mgaonline/commit/?id=74fafa20c2a11d9c59db1016342eca1d240d7ce7
Comment 15 Rémi Verschelde 2017-03-13 18:27:31 CET
Released and submitted drakx-net 2.30 and mgaonline 3.20, to go with statusnotifier 1.0.0.

Status comment: Not ready for checkin, see comment 6! => (none)
Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.