diff options
author | Naohiro Aota <naota@gentoo.org> | 2013-12-25 03:45:26 +0000 |
---|---|---|
committer | Naohiro Aota <naota@gentoo.org> | 2013-12-25 03:45:26 +0000 |
commit | 4b8b4ad66976a465dad9c3eb5aa073359abb0028 (patch) | |
tree | d0d8255fff603e7dbd59a1abebabab294b5875d1 /app-i18n | |
parent | Bump for security bug 495224. (diff) | |
download | gentoo-2-4b8b4ad66976a465dad9c3eb5aa073359abb0028.tar.gz gentoo-2-4b8b4ad66976a465dad9c3eb5aa073359abb0028.tar.bz2 gentoo-2-4b8b4ad66976a465dad9c3eb5aa073359abb0028.zip |
Apply ibus-1.5.4 patch
(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key F8551514)
Diffstat (limited to 'app-i18n')
-rw-r--r-- | app-i18n/mozc/ChangeLog | 8 | ||||
-rw-r--r-- | app-i18n/mozc/files/mozc-ibus-1.5.4.patch | 299 | ||||
-rw-r--r-- | app-i18n/mozc/mozc-1.10.1390.102-r1.ebuild (renamed from app-i18n/mozc/mozc-1.10.1390.102.ebuild) | 3 |
3 files changed, 308 insertions, 2 deletions
diff --git a/app-i18n/mozc/ChangeLog b/app-i18n/mozc/ChangeLog index 2f88c2437eed..c59da05ac610 100644 --- a/app-i18n/mozc/ChangeLog +++ b/app-i18n/mozc/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-i18n/mozc # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-i18n/mozc/ChangeLog,v 1.8 2013/07/28 09:42:56 naota Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-i18n/mozc/ChangeLog,v 1.9 2013/12/25 03:45:26 naota Exp $ + +*mozc-1.10.1390.102-r1 (25 Dec 2013) + + 25 Dec 2013; Naohiro Aota <naota@gentoo.org> +files/mozc-ibus-1.5.4.patch, + +mozc-1.10.1390.102-r1.ebuild, -mozc-1.10.1390.102.ebuild: + Apply ibus-1.5.4 patch 28 Jul 2013; Naohiro Aota <naota@gentoo.org> mozc-1.10.1390.102.ebuild: Drop miss-added dep to dev-libs/protobuf. #478094 diff --git a/app-i18n/mozc/files/mozc-ibus-1.5.4.patch b/app-i18n/mozc/files/mozc-ibus-1.5.4.patch new file mode 100644 index 000000000000..619b1d251507 --- /dev/null +++ b/app-i18n/mozc/files/mozc-ibus-1.5.4.patch @@ -0,0 +1,299 @@ +Index: engine_interface.h +=================================================================== +--- unix/ibus/engine_interface.h (revision 177) ++++ unix/ibus/engine_interface.h (working copy) +@@ -106,6 +106,11 @@ + gint y, + gint w, + gint h) = 0; ++ ++ // The interface function for the "set-content-type" signal ++ virtual void SetContentType(IBusEngine *engine, ++ guint purpose, ++ guint hints) = 0; + }; + + } // namespace ibus +Index: engine_registrar.cc +=================================================================== +--- unix/ibus/engine_registrar.cc (revision 177) ++++ unix/ibus/engine_registrar.cc (working copy) +@@ -63,7 +63,9 @@ + engine_class->reset = Reset; + engine_class->set_capabilities = SetCapabilities; + engine_class->set_cursor_location = SetCursorLocation; +- ++#if defined(MOZC_ENABLE_IBUS_INPUT_PURPOSE) ++ engine_class->set_content_type = SetContentType; ++#endif // MOZC_ENABLE_IBUS_INPUT_PURPOSE + return true; + } + +@@ -87,6 +89,9 @@ + engine_class->reset = NULL; + engine_class->set_capabilities = NULL; + engine_class->set_cursor_location = NULL; ++#if defined(MOZC_ENABLE_IBUS_INPUT_PURPOSE) ++ engine_class->set_content_type = NULL; ++#endif // MOZC_ENABLE_IBUS_INPUT_PURPOSE + + mozc::ibus::EngineInterface *previous = g_engine; + g_engine = NULL; +@@ -179,5 +184,12 @@ + g_engine->SetCursorLocation(engine, x, y, w, h); + } + ++void EngineRegistrar::SetContentType( ++ IBusEngine *engine, ++ guint purpose, ++ guint hints) { ++ g_engine->SetContentType(engine, purpose, hints); ++} ++ + } // namespace ibus + } // namespace mozc +Index: engine_registrar.h +=================================================================== +--- unix/ibus/engine_registrar.h (revision 177) ++++ unix/ibus/engine_registrar.h (working copy) +@@ -84,6 +84,9 @@ + gint y, + gint w, + gint h); ++ static void SetContentType(IBusEngine *engine, ++ guint purpose, ++ guint hints); + }; + + } // namespace ibus +Index: ibus_header.h +=================================================================== +--- unix/ibus/ibus_header.h (revision 177) ++++ unix/ibus/ibus_header.h (working copy) +@@ -36,5 +36,10 @@ + #error "ibus-mozc now requires IBus>=1.4.1" + #endif // libibus (<1.4.1) + ++#if IBUS_CHECK_VERSION(1, 5, 4) ++#if !defined(MOZC_ENABLE_IBUS_INPUT_PURPOSE) ++#define MOZC_ENABLE_IBUS_INPUT_PURPOSE ++#endif // !MOZC_ENABLE_IBUS_INPUT_PURPOSE ++#endif // libibus(>=1.5.4) + + #endif // MOZC_UNIX_IBUS_IBUS_HEADER_H_ +Index: mozc_engine.cc +=================================================================== +--- unix/ibus/mozc_engine.cc (revision 177) ++++ unix/ibus/mozc_engine.cc (working copy) +@@ -372,6 +372,7 @@ + + void MozcEngine::FocusOut(IBusEngine *engine) { + GetCandidateWindowHandler(engine)->Hide(engine); ++ property_handler_->ResetContentType(engine); + + // Do not call SubmitSession or RevertSession. Preedit string will commit on + // Focus Out event automatically by ibus_engine_update_preedit_text_with_mode +@@ -397,6 +398,11 @@ + VLOG(2) << "keyval: " << keyval + << ", keycode: " << keycode + << ", modifiers: " << modifiers; ++ if (property_handler_->IsDisabled()) { ++ // It is each enginze's responsibility for ignoreing keyevents on ++ // the password field on the locked screen since IBus 1.5.4. ++ return FALSE; ++ } + + // Send current caret location to mozc_server to manage suggest window + // position. +@@ -501,6 +507,18 @@ + // Do nothing + } + ++void MozcEngine::SetContentType(IBusEngine *engine, ++ guint purpose, ++ guint hints) { ++ const bool prev_disabled = ++ property_handler_->IsDisabled(); ++ property_handler_->UpdateContentType(engine); ++ if (!prev_disabled && property_handler_->IsDisabled()) { ++ // Make sure on-going composition is reverted. ++ RevertSession(engine); ++ } ++} ++ + GType MozcEngine::GetType() { + static GType type = 0; + +Index: mozc_engine.h +=================================================================== +--- unix/ibus/mozc_engine.h (revision 177) ++++ unix/ibus/mozc_engine.h (working copy) +@@ -99,6 +99,9 @@ + gint y, + gint w, + gint h); ++ void SetContentType(IBusEngine *engine, ++ guint purpose, ++ guint hints); + + // Returns the GType which this class represents. + static GType GetType(); +Index: property_handler.cc +=================================================================== +--- unix/ibus/property_handler.cc (revision 177) ++++ unix/ibus/property_handler.cc (working copy) +@@ -61,6 +61,19 @@ + bool IsMozcToolAvailable() { + return FileUtil::FileExists(SystemUtil::GetToolPath()); + } ++ ++bool GetDisabled(IBusEngine *engine) { ++ bool disabled = false; ++#if defined(MOZC_ENABLE_IBUS_INPUT_PURPOSE) ++ guint purpose = IBUS_INPUT_PURPOSE_FREE_FORM; ++ guint hints = IBUS_INPUT_HINT_NONE; ++ ibus_engine_get_content_type(engine, &purpose, &hints); ++ disabled = (purpose == IBUS_INPUT_PURPOSE_PASSWORD || ++ purpose == IBUS_INPUT_PURPOSE_PIN); ++#endif // MOZC_ENABLE_IBUS_INPUT_PURPOSE ++ return disabled; ++} ++ + } // namespace + + PropertyHandler::PropertyHandler(MessageTranslatorInterface *translator, +@@ -71,7 +84,8 @@ + client_(client), + translator_(translator), + original_composition_mode_(kMozcEngineInitialCompositionMode), +- is_activated_(true) { ++ is_activated_(true), ++ is_disabled_(false) { + + AppendCompositionPropertyToPanel(); + #ifndef OS_CHROMEOS +@@ -105,6 +119,7 @@ + + void PropertyHandler::Register(IBusEngine *engine) { + ibus_engine_register_properties(engine, prop_root_); ++ UpdateContentType(engine); + } + + // TODO(nona): do not use kMozcEngine*** directory. +@@ -228,8 +243,34 @@ + ibus_prop_list_append(prop_root_, prop_mozc_tool_); + } + ++void PropertyHandler::UpdateContentTypeImpl(IBusEngine *engine, ++ bool disabled) { ++ const bool prev_is_disabled = is_disabled_; ++ is_disabled_ = disabled; ++ if (prev_is_disabled == is_disabled_) { ++ return; ++ } ++ const commands::CompositionMode visible_mode = ++ (prev_is_disabled && !is_disabled_ && IsActivated()) ++ ? original_composition_mode_ : ++ kMozcEnginePropertyIMEOffState->composition_mode; ++ UpdateCompositionModeIcon(engine, visible_mode); ++} ++ ++void PropertyHandler::ResetContentType(IBusEngine *engine) { ++ UpdateContentTypeImpl(engine, false); ++} ++ ++void PropertyHandler::UpdateContentType(IBusEngine *engine) { ++ UpdateContentTypeImpl(engine, GetDisabled(engine)); ++} ++ + void PropertyHandler::Update(IBusEngine *engine, + const commands::Output &output) { ++ if (IsDisabled()) { ++ return; ++ } ++ + if (output.has_status() && + (output.status().activated() != is_activated_ || + output.status().mode() != original_composition_mode_)) { +@@ -325,6 +366,10 @@ + const gchar *property_name, + guint property_state) { + #ifndef OS_CHROMEOS ++ if (IsDisabled()) { ++ return; ++ } ++ + if (prop_mozc_tool_) { + for (guint prop_index = 0; ; ++prop_index) { + IBusProperty *prop = ibus_prop_list_get( +@@ -371,9 +416,13 @@ + } + + bool PropertyHandler::IsActivated() const { +- return is_activated_; ++ return is_activated_ && !IsDisabled(); + } + ++bool PropertyHandler::IsDisabled() const { ++ return is_disabled_; ++} ++ + commands::CompositionMode PropertyHandler::GetOriginalCompositionMode() const { + return original_composition_mode_; + } +Index: property_handler.h +=================================================================== +--- unix/ibus/property_handler.h (revision 177) ++++ unix/ibus/property_handler.h (working copy) +@@ -54,14 +54,19 @@ + virtual ~PropertyHandler(); + + virtual void Register(IBusEngine *engine); ++ virtual void ResetContentType(IBusEngine *engine); ++ virtual void UpdateContentType(IBusEngine *engine); + virtual void Update(IBusEngine *engine, const commands::Output &output); + virtual void ProcessPropertyActivate(IBusEngine *engine, + const gchar *property_name, + guint property_state); + virtual bool IsActivated() const; ++ virtual bool IsDisabled() const; + virtual commands::CompositionMode GetOriginalCompositionMode() const; + + private: ++ void UpdateContentTypeImpl(IBusEngine *engine, bool disabled); ++ + // Appends composition properties into panel + void AppendCompositionPropertyToPanel(); + // Appends tool properties into panel +@@ -79,6 +84,7 @@ + scoped_ptr<MessageTranslatorInterface> translator_; + commands::CompositionMode original_composition_mode_; + bool is_activated_; ++ bool is_disabled_; + }; + + } // namespace ibus +Index: property_handler_interface.h +=================================================================== +--- unix/ibus/property_handler_interface.h (revision 177) ++++ unix/ibus/property_handler_interface.h (working copy) +@@ -45,6 +45,9 @@ + // Registers current properties into engine. + virtual void Register(IBusEngine *engine) ABSTRACT; + ++ virtual void ResetContentType(IBusEngine *engine) ABSTRACT; ++ virtual void UpdateContentType(IBusEngine *engine) ABSTRACT; ++ + // Update properties. + virtual void Update(IBusEngine *engine, + const commands::Output &output) ABSTRACT; +@@ -55,6 +58,9 @@ + // Returns if IME is activated or not. + virtual bool IsActivated() const ABSTRACT; + ++ // Returns if IME is forcesully disabled, e.g. on a password field. ++ virtual bool IsDisabled() const ABSTRACT; ++ + // Returns original composition mode before. + virtual commands::CompositionMode GetOriginalCompositionMode() const ABSTRACT; + }; diff --git a/app-i18n/mozc/mozc-1.10.1390.102.ebuild b/app-i18n/mozc/mozc-1.10.1390.102-r1.ebuild index 0b15167d37f5..1f469213d662 100644 --- a/app-i18n/mozc/mozc-1.10.1390.102.ebuild +++ b/app-i18n/mozc/mozc-1.10.1390.102-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-i18n/mozc/mozc-1.10.1390.102.ebuild,v 1.4 2013/07/28 09:42:56 naota Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-i18n/mozc/mozc-1.10.1390.102-r1.ebuild,v 1.1 2013/12/25 03:45:26 naota Exp $ EAPI="5" PYTHON_COMPAT=( python{2_6,2_7} ) @@ -65,6 +65,7 @@ src_unpack() { src_prepare() { epatch "${FILESDIR}"/${P}-drop-Werror.patch + epatch "${FILESDIR}"/${PN}-ibus-1.5.4.patch epatch_user } |