Skip to content
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

cinnamon 2.6.9 keyboard applet cannot use flags to display current layout #4357

Closed
ndwarshuis opened this issue Jun 23, 2015 · 13 comments
Closed

Comments

@ndwarshuis
Copy link

Keyboard applet no longer displays a flag for the current keyboard layout (only "en" for english for example) This occurs regardless of the configuration setting. Downgrading to 2.6.8 solves issue

@EmergReanimator
Copy link

Hi there,

I have made small patch for this which works for me.

$ diff -u  applet.js /usr/share/cinnamon/applets/keyboard\@cinnamon.org/applet.js
--- applet.js   2015-07-11 20:47:40.000000000 +0200
+++ /usr/share/cinnamon/applets/keyboard@cinnamon.org/applet.js 2015-07-11 20:54:05.000000000 +0200
@@ -139,7 +139,7 @@
         for (let i = 0; i < groups.length; i++) {
             let icon_name = this._config.get_group_name(i);
             let actor;
-            if (this._showFlags && this.icon_theme.has_icon(icon_name))
+            if (this._showFlags)
                 actor = new St.Icon({ icon_name: icon_name, icon_type: St.IconType.FULLCOLOR, style_class: 'popup-menu-icon' });
             else
                 actor = new St.Label({ text: short_names[i] });
@@ -171,7 +171,7 @@
         let selectedLabel = this._labelActors[selected];

         this.set_applet_tooltip(item._long_name)
-        if (this._showFlags && this.icon_theme.has_icon(item._icon_name)) {
+        if (this._showFlags) {
             this.set_applet_icon_name(item._icon_name);
             this.set_applet_label("");
         } else {

@leigh123linux
Copy link
Contributor

This commit breaks it

e6c3fd9

@perfect7gentleman
Copy link

EmergReanimator, thanx for patch

@JosephMcc
Copy link
Contributor

That commit only breaks things under some newer gtk versions. Gtk.IconTheme.has_icon() returns the incorrect value for some reason. Either it's behavior was changed or there is a bug which needs to be fixed in gtk. Works fine under gtk3.10

@Rolice
Copy link

Rolice commented Oct 1, 2015

The patch worked for me as it seems the bug is still present in the current version, thanks @EmergReanimator. I wonder why the release contain such a malfunction (extra logic check within some icon theme)? Does this patch keep the consistency? Why it is not still merged in the development?

@JosephMcc
Copy link
Contributor

It's not merged because it's not really a proper fix. The call to has_icon() is there to cover the situation where you choose a language where no flag is available. In that case you get text instead of an icon. Either another way to deal with that situation needs to be implemented or we need to find out why the has_icon() function isn't returning a proper value.

@Rolice
Copy link

Rolice commented Oct 1, 2015

Thanks you for the information, @JosephMcc. So this means that this.icon_theme.has_icon funciton is failing as the flags are there as phisical files, but it does not detect them for some reason. I will try isolating the issue, if I get some spare time.

@JosephMcc
Copy link
Contributor

@Rolice Yes. The flag icons are added to the icon theme by the applet. For some reason in newer gtk versions calling has_icon() returns false even when the icon exists. In Mint for example with gtk3.10 it works as expected.

We actually walked through this with @leigh123linux in IRC on a newer Fedora install that had this issue and the icons were added properly to the current icon theme but that one function call wasn't giving the expected value.

@Rolice
Copy link

Rolice commented Oct 1, 2015

Yes I confirm the same issue here on Debian with GTK 2.0 and 3.0 installed (possibly 3.0 used by the applet). Two separate installations - same issue.

@lisuml
Copy link
Contributor

lisuml commented Nov 18, 2015

Same issue here on cinnamon 2.8.4.

lisuml pushed a commit to lisuml/Cinnamon that referenced this issue Nov 18, 2015
@lisuml
Copy link
Contributor

lisuml commented Nov 18, 2015

Please review another patch: lisuml@90eec97

Basically instead of using has_icon method of IconTheme I replaced it with lookup_icon.

clefebvre added a commit that referenced this issue Nov 20, 2015
#4357: Replace has_icon method with lookup_icon one to fix missing fl…
@ManIVIctorious
Copy link

This seems to work in cinnamon 3.0.7 Arch linux

@JosephMcc
Copy link
Contributor

@petrucci4prez Does it work for you now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants