Multi-Core-System-Monitor icon indicating copy to clipboard operation
Multi-Core-System-Monitor copied to clipboard

multiple "Preferences" item in context menu

Open hyOzd opened this issue 10 years ago • 1 comments

I've noticed each time you move this applet around in your panel, a new duplicate "Preferences" item appears in context menu. I believe the problem is caused by this piece of code:

https://github.com/ccadeptic23/Multi-Core-System-Monitor/blob/master/applet.js#L141

on_orientation_changed: function (orientation) {
    this._initContextMenu();
},

I did some debugging, and it seems that; when you move an applet in the panel on_orientation_changed() method is called even if the orientation of the applet is the same. And this causes duplicate items in context menu.

hyOzd avatar Nov 23 '15 10:11 hyOzd

I fork'd the current version and made some small improvements to the UI.

https://github.com/ralphys/Multi-Core-System-Monitor/commit/8f531155665eee64c7ac964b8a764ffa951e6568#commitcomment-15498760

I also commented the function cos' it doesn't seem to need initialization of the menu on each orientation adjustment. Seems to work well here.

ralphys avatar Jan 23 '16 01:01 ralphys