-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resize indicator icons to fit panel #43
Conversation
This should be reviewed by someone who use and build it for his distro. |
@raveit65 - I know, this doesn't apply to you ;) Actually, I've never been able to successfully build this on Fedora, but I'm not that concerned about that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I've only ever gotten this to actually show my indicators ONCE on Debian Unstable, the code looks mostly OK on first examination. I do see
/* Track panel resize */
g_signal_connect(applet, "change-size", G_CALLBACK(entry_resized), io);
but don't see anything added disconnecting it when the applet is removed or the panel destroyed. Is that already taken care of for all signals used by the indicator applet elsewhere, as is sometimes the case? If so nothing to worry about. Test would be to add and remove the applet whiile watching syslog for any errors involving that signal.
I don't see any obvious memory management errors of the newly dynamically allocated variables (as opposed to new pointers to existing variables) not getting freed sort.
Just commenting as running this on Debian always gets "no indicators" even though I have network-manager-applet running in indicator mode (and it ought to support this). That is true even when the normal mate-panel tray applet(with its own SNI support) is removed from the panel.
Fedora ships libindicator for building, but there isn't an indicator for using ;) |
I've been waiting for this to be fixed for a long time! Thanks a lot... |
@lukefromdc - since the signal is emitted by the applet itself, it will be disconnected automatically when the applet is destroyed. The main use-case for explicitly disconnecting the signal is when using To get this running on Ubuntu 19.04 was a bit of a pain, but finally managed using the following flags:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@selectiveduplicate - seems theme-specific. Every other theme I tried shows qbittorrent correctly, except for Ambiant. Maybe there's some padding issue in the Ambiant panel? |
I would say that hard-coded padding |
@muktupavels - true, I don't like it either, but it's the one thing that made it consistently look good across themes. Smaller padding and icons start clipping, more padding and icons look too small... I can increase the padding to take into account whatever other stray indicator icons do, but where to stop? |
Is that bad wording? Or what did you try to say? You must disconnect signal if you know that object you connect to will live longer then user_data. You really don't want that callback is called with already destroyed/freed object/data. If both things are gobjects you can use Hard-coded values are rarely good, no? As you say - "where to stop?"... Answer is simple, don't hard-code. I am sure that you should be able to get available space / height. |
@vkareh Yeah, seems to be theme-specific. All the other themes (the ones that mate-themes ships) work fine without any cropping... |
This fixes two issues: * Some indicators have icons that are not the correct size (e.g. scalable 256px) and so they clip on the panel and look ugly. * When resizing the panel, indicators stay the same size. This updates the indicator icons so that they resize along with the panel.
14a03d2
to
b1557a1
Compare
@muktupavels - thanks, I was misunderstanding this. I can see now on Memory management of signal handlers what you're saying regarding gobjects. I've updated the connect call to using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a huge improvement! Confirming this as fixing the oversized icons with the added benefit that some indicators icons were also way too small and now they are correctly scaled.
I know this change is closed but I think it introduced a problem with large panels. I used to have a nice Windows10 like panel but after upgrade to 19.10 all my indicators icons are as big as the application icons. I'm trying to build a version prior to this change to confirm this and to possibly adjust the code to have some proportional padding but I get this error: "configure: error: Either Ayatana Indicators or Ubuntu Indicators are required to build mate-indicator-applet." Assuming I have either one of the two with default Mate 19.10, what am I missing? |
This fixes two issues:
Fixes #29