From a8d98f5d7aed169b87880caf0738998b348d698a Mon Sep 17 00:00:00 2001 From: Mathieu Trudel-Lapierre Date: Mon, 5 Aug 2013 13:57:24 -0400 Subject: * debian/control: - Packaging review, add comment to developers. - Fix Vcs-Bzr, Vcs-Browser. - Sort Build-Depends, use trailing commas. - Improve long description. * debian/rules: - Add DPKG_GENSYMBOLS_CHECK_LEVEL = 4. - Override dh_autoreconf to run ./autogen.sh. - Override dh_install to remove .la and .a files. - Run dh_install with --fail-missing. * debian/compat: bump to compat level 9. * debian/source/format: make sure we're using format 1.0. --- debian/control | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'debian/control') diff --git a/debian/control b/debian/control index 90eb2451..ec8a177b 100644 --- a/debian/control +++ b/debian/control @@ -3,32 +3,35 @@ Section: gnome Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: William Hua -Build-Depends: quilt, - debhelper (>= 9.0.0), - dh-autoreconf, - dh-translations, - libgirepository1.0-dev, - valac, - libgee-dev, - libgtk-3-dev, - libgnome-desktop-3-dev, - libgnomekbd-dev, - libibus-1.0-dev (>= 1.5.0), - libbamf3-dev, - dbus, - xvfb, - xauth +Build-Depends: + debhelper (>= 9.0.0), + quilt, + dh-autoreconf, + dh-translations, + dbus, + libbamf3-dev, + libgee-dev, + libgirepository1.0-dev, + libgnome-desktop-3-dev, + libgnomekbd-dev, + libgtk-3-dev, + libibus-1.0-dev (>= 1.5.0), + valac, + xauth, + xvfb, Standards-Version: 3.9.4 Homepage: https://code.launchpad.net/indicator-keyboard # If you aren't a member of ~indicator-applet-developers but need to upload # packaging changes, just go ahead. ~indicator-applet-developers will notice # and sync up the code again. -Vcs-Bzr: https://code.launchpad.net/~attente/indicator-keyboard/trunk -Vcs-Browser: https://bazaar.launchpad.net/~attente/indicator-keyboard/trunk/files +Vcs-Bzr: https://code.launchpad.net/~indicator-applet-developers/indicator-keyboard/trunk +Vcs-Browser: https://bazaar.launchpad.net/~indicator-applet-develpers/indicator-keyboard/trunk/files Package: indicator-keyboard Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} Description: Keyboard indicator - This package contains the keyboard indicator. + This package contains the keyboard indicator, which should show as an icon in + the top panel when using the Unity environment. It can be used to switch + key layouts or languages, and helps the user identifying which layouts are + currently in use. -- cgit v1.2.3 From 6fd14a948bf391d5b64ad7a70bef8186cb329fed Mon Sep 17 00:00:00 2001 From: Mathieu Trudel-Lapierre Date: Mon, 5 Aug 2013 14:15:00 -0400 Subject: Add another missing comma --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian/control') diff --git a/debian/control b/debian/control index ec8a177b..3002d3b3 100644 --- a/debian/control +++ b/debian/control @@ -29,7 +29,7 @@ Vcs-Browser: https://bazaar.launchpad.net/~indicator-applet-develpers/indicator- Package: indicator-keyboard Architecture: any -Depends: ${misc:Depends}, ${shlibs:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, Description: Keyboard indicator This package contains the keyboard indicator, which should show as an icon in the top panel when using the Unity environment. It can be used to switch -- cgit v1.2.3 From 2b5867901d6ac8efefe211426d93ebd374d09cea Mon Sep 17 00:00:00 2001 From: Mathieu Trudel-Lapierre Date: Mon, 5 Aug 2013 14:54:36 -0400 Subject: Fix identation for (Build-)Depends --- debian/control | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'debian/control') diff --git a/debian/control b/debian/control index 3002d3b3..317b23ec 100644 --- a/debian/control +++ b/debian/control @@ -3,33 +3,30 @@ Section: gnome Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: William Hua -Build-Depends: - debhelper (>= 9.0.0), - quilt, - dh-autoreconf, - dh-translations, - dbus, - libbamf3-dev, - libgee-dev, - libgirepository1.0-dev, - libgnome-desktop-3-dev, - libgnomekbd-dev, - libgtk-3-dev, - libibus-1.0-dev (>= 1.5.0), - valac, - xauth, - xvfb, +Build-Depends: debhelper (>= 9.0.0), + quilt, + dh-autoreconf, + dh-translations, + dbus, + libbamf3-dev, + libgee-dev, + libgirepository1.0-dev, + libgnome-desktop-3-dev, + libgnomekbd-dev, + libgtk-3-dev, + libibus-1.0-dev (>= 1.5.0), + valac, + xauth, + xvfb, Standards-Version: 3.9.4 Homepage: https://code.launchpad.net/indicator-keyboard -# If you aren't a member of ~indicator-applet-developers but need to upload -# packaging changes, just go ahead. ~indicator-applet-developers will notice -# and sync up the code again. Vcs-Bzr: https://code.launchpad.net/~indicator-applet-developers/indicator-keyboard/trunk Vcs-Browser: https://bazaar.launchpad.net/~indicator-applet-develpers/indicator-keyboard/trunk/files Package: indicator-keyboard Architecture: any -Depends: ${misc:Depends}, ${shlibs:Depends}, +Depends: ${misc:Depends}, + ${shlibs:Depends}, Description: Keyboard indicator This package contains the keyboard indicator, which should show as an icon in the top panel when using the Unity environment. It can be used to switch -- cgit v1.2.3 From 9d2aacb967186c594cc4582310080a5ce299a022 Mon Sep 17 00:00:00 2001 From: Mathieu Trudel-Lapierre Date: Wed, 7 Aug 2013 11:20:47 -0400 Subject: Re-add the missing comments --- debian/control | 3 +++ 1 file changed, 3 insertions(+) (limited to 'debian/control') diff --git a/debian/control b/debian/control index 317b23ec..95e0d25e 100644 --- a/debian/control +++ b/debian/control @@ -20,6 +20,9 @@ Build-Depends: debhelper (>= 9.0.0), xvfb, Standards-Version: 3.9.4 Homepage: https://code.launchpad.net/indicator-keyboard +# If you aren't a member of ~indicator-applet-developers but need to upload +# packaging changes, just go ahead. ~indicator-applet-developers will notice +# and sync up the code again. Vcs-Bzr: https://code.launchpad.net/~indicator-applet-developers/indicator-keyboard/trunk Vcs-Browser: https://bazaar.launchpad.net/~indicator-applet-develpers/indicator-keyboard/trunk/files -- cgit v1.2.3 From 4451d840969698c2d2106c013a95a3c6eb4baf70 Mon Sep 17 00:00:00 2001 From: William Hua Date: Wed, 7 Aug 2013 16:20:23 -0400 Subject: Work under lightdm/unity-greeter. --- configure.ac | 8 +++ data/Makefile.am | 3 + debian/control | 2 + lib/Makefile.am | 58 +++++++++------- lib/main.vala | 203 ++++++++++++++++++++++++++++++++++++++++++++----------- 5 files changed, 208 insertions(+), 66 deletions(-) (limited to 'debian/control') diff --git a/configure.ac b/configure.ac index 31640e6b..b2503f1f 100644 --- a/configure.ac +++ b/configure.ac @@ -70,6 +70,14 @@ PKG_CHECK_MODULES([IBUS], [ibus-1.0]) AC_SUBST([IBUS_CFLAGS]) AC_SUBST([IBUS_LIBS]) +PKG_CHECK_MODULES([ACCOUNTSSERVICE], [accountsservice]) +AC_SUBST([ACCOUNTSSERVICE_CFLAGS]) +AC_SUBST([ACCOUNTSSERVICE_LIBS]) + +PKG_CHECK_MODULES([LIGHTDM], [liblightdm-gobject-1]) +AC_SUBST([LIGHTDM_CFLAGS]) +AC_SUBST([LIGHTDM_LIBS]) + PKG_CHECK_MODULES([BAMF], [libbamf3]) AC_SUBST([BAMF_CFLAGS]) AC_SUBST([BAMF_LIBS]) diff --git a/data/Makefile.am b/data/Makefile.am index a7f8d39c..10cdfee5 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -48,6 +48,9 @@ com.canonical.indicator.keyboard: echo 'ObjectPath=/com/canonical/indicator/keyboard'; \ echo ''; \ echo '[desktop]'; \ + echo 'ObjectPath=/com/canonical/indicator/keyboard/desktop'; \ + echo ''; \ + echo '[desktop_greeter]'; \ echo 'ObjectPath=/com/canonical/indicator/keyboard/desktop') > $@.tmp && \ mv $@.tmp $@ diff --git a/debian/control b/debian/control index 90eb2451..4f5289ac 100644 --- a/debian/control +++ b/debian/control @@ -14,6 +14,8 @@ Build-Depends: quilt, libgnome-desktop-3-dev, libgnomekbd-dev, libibus-1.0-dev (>= 1.5.0), + libaccountsservice-dev, + liblightdm-gobject-1-dev, libbamf3-dev, dbus, xvfb, diff --git a/lib/Makefile.am b/lib/Makefile.am index cdf41ba2..0e6c70d1 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -9,32 +9,38 @@ AM_VALAFLAGS = --enable-experimental-non-null \ indicator_keyboard_service_SOURCES = main.vala \ source.vala \ common.vala -indicator_keyboard_service_VALAFLAGS = $(AM_VALAFLAGS) \ - --pkg gee-1.0 \ - --pkg posix \ - --pkg pangocairo \ - --pkg gtk+-3.0 \ - --pkg GDesktopEnums-3.0 \ - --pkg gnome-desktop-3.0 \ - --pkg Xkl-1.0 \ - --pkg Gkbd-3.0 \ - --pkg ibus-1.0 \ +indicator_keyboard_service_VALAFLAGS = $(AM_VALAFLAGS) \ + --pkg gee-1.0 \ + --pkg posix \ + --pkg pangocairo \ + --pkg gtk+-3.0 \ + --pkg GDesktopEnums-3.0 \ + --pkg gnome-desktop-3.0 \ + --pkg Xkl-1.0 \ + --pkg Gkbd-3.0 \ + --pkg ibus-1.0 \ + --pkg accountsservice \ + --pkg liblightdm-gobject-1 \ --pkg libbamf3 -indicator_keyboard_service_CFLAGS = $(AM_CFLAGS) \ - $(GEE_CFLAGS) \ - $(PANGOCAIRO_CFLAGS) \ - $(GTK_CFLAGS) \ - $(GNOME_DESKTOP_CFLAGS) \ - $(LIBXKLAVIER_CFLAGS) \ - $(LIBGNOMEKBD_CFLAGS) \ - $(IBUS_CFLAGS) \ +indicator_keyboard_service_CFLAGS = $(AM_CFLAGS) \ + $(GEE_CFLAGS) \ + $(PANGOCAIRO_CFLAGS) \ + $(GTK_CFLAGS) \ + $(GNOME_DESKTOP_CFLAGS) \ + $(LIBXKLAVIER_CFLAGS) \ + $(LIBGNOMEKBD_CFLAGS) \ + $(IBUS_CFLAGS) \ + $(ACCOUNTSSERVICE_CFLAGS) \ + $(LIGHTDM_CFLAGS) \ $(BAMF_CFLAGS) -indicator_keyboard_service_LDFLAGS = $(AM_LDFLAGS) \ - $(GEE_LIBS) \ - $(PANGOCAIRO_LIBS) \ - $(GTK_LIBS) \ - $(GNOME_DESKTOP_LIBS) \ - $(LIBXKLAVIER_LIBS) \ - $(LIBGNOMEKBD_LIBS) \ - $(IBUS_LIBS) \ +indicator_keyboard_service_LDFLAGS = $(AM_LDFLAGS) \ + $(GEE_LIBS) \ + $(PANGOCAIRO_LIBS) \ + $(GTK_LIBS) \ + $(GNOME_DESKTOP_LIBS) \ + $(LIBXKLAVIER_LIBS) \ + $(LIBGNOMEKBD_LIBS) \ + $(IBUS_LIBS) \ + $(ACCOUNTSSERVICE_LIBS) \ + $(LIGHTDM_LIBS) \ $(BAMF_LIBS) diff --git a/lib/main.vala b/lib/main.vala index 91466f8c..ef94b2f2 100644 --- a/lib/main.vala +++ b/lib/main.vala @@ -29,6 +29,7 @@ public class Indicator.Keyboard.Service : Object { private Settings indicator_settings; private Settings source_settings; private Settings per_window_settings; + private SList users; private Bamf.Matcher? matcher; private Gee.HashMap? window_sources; @@ -66,6 +67,11 @@ public class Indicator.Keyboard.Service : Object { acquire_bus_name (); } + [DBus (visible = false)] + private static bool is_login_user () { + return Environment.get_user_name () == "lightdm"; + } + [DBus (visible = false)] private static IBus.Bus get_ibus () { if (ibus == null) { @@ -91,64 +97,177 @@ public class Indicator.Keyboard.Service : Object { [DBus (visible = false)] private void migrate_keyboard_layouts () { - if (!indicator_settings.get_boolean ("migrated")) { - var builder = new VariantBuilder (new VariantType ("a(ss)")); - var length = 0; + if (is_login_user ()) { + Act.UserManager manager = Act.UserManager.get_default (); + + if (manager.is_loaded) { + users = manager.list_users (); + + foreach (var user in users) { + if (user.is_loaded) { + migrate_input_sources (); + } else { + user.notify["is-loaded"].connect ((pspec) => { + if (user.is_loaded) { + migrate_input_sources (); + } + }); + } + } + } else { + manager.notify["is-loaded"].connect ((pspec) => { + if (manager.is_loaded) { + users = manager.list_users (); + + foreach (var user in users) { + if (user.is_loaded) { + migrate_input_sources (); + } else { + user.notify["is-loaded"].connect ((pspec) => { + if (user.is_loaded) { + migrate_input_sources (); + } + }); + } + } + } + }); + } + } else { + if (!indicator_settings.get_boolean ("migrated")) { + var builder = new VariantBuilder (new VariantType ("a(ss)")); + var length = 0; + + var layout_settings = new Settings ("org.gnome.libgnomekbd.keyboard"); + var layouts = layout_settings.get_strv ("layouts"); + + foreach (var layout in layouts) { + var source = layout; + source = source.replace (" ", "+"); + source = source.replace ("\t", "+"); - var layout_settings = new Settings ("org.gnome.libgnomekbd.keyboard"); - var layouts = layout_settings.get_strv ("layouts"); + builder.add ("(ss)", "xkb", source); + length++; + } - foreach (var layout in layouts) { - var source = layout; + var engines = get_ibus ().list_active_engines (); - source = source.replace (" ", "+"); - source = source.replace ("\t", "+"); + foreach (var engine in engines) { + if (length == 0 || engine.name.has_prefix ("xkb")) { + var source = "us"; + string? layout = engine.get_layout (); + string? variant = engine.get_layout_variant (); - builder.add ("(ss)", "xkb", source); - length++; - } + if (layout != null && ((!) layout).length == 0) { + layout = null; + } - var engines = get_ibus ().list_active_engines (); + if (variant != null && ((!) variant).length == 0) { + variant = null; + } - foreach (var engine in engines) { - if (length == 0 || engine.name.has_prefix ("xkb")) { - var source = "us"; - string? layout = engine.get_layout (); - string? variant = engine.get_layout_variant (); + if (layout != null && variant != null) { + source = @"$((!) layout)+$((!) variant)"; + } else if (layout != null) { + source = (!) layout; + } - if (layout != null && ((!) layout).length == 0) { - layout = null; + builder.add ("(ss)", "xkb", source); + length++; } - if (variant != null && ((!) variant).length == 0) { - variant = null; + if (!engine.name.has_prefix ("xkb")) { + builder.add ("(ss)", "ibus", engine.name); + length++; } + } - if (layout != null && variant != null) { - source = @"$((!) layout)+$((!) variant)"; - } else if (layout != null) { - source = (!) layout; - } + source_settings.set_value ("sources", builder.end ()); + indicator_settings.set_boolean ("migrated", true); + } + } + } - builder.add ("(ss)", "xkb", source); - length++; + [DBus (visible = false)] + private void migrate_input_sources () { + var list = new Gee.LinkedList (); + var added = new Gee.HashSet (); + + foreach (var user in users) { + if (user.is_loaded) { + var sources = user.input_sources; + var layouts = user.xkeyboard_layouts; + + VariantIter outer; + VariantIter inner; + + sources.get ("aa{ss}", out outer); + + while (outer.next ("a{ss}", out inner)) { + unowned string key; + unowned string source; + + while (inner.next ("{&s&s}", out key, out source)) { + if (key == "xkb") { + if (!added.contains (source)) { + list.add (source); + added.add (source); + } + } + } } - if (!engine.name.has_prefix ("xkb")) { - builder.add ("(ss)", "ibus", engine.name); - length++; + foreach (var layout in layouts) { + var source = layout; + source = source.replace (" ", "+"); + source = source.replace ("\t", "+"); + + if (!added.contains (source)) { + list.add (source); + added.add (source); + } } } + } - source_settings.set_value ("sources", builder.end ()); + var builder = new VariantBuilder (new VariantType ("a(ss)")); - indicator_settings.set_boolean ("migrated", true); + foreach (var layout in list) { + builder.add ("(ss)", "xkb", layout); + } + + source_settings.set_value ("sources", builder.end ()); + } + + [DBus (visible = false)] + private void update_login_layout () { + unowned List layouts = LightDM.get_layouts (); + var current = source_settings.get_uint ("current"); + + if (current < get_sources ().length) { + var source = get_sources ()[current]; + string? name = null; + + if (source.layout != null && source.variant != null) { + name = @"$((!) source.layout)\t$((!) source.variant)"; + } else if (source.layout != null) { + name = source.layout; + } + + if (name != null) { + foreach (var layout in layouts) { + if (layout.name == (!) name) { + LightDM.set_layout (layout); + break; + } + } + } } } [DBus (visible = false)] private void update_window_sources () { - if (use_bamf) { + if (use_bamf && !is_login_user ()) { var group_per_window = per_window_settings.get_boolean ("group-per-window"); if (group_per_window != (window_sources != null)) { @@ -318,11 +437,13 @@ public class Indicator.Keyboard.Service : Object { submenu.append_section (null, section_menu); - var section = new Menu (); - section.append (_ ("Character Map"), "indicator.map"); - section.append (_ ("Keyboard Layout Chart"), "indicator.chart"); - section.append (_ ("Text Entry Settings..."), "indicator.settings"); - submenu.append_section (null, section); + if (!is_login_user ()) { + var section = new Menu (); + section.append (_ ("Character Map"), "indicator.map"); + section.append (_ ("Keyboard Layout Chart"), "indicator.chart"); + section.append (_ ("Text Entry Settings..."), "indicator.settings"); + submenu.append_section (null, section); + } var indicator = new MenuItem.submenu ("x", submenu); indicator.set_attribute ("x-canonical-type", "s", "com.canonical.indicator.root"); @@ -349,6 +470,7 @@ public class Indicator.Keyboard.Service : Object { [DBus (visible = false)] private void handle_changed_current (string key) { update_indicator_action (); + update_login_layout (); } [DBus (visible = false)] @@ -357,6 +479,7 @@ public class Indicator.Keyboard.Service : Object { update_sources_menu (); update_indicator_action (); + update_login_layout (); } [DBus (visible = false)] -- cgit v1.2.3 From 85051b7265ab4d468e64e5277467ba48e1cfcdd5 Mon Sep 17 00:00:00 2001 From: Jeremy Bicha Date: Thu, 22 Aug 2013 10:39:06 -0400 Subject: Drop debian/README.source and build-depends on quilt --- debian/README.source | 58 ---------------------------------------------------- debian/control | 1 - 2 files changed, 59 deletions(-) delete mode 100644 debian/README.source (limited to 'debian/control') diff --git a/debian/README.source b/debian/README.source deleted file mode 100644 index 5dde0bf8..00000000 --- a/debian/README.source +++ /dev/null @@ -1,58 +0,0 @@ -This package uses quilt to manage all modifications to the upstream -source. Changes are stored in the source package as diffs in -debian/patches and applied during the build. - -To configure quilt to use debian/patches instead of patches, you want -either to export QUILT_PATCHES=debian/patches in your environment -or use this snippet in your ~/.quiltrc: - - for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do - if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then - export QUILT_PATCHES=debian/patches - break - fi - done - -To get the fully patched source after unpacking the source package, cd to -the root level of the source package and run: - - quilt push -a - -The last patch listed in debian/patches/series will become the current -patch. - -To add a new set of changes, first run quilt push -a, and then run: - - quilt new - -where is a descriptive name for the patch, used as the filename in -debian/patches. Then, for every file that will be modified by this patch, -run: - - quilt add - -before editing those files. You must tell quilt with quilt add what files -will be part of the patch before making changes or quilt will not work -properly. After editing the files, run: - - quilt refresh - -to save the results as a patch. - -Alternately, if you already have an external patch and you just want to -add it to the build system, run quilt push -a and then: - - quilt import -P /path/to/patch - quilt push -a - -(add -p 0 to quilt import if needed). as above is the filename to -use in debian/patches. The last quilt push -a will apply the patch to -make sure it works properly. - -To remove an existing patch from the list of patches that will be applied, -run: - - quilt delete - -You may need to run quilt pop -a to unapply patches first before running -this command. diff --git a/debian/control b/debian/control index b9757366..63e20ab6 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,6 @@ Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: William Hua Build-Depends: debhelper (>= 9.0.0), - quilt, dh-autoreconf, dh-translations, dbus, -- cgit v1.2.3