From 2ed8a1a55665fe24c7a8d5e373dfcddac3359484 Mon Sep 17 00:00:00 2001 From: Takao Fujiwara Date: Sat, 28 Apr 2012 15:13:40 +0900 Subject: [PATCH] Bumped to 1.4.99.20120428 Fixed Bug 799571 - no IME list at the session login. Fixed Bug 810415 - ibus does not handle Ctrl+space with BUTTON_PRESS. Fixed Bug 802052 - no modifiers trigger keys. Fixed Bug 803244 - IME switch Ctrl+space not working on shell text entry. --- ibus-530711-preload-sys.patch | 30 ++--- ibus-541492-xkb.patch | 173 ++++++++++++++----------- ibus-HEAD.patch | 200 ----------------------------- ibus-xx-branding-switcher-ui.patch | 176 +++++++++++++++++++++++++ ibus-xx-g-s-disable-preedit.patch | 2 +- ibus-xx-setup-frequent-lang.patch | 16 +-- ibus.spec | 25 +++- 7 files changed, 318 insertions(+), 304 deletions(-) create mode 100644 ibus-xx-branding-switcher-ui.patch diff --git a/ibus-530711-preload-sys.patch b/ibus-530711-preload-sys.patch index 1c6e2f7..4e6b847 100644 --- a/ibus-530711-preload-sys.patch +++ b/ibus-530711-preload-sys.patch @@ -1,6 +1,6 @@ -From 38cfe0622ece31d4aff2827a7d67f7250f0e0d5e Mon Sep 17 00:00:00 2001 +From f580050ab5612e1841639949781802dc6ee50fa1 Mon Sep 17 00:00:00 2001 From: fujiwarat -Date: Fri, 16 Mar 2012 20:47:35 +0900 +Date: Sat, 28 Apr 2012 13:07:57 +0900 Subject: [PATCH] Reload preload engines until users customize the list. The idea is, if users don't customize the preload_engines with ibus-setup, @@ -18,14 +18,14 @@ IBUS_PRELOAD_ENGINE_MODE_USER and users can customize the value 'preload_engines'. --- data/ibus.schemas.in | 24 +++++++++ - setup/main.py | 61 +++++++++++++++++++++-- - setup/setup.ui | 21 +++++++- + setup/main.py | 61 ++++++++++++++++++++-- + setup/setup.ui | 21 ++++++-- src/ibustypes.h | 10 ++++ ui/gtk3/panel.vala | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 245 insertions(+), 7 deletions(-) diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in -index 05c0174..8ca33ac 100644 +index 5e6c2d7..20c1bc3 100644 --- a/data/ibus.schemas.in +++ b/data/ibus.schemas.in @@ -2,6 +2,30 @@ @@ -60,7 +60,7 @@ index 05c0174..8ca33ac 100644 /desktop/ibus/general/preload_engines ibus diff --git a/setup/main.py b/setup/main.py -index 9638da0..132e9f4 100644 +index 4f57106..7612407 100644 --- a/setup/main.py +++ b/setup/main.py @@ -181,6 +181,20 @@ class Setup(object): @@ -84,7 +84,7 @@ index 9638da0..132e9f4 100644 # init engine page self.__engines = self.__bus.list_engines() value = self.__config.get_value("general", "load_xkb_layouts") -@@ -245,6 +259,7 @@ class Setup(object): +@@ -242,6 +256,7 @@ class Setup(object): self.__checkbutton_auto_start_toggled_cb) self.__config = self.__bus.get_config() @@ -92,7 +92,7 @@ index 9638da0..132e9f4 100644 self.__init_hotkey() self.__init_panel() -@@ -253,8 +268,8 @@ class Setup(object): +@@ -250,8 +265,8 @@ class Setup(object): def __combobox_notify_active_engine_cb(self, combobox, property): engine = self.__combobox.get_active_engine() button = self.__builder.get_object("button_engine_add") @@ -103,7 +103,7 @@ index 9638da0..132e9f4 100644 def __get_engine_setup_exec_args(self, engine): args = [] -@@ -333,6 +348,34 @@ class Setup(object): +@@ -330,6 +345,34 @@ class Setup(object): del self.__engine_setup_exec_list[name] self.__engine_setup_exec_list[name] = os.spawnl(os.P_NOWAIT, *args) @@ -138,7 +138,7 @@ index 9638da0..132e9f4 100644 def __init_bus(self): self.__bus = IBus.Bus() if self.__bus.is_connected(): -@@ -543,8 +586,18 @@ class Setup(object): +@@ -540,8 +583,18 @@ class Setup(object): value = GLib.Variant.new_boolean(value) self.__config.set_value("general", "use_global_engine", value) @@ -227,10 +227,10 @@ index d916265..422eb84 100644 * @x: x coordinate. * @y: y coordinate. diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala -index f8805e0..7bd0d93 100644 +index c08f188..1adb78b 100644 --- a/ui/gtk3/panel.vala +++ b/ui/gtk3/panel.vala -@@ -187,6 +187,8 @@ class Panel : IBus.PanelService { +@@ -215,6 +215,8 @@ class Panel : IBus.PanelService { if (m_config != null) { m_config.value_changed.connect(config_value_changed_cb); m_config.watch("general", "preload_engines"); @@ -239,7 +239,7 @@ index f8805e0..7bd0d93 100644 m_config.watch("general", "engines_order"); m_config.watch("panel", "custom_font"); m_config.watch("panel", "use_custom_font"); -@@ -246,7 +248,136 @@ class Panel : IBus.PanelService { +@@ -274,7 +276,136 @@ class Panel : IBus.PanelService { init_gkbd(); } @@ -376,7 +376,7 @@ index f8805e0..7bd0d93 100644 } private void update_xkb_engines() { -@@ -421,6 +552,11 @@ class Panel : IBus.PanelService { +@@ -449,6 +580,11 @@ class Panel : IBus.PanelService { string section, string name, Variant variant) { @@ -389,5 +389,5 @@ index f8805e0..7bd0d93 100644 update_engines(variant, null); return; -- -1.7.9.1 +1.7.10 diff --git a/ibus-541492-xkb.patch b/ibus-541492-xkb.patch index 352ce4e..efd0e40 100644 --- a/ibus-541492-xkb.patch +++ b/ibus-541492-xkb.patch @@ -1,20 +1,20 @@ -From c58730dd0d9c161a7824105d320f60af769e1f05 Mon Sep 17 00:00:00 2001 +From 5de26fdf6f300a4e532a39f8c3778e94ff629125 Mon Sep 17 00:00:00 2001 From: fujiwarat -Date: Fri, 16 Mar 2012 20:45:03 +0900 +Date: Sat, 28 Apr 2012 13:07:30 +0900 Subject: [PATCH] Add ibus-xkb and libgnomekbd. --- + client/x11/gdk-private.c | 3 +- configure.ac | 59 +++++ - data/ibus.schemas.in | 60 +++++- - engine/Makefile.am | 22 ++ + data/ibus.schemas.in | 102 ++++++++ + engine/Makefile.am | 20 ++ engine/ibus-xkb-main.c | 111 +++++++++ engine/main.vala | 86 +++++++ engine/simple.xml.in.in | 531 +---------------------------------------- engine/xkblib.c | 327 +++++++++++++++++++++++++ engine/xkblib.h | 41 ++++ ibus-1.0.pc.in | 4 + - setup/enginecombobox.py | 6 +- - setup/main.py | 28 ++- + setup/main.py | 25 +- src/Makefile.am | 5 + src/ibus.h | 1 + src/ibusxkbxml.c | 466 ++++++++++++++++++++++++++++++++++++ @@ -24,9 +24,9 @@ Subject: [PATCH] Add ibus-xkb and libgnomekbd. ui/gtk3/Xkl-1.0.metadata | 3 + ui/gtk3/gkbdlayout.vala.false | 63 +++++ ui/gtk3/gkbdlayout.vala.true | 111 +++++++++ - ui/gtk3/panel.vala | 275 ++++++++++++++++++++-- + ui/gtk3/panel.vala | 275 +++++++++++++++++++-- ui/gtk3/xkblayout.vala | 466 ++++++++++++++++++++++++++++++++++++ - 22 files changed, 2346 insertions(+), 555 deletions(-) + 22 files changed, 2380 insertions(+), 555 deletions(-) create mode 100644 engine/ibus-xkb-main.c create mode 100644 engine/xkblib.c create mode 100644 engine/xkblib.h @@ -38,11 +38,25 @@ Subject: [PATCH] Add ibus-xkb and libgnomekbd. create mode 100644 ui/gtk3/gkbdlayout.vala.true create mode 100644 ui/gtk3/xkblayout.vala +diff --git a/client/x11/gdk-private.c b/client/x11/gdk-private.c +index 009a5b0..20689c3 100644 +--- a/client/x11/gdk-private.c ++++ b/client/x11/gdk-private.c +@@ -27,8 +27,7 @@ + #include + #include + +-#ifdef HAVE_X11_XKBLIB_H +-# define HAVE_XKB ++#ifdef HAVE_XKB + # include + #endif + diff --git a/configure.ac b/configure.ac -index 1c4b283..596b30e 100644 +index 8498efe..731cdf5 100644 --- a/configure.ac +++ b/configure.ac -@@ -249,6 +249,63 @@ else +@@ -252,6 +252,63 @@ else enable_xim="no (disabled, use --enable-xim to enable)" fi @@ -106,7 +120,7 @@ index 1c4b283..596b30e 100644 # GObject introspection GOBJECT_INTROSPECTION_CHECK([0.6.8]) -@@ -545,5 +602,7 @@ Build options: +@@ -574,5 +631,7 @@ Build options: Panel icon "$IBUS_ICON_KEYBOARD" Enable surrounding-text $enable_surrounding_text Run test cases $enable_tests @@ -115,14 +129,13 @@ index 1c4b283..596b30e 100644 ]) diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in -index 53ba05c..05c0174 100644 +index 53ba05c..5e6c2d7 100644 --- a/data/ibus.schemas.in +++ b/data/ibus.schemas.in -@@ -34,7 +34,19 @@ +@@ -34,6 +34,62 @@ [Control+space,Zenkaku_Hankaku,Alt+Kanji,Alt+grave,Hangul,Alt+Release+Alt_R] Trigger shortcut keys -- The shortcut keys for turning input method on or off + The shortcut keys for turning input method on or off + + @@ -136,10 +149,53 @@ index 53ba05c..05c0174 100644 + + Trigger shortcut keys for gtk_accelerator_parse + The shortcut keys for turning input method on or off ++ ++ ++ ++ /schemas/desktop/ibus/general/hotkey/trigger_shift ++ /desktop/ibus/general/hotkey/trigger_shift ++ ibus ++ list ++ string ++ [] ++ ++ This is used for gnome-shell to work shift + modifiers ++ This is used for gnome-shell to work shift + modifiers ++ Currently gnome-shell assigns the shift reverse by ++ dconf key and the shift reverse works with modifiers. ++ But ibus supports multiple trigger keys; ++ <Control>space (with modifiers) ++ Zenkaku_hankaku (without modifiers) ++ I copy the modifier trigger keys here to set ++ the shift reverse at the moment. ++ ++ ++ ++ ++ /schemas/desktop/ibus/general/hotkey/trigger_ja ++ /desktop/ibus/general/hotkey/trigger_ja ++ ibus ++ list ++ string ++ [Zenkaku_Hankaku] ++ ++ Trigger shortcut keys for ja gtk_accelerator_parse ++ The shortcut keys for turning input method on or off ++ ++ ++ ++ /schemas/desktop/ibus/general/hotkey/trigger_ko ++ /desktop/ibus/general/hotkey/trigger_ko ++ ibus ++ list ++ string ++ [Hangul, Alt_R] ++ ++ Trigger shortcut keys for ko gtk_accelerator_parse + The shortcut keys for turning input method on or off - -@@ -203,6 +215,52 @@ +@@ -203,6 +259,52 @@ @@ -193,19 +249,10 @@ index 53ba05c..05c0174 100644 /desktop/ibus/panel/use_custom_font ibus diff --git a/engine/Makefile.am b/engine/Makefile.am -index b3b46be..af4747d 100644 +index b3b46be..a95736b 100644 --- a/engine/Makefile.am +++ b/engine/Makefile.am -@@ -25,6 +25,8 @@ libibus = $(top_builddir)/src/libibus-@IBUS_API_VERSION@.la - INCLUDES = \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src \ -+ -DIBUS_LOCALEDIR=\"$(datadir)/locale\" \ -+ -DLIBEXECDIR=\""$(libexecdir)"\" \ - $(NULL) - - AM_CFLAGS = \ -@@ -78,6 +80,26 @@ component_DATA = \ +@@ -78,6 +78,26 @@ component_DATA = \ componentdir = $(pkgdatadir)/component @@ -234,7 +281,7 @@ index b3b46be..af4747d 100644 $(NULL) diff --git a/engine/ibus-xkb-main.c b/engine/ibus-xkb-main.c new file mode 100644 -index 0000000..75f6679 +index 0000000..2529e4d --- /dev/null +++ b/engine/ibus-xkb-main.c @@ -0,0 +1,111 @@ @@ -302,7 +349,7 @@ index 0000000..75f6679 +#ifdef ENABLE_NLS + setlocale (LC_ALL, ""); + -+ bindtextdomain (GETTEXT_PACKAGE, IBUS_LOCALEDIR); ++ bindtextdomain (GETTEXT_PACKAGE, GLIB_LOCALE_DIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); +#endif + @@ -1391,28 +1438,11 @@ index 9f593ab..66b902a 100644 Name: IBus Description: IBus Library -diff --git a/setup/enginecombobox.py b/setup/enginecombobox.py -index 8d1424b..0ac7368 100644 ---- a/setup/enginecombobox.py -+++ b/setup/enginecombobox.py -@@ -75,7 +75,11 @@ class EngineComboBox(Gtk.ComboBox): - - keys = langs.keys() - keys.sort(locale.strcoll) -- current_lang = IBus.get_language_name(locale.getlocale()[0]) -+ loc = locale.getlocale()[0] -+ # None on C locale -+ if loc == None: -+ loc = 'en_US' -+ current_lang = IBus.get_language_name(loc) - # move current language to the first place - if current_lang in keys: - keys.remove(current_lang) diff --git a/setup/main.py b/setup/main.py -index fdfb33a..9638da0 100644 +index fdfb33a..4f57106 100644 --- a/setup/main.py +++ b/setup/main.py -@@ -183,14 +183,25 @@ class Setup(object): +@@ -183,14 +183,22 @@ class Setup(object): # init engine page self.__engines = self.__bus.list_engines() @@ -1420,15 +1450,12 @@ index fdfb33a..9638da0 100644 + load_layouts = [] + if value != None: + load_layouts = value.dup_strv()[0] -+ if len(load_layouts) == 0: -+ engines = self.__engines -+ else: -+ engines = [] -+ for engine in self.__engines: -+ if not engine.get_name().startswith('xkb:'): -+ engines.append(engine) -+ elif engine.get_layout() in load_layouts: -+ engines.append(engine) ++ engines = [] ++ for engine in self.__engines: ++ if not engine.get_name().startswith('xkb:'): ++ engines.append(engine) ++ elif engine.get_layout() in load_layouts: ++ engines.append(engine) + self.__combobox = self.__builder.get_object("combobox_engines") - self.__combobox.set_engines(self.__engines) @@ -1443,7 +1470,7 @@ index fdfb33a..9638da0 100644 self.__treeview = self.__builder.get_object("treeview_engines") self.__treeview.set_engines(engines) -@@ -263,6 +274,13 @@ class Setup(object): +@@ -263,6 +271,13 @@ class Setup(object): args.append(path.basename(setup_path)) return args @@ -1458,7 +1485,7 @@ index fdfb33a..9638da0 100644 if prop.name not in ("active-engine", "engines"): return diff --git a/src/Makefile.am b/src/Makefile.am -index b1d1766..29f0d58 100644 +index df4ada3..e249ada 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -194,6 +194,11 @@ typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) @@ -2158,7 +2185,7 @@ index 0000000..661e6fd @@ -0,0 +1 @@ +Configuration cheader_filename="libgnomekbd/gkbd-configuration.h" diff --git a/ui/gtk3/Makefile.am b/ui/gtk3/Makefile.am -index 0fb9d3c..5ccf8b0 100644 +index 87a7373..6a426fa 100644 --- a/ui/gtk3/Makefile.am +++ b/ui/gtk3/Makefile.am @@ -42,6 +42,9 @@ INCLUDES = \ @@ -2171,7 +2198,7 @@ index 0fb9d3c..5ccf8b0 100644 AM_CFLAGS = \ @GLIB2_CFLAGS@ \ @GIO2_CFLAGS@ \ -@@ -56,6 +59,10 @@ AM_CFLAGS = \ +@@ -57,6 +60,10 @@ AM_CFLAGS = \ -DBINDIR=\"@bindir@\" \ -DIBUS_DISABLE_DEPRECATED \ -DIBUS_VERSION=\"@IBUS_VERSION@\" \ @@ -2182,7 +2209,7 @@ index 0fb9d3c..5ccf8b0 100644 -Wno-unused-variable \ -Wno-unused-but-set-variable \ -Wno-unused-function \ -@@ -86,6 +93,7 @@ ibus_ui_gtk3_SOURCES = \ +@@ -87,6 +94,7 @@ ibus_ui_gtk3_SOURCES = \ application.vala \ candidatearea.vala \ candidatepanel.vala \ @@ -2190,7 +2217,7 @@ index 0fb9d3c..5ccf8b0 100644 handle.vala \ iconwidget.vala \ keybindingmanager.vala \ -@@ -94,6 +102,7 @@ ibus_ui_gtk3_SOURCES = \ +@@ -95,6 +103,7 @@ ibus_ui_gtk3_SOURCES = \ property.vala \ separator.vala \ switcher.vala \ @@ -2198,7 +2225,7 @@ index 0fb9d3c..5ccf8b0 100644 grabkeycode.c \ $(NULL) -@@ -101,12 +110,51 @@ ibus_ui_gtk3_LDADD = \ +@@ -102,12 +111,51 @@ ibus_ui_gtk3_LDADD = \ $(AM_LDADD) \ $(NULL) @@ -2446,13 +2473,13 @@ index 0000000..adacd81 + */ +} diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala -index d927491..f8805e0 100644 +index 251a65e..c08f188 100644 --- a/ui/gtk3/panel.vala +++ b/ui/gtk3/panel.vala -@@ -40,8 +40,16 @@ class Panel : IBus.PanelService { - private PropertyManager m_property_manager; +@@ -41,8 +41,16 @@ class Panel : IBus.PanelService { private GLib.Pid m_setup_pid = 0; private Gtk.AboutDialog m_about_dialog; + private Gtk.CssProvider m_css_provider; + private GkbdLayout m_gkbdlayout = null; + private XKBLayout m_xkblayout = null; + private string[] m_layouts = {}; @@ -2466,7 +2493,7 @@ index d927491..f8805e0 100644 public Panel(IBus.Bus bus) { GLib.assert(bus.is_connected()); -@@ -65,13 +73,6 @@ class Panel : IBus.PanelService { +@@ -66,13 +74,6 @@ class Panel : IBus.PanelService { m_switcher = new Switcher(); @@ -2480,7 +2507,7 @@ index d927491..f8805e0 100644 m_property_manager = new PropertyManager(); m_property_manager.property_activate.connect((k, s) => { property_activate(k, s); -@@ -82,8 +83,66 @@ class Panel : IBus.PanelService { +@@ -83,8 +84,66 @@ class Panel : IBus.PanelService { ~Panel() { var keybinding_manager = KeybindingManager.get_instance(); @@ -2549,7 +2576,7 @@ index d927491..f8805e0 100644 } private void set_custom_font() { -@@ -124,12 +183,14 @@ class Panel : IBus.PanelService { +@@ -152,12 +211,14 @@ class Panel : IBus.PanelService { } m_config = config; @@ -2564,7 +2591,7 @@ index d927491..f8805e0 100644 update_engines(m_config.get_value("general", "preload_engines"), m_config.get_value("general", "engines_order")); } else { -@@ -139,6 +200,192 @@ class Panel : IBus.PanelService { +@@ -167,6 +228,192 @@ class Panel : IBus.PanelService { set_custom_font(); } @@ -2757,7 +2784,7 @@ index d927491..f8805e0 100644 private void switch_engine(int i, bool force = false) { GLib.assert(i >= 0 && i < m_engines.length); -@@ -158,15 +405,7 @@ class Panel : IBus.PanelService { +@@ -186,15 +433,7 @@ class Panel : IBus.PanelService { return; } // set xkb layout @@ -3247,5 +3274,5 @@ index 0000000..8b75387 + */ +} -- -1.7.9.1 +1.7.10 diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch index 7dc170e..8b13789 100644 --- a/ibus-HEAD.patch +++ b/ibus-HEAD.patch @@ -1,201 +1 @@ -From fe1ec8a1b6f56ceda1f3f4bbb931cce29d946ed9 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Fri, 16 Mar 2012 21:00:28 +0900 -Subject: [PATCH] Set the custom font in ui.gtk3.CandidatePanel. - ---- - ui/gtk3/candidatearea.vala | 23 +++++++++++++++++++++++ - ui/gtk3/candidatepanel.vala | 19 +++++++++++++++++++ - ui/gtk3/panel.vala | 41 +++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 83 insertions(+), 0 deletions(-) - -diff --git a/ui/gtk3/candidatearea.vala b/ui/gtk3/candidatearea.vala -index 85a830d..5d0e8f7 100644 ---- a/ui/gtk3/candidatearea.vala -+++ b/ui/gtk3/candidatearea.vala -@@ -33,6 +33,7 @@ class CandidateArea : Gtk.Box { - private IBus.Text[] m_ibus_candidates; - private uint m_focus_candidate; - private bool m_show_cursor; -+ private Pango.FontDescription m_font_desc; - - private const string LABELS[] = { - "1.", "2.", "3.", "4.", "5.", "6.", "7.", "8.", -@@ -240,6 +241,28 @@ class CandidateArea : Gtk.Box { - hbox.pack_start(prev_button, false, false, 0); - hbox.pack_start(next_button, false, false, 0); - } -+ -+ udpate_label_font (); -+ } -+ -+ private void udpate_label_font () { -+ for (int i = 0; i < m_labels.length; i++) { -+ m_labels[i].override_font(m_font_desc); -+ } -+ -+ for (int i = 0; i < m_candidates.length; i++) { -+ m_candidates[i].override_font(m_font_desc); -+ } -+ } -+ -+ public void set_custom_font(string? font_name) { -+ if (font_name == null) { -+ m_font_desc = null; -+ } else { -+ m_font_desc = Pango.FontDescription.from_string (font_name); -+ } -+ -+ udpate_label_font (); - } - } - -diff --git a/ui/gtk3/candidatepanel.vala b/ui/gtk3/candidatepanel.vala -index a029e8f..721db18 100644 ---- a/ui/gtk3/candidatepanel.vala -+++ b/ui/gtk3/candidatepanel.vala -@@ -32,6 +32,7 @@ public class CandidatePanel : Gtk.HBox{ - private Gtk.Label m_aux_label; - private CandidateArea m_candidate_area; - private HSeparator m_hseparator; -+ private Pango.FontDescription m_font_desc; - - private Gdk.Rectangle m_cursor_location; - -@@ -268,4 +269,22 @@ public class CandidatePanel : Gtk.HBox{ - - move(x, y); - } -+ -+ public void set_custom_font(string? font_name) { -+ if (font_name == null) { -+ m_font_desc = null; -+ } else { -+ m_font_desc = Pango.FontDescription.from_string (font_name); -+ } -+ -+ if (m_preedit_label != null) { -+ m_preedit_label.override_font(m_font_desc); -+ } -+ -+ if (m_aux_label != null) { -+ m_aux_label.override_font(m_font_desc); -+ } -+ -+ m_candidate_area.set_custom_font(font_name); -+ } - } -diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala -index 53789d2..d927491 100644 ---- a/ui/gtk3/panel.vala -+++ b/ui/gtk3/panel.vala -@@ -86,6 +86,36 @@ class Panel : IBus.PanelService { - keybinding_manager.unbind(ACCELERATOR_SWITCH_IME_BACKWARD); - } - -+ private void set_custom_font() { -+ bool use_custom_font = false; -+ GLib.Variant var_use_custom_font = m_config.get_value("panel", -+ "use_custom_font"); -+ -+ if (var_use_custom_font != null) { -+ use_custom_font = var_use_custom_font.get_boolean(); -+ } -+ -+ if (use_custom_font == false) { -+ m_candidate_panel.set_custom_font(null); -+ return; -+ } -+ -+ string font_name = null; -+ GLib.Variant var_custom_font = m_config.get_value("panel", -+ "custom_font"); -+ if (var_custom_font != null) { -+ font_name = var_custom_font.dup_string(); -+ } -+ -+ if (font_name == null) { -+ GLib.Value value = GLib.Value(typeof(string)); -+ Gtk.Settings.get_default().get_property("gtk-font-name", ref value); -+ font_name = value.dup_string(); -+ } -+ -+ m_candidate_panel.set_custom_font(font_name); -+ } -+ - public void set_config(IBus.Config config) { - if (m_config != null) { - m_config.value_changed.disconnect(config_value_changed_cb); -@@ -98,11 +128,15 @@ class Panel : IBus.PanelService { - m_config.value_changed.connect(config_value_changed_cb); - m_config.watch("general", "preload_engines"); - m_config.watch("general", "engines_order"); -+ m_config.watch("panel", "custom_font"); -+ m_config.watch("panel", "use_custom_font"); - update_engines(m_config.get_value("general", "preload_engines"), - m_config.get_value("general", "engines_order")); - } else { - update_engines(null, null); - } -+ -+ set_custom_font(); - } - - private void switch_engine(int i, bool force = false) { -@@ -150,6 +184,13 @@ class Panel : IBus.PanelService { - Variant variant) { - if (section == "general" && name == "preload_engines") { - update_engines(variant, null); -+ return; -+ } -+ -+ if (section == "panel" && (name == "custom_font" || -+ name == "use_custom_font")) { -+ set_custom_font(); -+ return; - } - } - --- -1.7.9.1 - -From 2ce9e82bd492d6addbd629955f9c0399753e8fa2 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Sun, 18 Mar 2012 18:14:06 +0900 -Subject: [PATCH] Show language id on ibus-ui-gtk3.switcher window. - ---- - ui/gtk3/switcher.vala | 15 ++++++++++++++- - 1 files changed, 14 insertions(+), 1 deletions(-) - -diff --git a/ui/gtk3/switcher.vala b/ui/gtk3/switcher.vala -index 131cad5..73b58d2 100644 ---- a/ui/gtk3/switcher.vala -+++ b/ui/gtk3/switcher.vala -@@ -155,9 +155,22 @@ class Switcher : Gtk.Window { - for (int i = 0; i < m_engines.length; i++) { - var index = i; - var engine = m_engines[i]; -- var button = new Gtk.Button.with_label(engine.get_longname()); -+ var longname = engine.get_longname(); -+ var language = engine.get_language(); -+ var symbol = engine.get_symbol(); -+ var id = language; -+ -+ if (id.length > 2) { -+ id = id[0:2]; -+ } -+ if (symbol.length != 0) { -+ id = symbol; -+ } -+ var label = "%-15s %s".printf(longname, id); -+ var button = new Gtk.Button.with_label(label); - button.set_image(new IconWidget(engine.get_icon(), width)); - button.set_relief(Gtk.ReliefStyle.NONE); -+ button.set_alignment(1.0f, 0.0f); - button.show(); - - button.enter_notify_event.connect((e) => { --- -1.7.9.1 diff --git a/ibus-xx-branding-switcher-ui.patch b/ibus-xx-branding-switcher-ui.patch new file mode 100644 index 0000000..3d657da --- /dev/null +++ b/ibus-xx-branding-switcher-ui.patch @@ -0,0 +1,176 @@ +--- ibus-1.4.99.20120317/ui/gtk3/switcher.vala.orig 2012-04-25 18:58:37.209092997 +0900 ++++ ibus-1.4.99.20120317/ui/gtk3/switcher.vala 2012-04-25 18:59:43.017227590 +0900 +@@ -23,15 +23,20 @@ + using IBus; + using GLib; + using Gtk; ++using Pango; ++using Atk; + + class Switcher : Gtk.Window { + private Gtk.Box m_box; ++ private Gtk.Label m_label; + private Gtk.Button[] m_buttons = {}; + private IBus.EngineDesc[] m_engines; + private uint m_selected_engine; + private uint m_primary_modifier; + private GLib.MainLoop m_loop; + private int m_result; ++ private int m_default_font_size = 16; ++ private const int m_desc_label_max_len = 20; + + public Switcher() { + GLib.Object( +@@ -43,8 +48,23 @@ class Switcher : Gtk.Window { + modal : true, + focus_visible : true + ); +- m_box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); +- add(m_box); ++ Gtk.Box vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); ++ add(vbox); ++ Gtk.Alignment align = new Gtk.Alignment(0.5f, 0.5f, 0.0f, 0.0f); ++ vbox.pack_start(align, true, true, 0); ++ m_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); ++ align.add(m_box); ++ m_label = new Gtk.Label(""); ++ ++ /* Set the accessible role of the label to a status bar so it ++ * will emit name changed events that can be used by screen ++ * readers. ++ */ ++ Atk.Object obj = m_label.get_accessible(); ++ obj.set_role (Atk.Role.STATUSBAR); ++ ++ m_label.set_padding(3, 3); ++ vbox.pack_end(m_label, false, false, 0); + + grab_focus(); + } +@@ -138,6 +158,35 @@ class Switcher : Gtk.Window { + return m_result; + } + ++ private Gtk.Button ime_button_new(IBus.EngineDesc engine) { ++ var language = engine.get_language(); ++ var symbol = engine.get_symbol(); ++ var id = language; ++ ++ if (id.length > 2) { ++ id = id[0:2]; ++ } ++ if (symbol.length != 0) { ++ id = symbol; ++ } ++ ++ var button = new Gtk.Button(); ++ Gtk.Alignment align = new Gtk.Alignment(0.5f, 0.5f, 0.0f, 0.0f); ++ button.add(align); ++ Gtk.Box box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); ++ align.add(box); ++ ++ Gtk.Label label = new Gtk.Label(id); ++ string id_font = "%d".printf(m_default_font_size); ++ string markup = "%s".printf(id_font, id); ++ ++ label.set_markup(markup); ++ box.pack_start(label, false, false, 0); ++ ++ return button; ++ } ++ ++ /* Based on metacity/src/ui/tabpopup.c:meta_ui_tab_popup_new */ + private void update_engines(IBus.EngineDesc[] engines) { + foreach (var button in m_buttons) { + button.destroy(); +@@ -149,28 +198,15 @@ class Switcher : Gtk.Window { + return; + } + +- int width, height; +- Gtk.icon_size_lookup(Gtk.IconSize.MENU, out width, out height); + m_engines = engines; ++ int max_label_width = 0; ++ + for (int i = 0; i < m_engines.length; i++) { + var index = i; + var engine = m_engines[i]; ++ var button = ime_button_new(engine); + var longname = engine.get_longname(); +- var language = engine.get_language(); +- var symbol = engine.get_symbol(); +- var id = language; +- +- if (id.length > 2) { +- id = id[0:2]; +- } +- if (symbol.length != 0) { +- id = symbol; +- } +- var label = "%-15s %s".printf(longname, id); +- var button = new Gtk.Button.with_label(label); +- button.set_image(new IconWidget(engine.get_icon(), width)); + button.set_relief(Gtk.ReliefStyle.NONE); +- button.set_alignment(1.0f, 0.0f); + button.show(); + + button.enter_notify_event.connect((e) => { +@@ -186,12 +222,40 @@ class Switcher : Gtk.Window { + return true; + }); + ++ if (longname.length > m_desc_label_max_len) { ++ longname = longname[0:m_desc_label_max_len]; ++ } ++ ++ button.set_data("longname", longname); ++ m_label.set_label(longname); ++ ++ int width; ++ m_label.get_preferred_width(null, out width); ++ max_label_width = int.max(max_label_width, width); ++ + m_box.pack_start(button, true, true); + m_buttons += button; + } + +- // Cause window recalculate the perferred size. +- resize(1, 1); ++ m_label.set_text(m_buttons[0].get_data("longname")); ++ m_label.set_ellipsize(Pango.EllipsizeMode.END); ++ ++ Gdk.Display display = Gdk.Display.get_default(); ++ Gdk.Screen screen = (display != null) ? ++ display.get_default_screen() : null; ++ int screen_width = 0; ++ ++ if (screen != null) { ++ screen_width = screen.get_width(); ++ } ++ ++ if (screen_width > 0 && max_label_width > (screen_width / 4)) { ++ max_label_width = screen_width / 4; ++ } ++ ++ /* add random padding */ ++ max_label_width += 20; ++ set_default_size(max_label_width, -1); + } + + private void next_engine() { +@@ -199,6 +263,7 @@ class Switcher : Gtk.Window { + m_selected_engine = 0; + else + m_selected_engine ++; ++ m_label.set_text(m_buttons[m_selected_engine].get_data("longname")); + set_focus(m_buttons[m_selected_engine]); + } + +@@ -207,6 +272,7 @@ class Switcher : Gtk.Window { + m_selected_engine = m_engines.length - 1; + else + m_selected_engine --; ++ m_label.set_text(m_buttons[m_selected_engine].get_data("longname")); + set_focus(m_buttons[m_selected_engine]); + } + diff --git a/ibus-xx-g-s-disable-preedit.patch b/ibus-xx-g-s-disable-preedit.patch index 99b6d03..a14f1d4 100644 --- a/ibus-xx-g-s-disable-preedit.patch +++ b/ibus-xx-g-s-disable-preedit.patch @@ -19,7 +19,7 @@ index 327a5d9..39d2d0c 100644 + if (!g_getenv ("IBUS_GNOME_SHELL_ENABLE_PREEDIT_TEXT")) { + const gchar * prgname = g_get_prgname (); + if (g_strcmp0 (prgname, "gnome-shell") == 0) { -+ if (ibusimcontext->caps | IBUS_CAP_PREEDIT_TEXT) { ++ if (ibusimcontext->caps & IBUS_CAP_PREEDIT_TEXT) { + ibusimcontext->caps ^= IBUS_CAP_PREEDIT_TEXT; + } + } diff --git a/ibus-xx-setup-frequent-lang.patch b/ibus-xx-setup-frequent-lang.patch index 341ea66..ad85a08 100644 --- a/ibus-xx-setup-frequent-lang.patch +++ b/ibus-xx-setup-frequent-lang.patch @@ -1,6 +1,6 @@ -From cad2c8af84966ab88822c834bd5547067307b35d Mon Sep 17 00:00:00 2001 +From f4e54576688df705f20fb25597852a451e063cef Mon Sep 17 00:00:00 2001 From: fujiwarat -Date: Fri, 16 Mar 2012 20:48:10 +0900 +Date: Sat, 28 Apr 2012 13:08:12 +0900 Subject: [PATCH] Enable ibus-setup to show the frequently used languages only in IME list. @@ -11,10 +11,10 @@ Subject: [PATCH] Enable ibus-setup to show the frequently used languages 3 files changed, 300 insertions(+), 25 deletions(-) diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in -index 8ca33ac..7420a35 100644 +index 20c1bc3..f6b55d6 100644 --- a/data/ibus.schemas.in +++ b/data/ibus.schemas.in -@@ -296,6 +296,174 @@ se,si,sk,sy,sy(ku),th,tj,tr,ua,uz,vn +@@ -340,6 +340,174 @@ se,si,sk,sy,sy(ku),th,tj,tr,ua,uz,vn @@ -412,11 +412,11 @@ index 0ac7368..578098c 100644 return self.get_property("active-engine") diff --git a/setup/main.py b/setup/main.py -index 132e9f4..367cea8 100644 +index 7612407..1cb3e60 100644 --- a/setup/main.py +++ b/setup/main.py -@@ -212,6 +212,7 @@ class Setup(object): - engines.append(engine) +@@ -209,6 +209,7 @@ class Setup(object): + engines.append(engine) self.__combobox = self.__builder.get_object("combobox_engines") + self.__combobox.set_config(self.__config) @@ -424,5 +424,5 @@ index 132e9f4..367cea8 100644 engine_names = values.get("preload_engines", []) -- -1.7.9.1 +1.7.10 diff --git a/ibus.spec b/ibus.spec index 34eb043..e01197e 100644 --- a/ibus.spec +++ b/ibus.spec @@ -14,7 +14,7 @@ %endif %if (0%{?fedora} > 16 || 0%{?rhel} > 6) -%define ibus_gjs_version 3.3.92.20120327 +%define ibus_gjs_version 3.4.1.20120428 %define ibus_gjs_build_failure 1 %else %define ibus_gjs_version 3.2.1.20111230 @@ -29,8 +29,8 @@ %define gnome_icon_theme_legacy_version 2.91.6 Name: ibus -Version: 1.4.99.20120317 -Release: 4%{?dist} +Version: 1.4.99.20120428 +Release: 1%{?dist} Summary: Intelligent Input Bus for Linux OS License: LGPLv2+ Group: System Environment/Libraries @@ -39,7 +39,7 @@ URL: http://code.google.com/p/ibus/ Source0: http://fujiwara.fedorapeople.org/ibus/gnome-shell/%{name}-%{version}.tar.gz Source1: xinput-ibus Source2: http://fujiwara.fedorapeople.org/ibus/gnome-shell/ibus-gjs-%{ibus_gjs_version}.tar.gz -Patch0: ibus-HEAD.patch +# Patch0: ibus-HEAD.patch Patch1: ibus-541492-xkb.patch Patch2: ibus-530711-preload-sys.patch Patch3: ibus-xx-setup-frequent-lang.patch @@ -48,8 +48,10 @@ Patch3: ibus-xx-setup-frequent-lang.patch # https://bugzilla.gnome.org/show_bug.cgi?id=658420 Patch92: ibus-xx-g-s-disable-preedit.patch Patch93: ibus-771115-property-compatible.patch +# Apply GNOME Alt+Tab UI to IME switcher UI. +Patch94: ibus-xx-branding-switcher-ui.patch # Hide no nused properties in f17. -Patch94: ibus-xx-no-use.diff +Patch95: ibus-xx-no-use.diff BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -205,7 +207,7 @@ The ibus-devel-docs package contains developer documentation for ibus zcat %SOURCE2 | tar xf - %endif -%patch0 -p1 +# %patch0 -p1 %patch92 -p1 -b .g-s-preedit cp client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c || %if %with_xkbfile @@ -219,7 +221,8 @@ rm -f bindings/vala/ibus-1.0.vapi %patch93 -p1 -b .compat %endif -%patch94 -p1 -b .no-used +%patch94 -p1 -b .ime-ui +%patch95 -p1 -b .no-used %build %if %with_xkbfile @@ -459,6 +462,14 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || : %{_datadir}/gtk-doc/html/* %changelog +* Fri Apr 27 2012 Takao Fujiwara - 1.4.99.20120428-1 +- Bumped to 1.4.99.20120428 + Fixed Bug 799571 - no IME list at the session login. + Fixed Bug 810415 - ibus does not handle Ctrl+space with BUTTON_PRESS. +- Bumped to ibus-gjs 3.4.1.20120428 + Fixed Bug 802052 - no modifiers trigger keys. + Fixed Bug 803244 - IME switch Ctrl+space not working on shell text entry. + * Tue Apr 24 2012 Kalev Lember - 1.4.99.20120317-4 - Update the dconf and icon cache rpm scriptlets