diff options
Diffstat (limited to 'community/cinnamon')
-rw-r--r-- | community/cinnamon/PKGBUILD | 18 | ||||
-rw-r--r-- | community/cinnamon/keyboard_applet.patch | 142 |
2 files changed, 155 insertions, 5 deletions
diff --git a/community/cinnamon/PKGBUILD b/community/cinnamon/PKGBUILD index ab7686196..20e4f3d2f 100644 --- a/community/cinnamon/PKGBUILD +++ b/community/cinnamon/PKGBUILD @@ -1,37 +1,45 @@ -# $Id: PKGBUILD 83983 2013-02-07 22:10:55Z bgyorgy $ +# $Id: PKGBUILD 84329 2013-02-16 17:25:27Z bgyorgy $ # Contributor: M0Rf30 # Contributor: unifiedlinux # Contributor: CReimer pkgname=cinnamon pkgver=1.6.7 -pkgrel=6 +pkgrel=7 pkgdesc="Linux desktop which provides advanced innovative features and a traditional user experience" arch=('i686' 'x86_64') url="http://cinnamon.linuxmint.com/" license=('GPL2') depends=('accountsservice' 'caribou' 'gjs' 'gnome-bluetooth' 'gnome-icon-theme' 'gnome-menus' 'gnome-settings-daemon' 'gnome-session' 'gnome-themes-standard' - 'gstreamer0.10' 'libgnomekbd' 'networkmanager' 'muffin' 'python2-dbus' + 'gstreamer0.10' 'networkmanager' 'muffin' 'python2-dbus' 'python2-gconf' 'python2-imaging' 'python2-lxml') makedepends=('gnome-common' 'intltool') optdepends=('gnome-control-center: open settings from various applets' 'gnome-screensaver: lock screen' + 'gucharmap: show character table from Keyboard applet' + 'libgnomekbd: show keyboard layout from Keyboard applet' 'nautilus: the official Gnome file manager') options=('!libtool' '!emptydirs') install=${pkgname}.install source=("$pkgname-$pkgver.tar.gz::https://github.com/linuxmint/Cinnamon/tarball/$pkgver" "cinnamon-screensaver.desktop" "cinnamon2d-screensaver.desktop" - "gnome-autogen.sh") + "gnome-autogen.sh" + "keyboard_applet.patch") md5sums=('ea73c6367d43d82c61f977477bf0c08c' 'd55c079cdc8bec606f510f87b2a6f776' '5c6af851ab1cf7e9219f11d86353196a' - 'a925691c9b57a6a884dcf07da057fd1f') + 'a925691c9b57a6a884dcf07da057fd1f' + '2b1ece84416c3e4de030be15f1774d82') build() { cd ${srcdir}/linuxmint-Cinnamon* + # Fix Keyboard applet + # https://github.com/linuxmint/Cinnamon/issues/1337 + patch -Np1 -i ${srcdir}/keyboard_applet.patch + cp ${srcdir}/gnome-autogen.sh . sed -i 's/\ --warn-all\ --warn-error//' src/Makefile.am sed -i 's/gnome-autogen.sh/.\/gnome-autogen.sh/g' autogen.sh diff --git a/community/cinnamon/keyboard_applet.patch b/community/cinnamon/keyboard_applet.patch new file mode 100644 index 000000000..6b3694086 --- /dev/null +++ b/community/cinnamon/keyboard_applet.patch @@ -0,0 +1,142 @@ +diff --git a/applet.js b/applet.js +--- a/files/usr/share/cinnamon/applets/keyboard@cinnamon.org/applet.js ++++ b/files/usr/share/cinnamon/applets/keyboard@cinnamon.org/applet.js +@@ -1,9 +1,10 @@ + const Applet = imports.ui.applet; +-const Gkbd = imports.gi.Gkbd; + const Lang = imports.lang; +-const Cinnamon = imports.gi.Cinnamon; ++const Gio = imports.gi.Gio; ++const GLib = imports.gi.GLib; + const St = imports.gi.St; + const Gtk = imports.gi.Gtk; ++const GnomeDesktop = imports.gi.GnomeDesktop; + const Main = imports.ui.main; + const PopupMenu = imports.ui.popupMenu; + const Util = imports.misc.util; +@@ -15,11 +16,12 @@ + LayoutMenuItem.prototype = { + __proto__: PopupMenu.PopupBaseMenuItem.prototype, + +- _init: function(config, id, indicator, long_name) { ++ _init: function(ipsettings, id, index, indicator, long_name) { + PopupMenu.PopupBaseMenuItem.prototype._init.call(this); + +- this._config = config; ++ this._ipsettings = ipsettings; + this._id = id; ++ this._index = index; + this.label = new St.Label({ text: long_name }); + this.indicator = indicator; + this.addActor(this.label); +@@ -28,7 +30,7 @@ + + activate: function(event) { + PopupMenu.PopupBaseMenuItem.prototype.activate.call(this); +- this._config.lock_group(this._id); ++ this._ipsettings.set_value('current', GLib.Variant.new_uint32(this._index)); + } + }; + +@@ -54,18 +56,18 @@ + this._layoutItems = [ ]; + + this._showFlags = global.settings.get_boolean("keyboard-applet-use-flags"); +- this._config = Gkbd.Configuration.get(); +- this._config.connect('changed', Lang.bind(this, this._syncConfig)); +- this._config.connect('group-changed', Lang.bind(this, this._syncGroup)); ++ this._xkbInfo = new GnomeDesktop.XkbInfo(); ++ this._ipsettings = new Gio.Settings({ schema: 'org.gnome.desktop.input-sources' }); ++ this._ipsettings.connect('changed::sources', Lang.bind(this, this._syncConfig)); ++ this._ipsettings.connect('changed::current', Lang.bind(this, this._syncGroup)); + global.settings.connect('changed::keyboard-applet-use-flags', Lang.bind(this, this._reload_settings)); +- this._config.start_listen(); + + this._syncConfig(); + + this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); + this.menu.addAction(_("Show Keyboard Layout"), Lang.bind(this, function() { + Main.overview.hide(); +- Util.spawn(['gkbd-keyboard-display', '-g', String(this._config.get_current_group() + 1)]); ++ Util.spawn(['gkbd-keyboard-display', '-l', this._selectedLayout._id]); + })); + this.menu.addAction(_("Show Character Table"), Lang.bind(this, function() { + Main.overview.hide(); +@@ -98,7 +100,6 @@ + }, + + _reload_settings: function() { +- this._showFlags = global.settings.get_boolean("keyboard-applet-use-flags"); + this._syncConfig(); + }, + +@@ -127,8 +128,8 @@ + _syncConfig: function() { + this._showFlags = global.settings.get_boolean("keyboard-applet-use-flags"); + +- let groups = this._config.get_group_names(); +- if (groups.length > 1) { ++ let sources = this._ipsettings.get_value('sources'); ++ if (sources.n_children() > 1) { + this.actor.show(); + } else { + this.menu.close(); +@@ -141,25 +142,29 @@ + for (let i = 0; i < this._labelActors.length; i++) + this._labelActors[i].destroy(); + +- let short_names = this._adjustGroupNames(this._config.get_short_group_names()); +- + this._selectedLayout = null; + this._layoutItems = [ ]; + this._labelActors = [ ]; +- for (let i = 0; i < groups.length; i++) { +- let icon_name = this._config.get_group_name(i); ++ for (let i = 0; i < sources.n_children(); i++) { ++ let [type, id] = sources.get_child_value(i).deep_unpack(); ++ let displayName = id; ++ let shortName = id; ++ let xkbLayout = id; ++ if (type == 'xkb') { ++ [_exists, displayName, shortName, xkbLayout, _xkbVariant] = this._xkbInfo.get_layout_info(id); ++ } // TODO: errorhandling, handle 'ibus' ++ let icon_name = xkbLayout; // FIXME: Really? + let actor; + 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] }); +- let item = new LayoutMenuItem(this._config, i, actor, groups[i]); +- item._short_group_name = short_names[i]; ++ actor = new St.Label({ text: shortName }); ++ let item = new LayoutMenuItem(this._ipsettings, id, i, actor, displayName); + item._icon_name = icon_name; + this._layoutItems.push(item); + this.menu.addMenuItem(item, i); + +- let shortLabel = new St.Label({ text: short_names[i] }); ++ let shortLabel = new St.Label({ text: shortName }); + this._labelActors.push(shortLabel); + } + +@@ -167,17 +172,17 @@ + }, + + _syncGroup: function() { +- let selected = this._config.get_current_group(); ++ let current = this._ipsettings.get_uint('current'); + + if (this._selectedLayout) { + this._selectedLayout.setShowDot(false); + this._selectedLayout = null; + } + +- let item = this._layoutItems[selected]; ++ let item = this._layoutItems[current]; + item.setShowDot(true); + +- let selectedLabel = this._labelActors[selected]; ++ let selectedLabel = this._labelActors[current]; + + if (this._showFlags) { + this.set_applet_icon_name(item._icon_name); |