Hello community,
here is the log from the commit of package scim
checked in at Thu Aug 10 23:01:30 CEST 2006.
--------
--- scim/scim.changes 2006-06-15 04:30:40.000000000 +0200
+++ scim/scim.changes 2006-08-10 18:22:44.000000000 +0200
@@ -1,0 +2,6 @@
+Thu Aug 10 18:22:12 CEST 2006 - mfabian@suse.de
+
+- Bugzilla #198374: "SCIM gtk immodule bug for non-standard gtk
+ application": add patch by the author Zhe Su .
+
+-------------------------------------------------------------------
New:
----
bugzilla-198374-gtk-immodule-bug-for-non-standard-gtk-application.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ scim.spec ++++++
--- /var/tmp/diff_new_pack.pW89qL/_old 2006-08-10 23:01:19.000000000 +0200
+++ /var/tmp/diff_new_pack.pW89qL/_new 2006-08-10 23:01:19.000000000 +0200
@@ -14,7 +14,7 @@
BuildRequires: docbook-xsl-stylesheets doxygen gcc-c++ graphviz gtk2-devel intltool libxslt perl-XML-Parser update-desktop-files
Summary: Smart Chinese/Common Input Method platform
Version: 1.4.4
-Release: 23
+Release: 24
License: LGPL
Group: System/I18n/Chinese
Autoreqprov: on
@@ -35,11 +35,12 @@
Patch2: bugzilla-159436-x11-frontend-helper-operation.patch
Patch3: bugzilla-163522-xim-server-returns-unexpected-data.patch
Patch4: bugzilla-185176-transfer-empty-lookuptable.patch
+Patch5: bugzilla-198374-gtk-immodule-bug-for-non-standard-gtk-application.patch
Patch100: gettextize.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
-SCIM is a developing platform to significant reduce the difficulty of
+SCIM is a developing platform to significantly reduce the difficulty of
input method development.
@@ -83,6 +84,7 @@
%patch2
%patch3 -p1
%patch4 -p0
+%patch5 -p0
%if %suse_version == 810
pushd /
%patch100 -p0 -b .gettextize
@@ -310,6 +312,9 @@
%{_includedir}/scim-1.0
%changelog -n scim
+* Thu Aug 10 2006 - mfabian@suse.de
+- Bugzilla #198374: "SCIM gtk immodule bug for non-standard gtk
+ application": add patch by the author Zhe Su .
* Thu Jun 15 2006 - zsu@suse.de
- Bugzilla #185176: Fixed a bug which prevents empty LookupTable
from being handled correctly by scim::Transaction.
++++++ bugzilla-198374-gtk-immodule-bug-for-non-standard-gtk-application.patch ++++++
--- extras/gtk2_immodule/gtkimcontextscim.cpp.old 2006-08-09 18:09:39.000000000 +0800
+++ extras/gtk2_immodule/gtkimcontextscim.cpp 2006-08-10 21:52:09.000000000 +0800
@@ -23,7 +23,7 @@
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
- * $Id: gtkimcontextscim.cpp,v 1.170.2.1 2005/12/30 08:50:09 suzhe Exp $
+ * $Id: gtkimcontextscim.cpp,v 1.170.2.5 2006/08/10 05:16:16 suzhe Exp $
*/
#define Uses_SCIM_DEBUG
@@ -77,6 +77,8 @@
#define SCIM_KEYBOARD_ICON_FILE (SCIM_ICONDIR "/keyboard.png")
#endif
+#define SCIM_CONFIG_FRONTEND_GTK_IMMODULE_USE_KEY_SNOOPER "/FrontEnd/GtkIMModule/UseKeySnooper"
+
/* Typedef */
struct _GtkIMContextSCIMImpl
{
@@ -91,6 +93,7 @@
gboolean use_preedit;
bool is_on;
bool shared_si;
+ bool preedit_started;
GtkIMContextSCIMImpl *next;
};
@@ -303,6 +306,7 @@
static bool _on_the_spot = true;
static bool _shared_input_method = false;
+static bool _use_key_snooper = true;
// A hack to shutdown the immodule cleanly even if im_module_exit () is not called when exiting.
class FinalizeHandler
@@ -536,6 +540,8 @@
context_scim->impl->is_on = FALSE;
context_scim->impl->shared_si = _shared_input_method;
context_scim->impl->use_preedit = _on_the_spot;
+ context_scim->impl->preedit_started = false;
+
context_scim->id = _context_count++;
if (_shared_input_method)
@@ -634,10 +640,17 @@
GtkIMContextSCIM *context_scim = GTK_IM_CONTEXT_SCIM (context);
- if (context_scim && context_scim->slave)
- return gtk_im_context_filter_keypress (context_scim->slave, event);
+ gboolean ret = FALSE;
+
+ if (context_scim) {
+ if (!_snooper_installed)
+ ret = gtk_scim_key_snooper (0, event, 0);
+
+ if (!ret && context_scim->slave)
+ ret = gtk_im_context_filter_keypress (context_scim->slave, event);
+ }
- return FALSE;
+ return ret;
}
static void
@@ -664,7 +677,8 @@
if (_focused_ic)
gtk_im_context_scim_focus_out (GTK_IM_CONTEXT (_focused_ic));
- if (!_snooper_installed) {
+ // Only use key snooper when use_key_snooper option is enabled and a gtk main loop is running.
+ if (_use_key_snooper && !_snooper_installed && gtk_main_level () > 0) {
_snooper_id = gtk_key_snooper_install ((GtkKeySnoopFunc)gtk_scim_key_snooper, NULL);
_snooper_installed = true;
}
@@ -695,6 +709,7 @@
context_scim->impl->preedit_string.clear ();
context_scim->impl->preedit_attrlist.clear ();
context_scim->impl->preedit_caret = 0;
+ context_scim->impl->preedit_started = false;
need_cap = true;
need_reset = true;
need_reg = true;
@@ -707,6 +722,7 @@
context_scim->impl->preedit_string.clear ();
context_scim->impl->preedit_attrlist.clear ();
context_scim->impl->preedit_caret = 0;
+ context_scim->impl->preedit_started = false;
attach_instance (context_scim->impl->si);
need_cap = true;
need_reg = true;
@@ -1371,8 +1387,11 @@
if (_shared_input_method)
_config->write (String (SCIM_CONFIG_FRONTEND_IM_OPENED_BY_DEFAULT), true);
- if (ic->impl->use_preedit && ic->impl->preedit_string.length ())
- g_signal_emit_by_name(ic, "preedit_changed");
+ if (ic->impl->use_preedit && ic->impl->preedit_string.length ()) {
+ g_signal_emit_by_name(ic, "preedit-start");
+ g_signal_emit_by_name(ic, "preedit-changed");
+ ic->impl->preedit_started = true;
+ }
}
}
@@ -1393,8 +1412,11 @@
if (_shared_input_method)
_config->write (String (SCIM_CONFIG_FRONTEND_IM_OPENED_BY_DEFAULT), false);
- if (ic->impl->use_preedit && ic->impl->preedit_string.length ())
- g_signal_emit_by_name(ic, "preedit_changed");
+ if (ic->impl->use_preedit && ic->impl->preedit_string.length ()) {
+ g_signal_emit_by_name(ic, "preedit-changed");
+ g_signal_emit_by_name(ic, "preedit-end");
+ ic->impl->preedit_started = false;
+ }
}
}
@@ -1926,10 +1948,16 @@
GtkIMContextSCIM *ic = static_cast (si->get_frontend_data ());
if (ic && ic->impl && _focused_ic == ic) {
- if (ic->impl->use_preedit)
- g_signal_emit_by_name(_focused_ic, "preedit_changed");
- else
+ if (ic->impl->use_preedit) {
+ if (!ic->impl->preedit_started) {
+ g_signal_emit_by_name(_focused_ic, "preedit-start");
+ ic->impl->preedit_started = true;
+ }
+ if (ic->impl->preedit_string.length ())
+ g_signal_emit_by_name(_focused_ic, "preedit-changed");
+ } else {
_panel_client.show_preedit_string (ic->id);
+ }
}
}
@@ -1971,7 +1999,11 @@
emit = true;
}
if (ic->impl->use_preedit) {
- if (emit) g_signal_emit_by_name(ic, "preedit_changed");
+ if (emit) g_signal_emit_by_name(ic, "preedit-changed");
+ if (ic->impl->preedit_started) {
+ g_signal_emit_by_name(ic, "preedit-end");
+ ic->impl->preedit_started = false;
+ }
} else {
_panel_client.hide_preedit_string (ic->id);
}
@@ -2009,10 +2041,15 @@
if (ic && ic->impl && _focused_ic == ic && ic->impl->preedit_caret != caret) {
ic->impl->preedit_caret = caret;
- if (ic->impl->use_preedit)
- g_signal_emit_by_name(ic, "preedit_changed");
- else
+ if (ic->impl->use_preedit) {
+ if (!ic->impl->preedit_started) {
+ g_signal_emit_by_name(_focused_ic, "preedit-start");
+ ic->impl->preedit_started = true;
+ }
+ g_signal_emit_by_name(ic, "preedit-changed");
+ } else {
_panel_client.update_preedit_caret (ic->id, caret);
+ }
}
}
@@ -2029,8 +2066,12 @@
ic->impl->preedit_string = str;
ic->impl->preedit_attrlist = attrs;
if (ic->impl->use_preedit) {
+ if (!ic->impl->preedit_started) {
+ g_signal_emit_by_name(_focused_ic, "preedit-start");
+ ic->impl->preedit_started = true;
+ }
ic->impl->preedit_caret = str.length ();
- g_signal_emit_by_name(ic, "preedit_changed");
+ g_signal_emit_by_name(ic, "preedit-changed");
} else {
_panel_client.update_preedit_string (ic->id, str, attrs);
}
@@ -2073,7 +2114,7 @@
if (ic && _focused_ic == ic) {
GdkEventKey gdkevent = keyevent_scim_to_gdk (ic, key);
if (!_fallback_instance->process_key_event (key) &&
- !gtk_im_context_filter_keypress (GTK_IM_CONTEXT (ic), &gdkevent)) {
+ !gtk_im_context_filter_keypress (GTK_IM_CONTEXT (ic->slave), &gdkevent)) {
// To avoid timing issue, we need emit the signal directly, rather than put the event into the queue.
if (_focused_widget) {
@@ -2240,6 +2281,7 @@
_on_the_spot = config->read (String (SCIM_CONFIG_FRONTEND_ON_THE_SPOT), _on_the_spot);
_shared_input_method = config->read (String (SCIM_CONFIG_FRONTEND_SHARED_INPUT_METHOD), _shared_input_method);
+ _use_key_snooper = config->read (String (SCIM_CONFIG_FRONTEND_GTK_IMMODULE_USE_KEY_SNOOPER), _use_key_snooper);
// Get keyboard layout setting
// Flush the global config first, in order to load the new configs from disk.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...