mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-23 20:30:15 +00:00
[ patch from Takashi Matsuda <matsu@arch.comp.kyutech.ac.jp> ]
Wed Jan 27 21:56:07 1999 Owen Taylor <otaylor@redhat.com> [ patch from Takashi Matsuda <matsu@arch.comp.kyutech.ac.jp> ] * acconfig.h configure.in gdk/gdkim.c: Add configure flag for disabling XRegisterIMInstantiateCallback(), default it to off for Solaris. Always try to open the input method immediately, and only if that fails, register than instantiate callback. * gdk/gdkentry.c: Some tweaks to make sure that we only get and set the IC attributes when appropriate.
This commit is contained in:
parent
a472efda2d
commit
b2c8fed880
20
ChangeLog
20
ChangeLog
@ -1,3 +1,23 @@
|
||||
Wed Jan 27 21:56:07 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
[ patch from Takashi Matsuda <matsu@arch.comp.kyutech.ac.jp> ]
|
||||
|
||||
* acconfig.h configure.in gdk/gdkim.c: Add configure
|
||||
flag for disabling XRegisterIMInstantiateCallback(), default
|
||||
it to off for Solaris. Always try to open the
|
||||
input method immediately, and only if that fails,
|
||||
register than instantiate callback.
|
||||
|
||||
* gdk/gdkentry.c: Some tweaks to make sure that we
|
||||
only get and set the IC attributes when appropriate.
|
||||
|
||||
Wed Jan 27 20:08:54 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkfilesel.c (open_user_dir): Patch from
|
||||
Sebastian Wilhelmi <wilhelmi@ira.uka.de> to
|
||||
use g_get_home_dir() instead of calling getpwuid()
|
||||
ourselves.
|
||||
|
||||
Wed Jan 27 20:06:06 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtklayout.c (gtk_layout_adjustment_changed):
|
||||
|
@ -1,3 +1,23 @@
|
||||
Wed Jan 27 21:56:07 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
[ patch from Takashi Matsuda <matsu@arch.comp.kyutech.ac.jp> ]
|
||||
|
||||
* acconfig.h configure.in gdk/gdkim.c: Add configure
|
||||
flag for disabling XRegisterIMInstantiateCallback(), default
|
||||
it to off for Solaris. Always try to open the
|
||||
input method immediately, and only if that fails,
|
||||
register than instantiate callback.
|
||||
|
||||
* gdk/gdkentry.c: Some tweaks to make sure that we
|
||||
only get and set the IC attributes when appropriate.
|
||||
|
||||
Wed Jan 27 20:08:54 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkfilesel.c (open_user_dir): Patch from
|
||||
Sebastian Wilhelmi <wilhelmi@ira.uka.de> to
|
||||
use g_get_home_dir() instead of calling getpwuid()
|
||||
ourselves.
|
||||
|
||||
Wed Jan 27 20:06:06 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtklayout.c (gtk_layout_adjustment_changed):
|
||||
|
@ -1,3 +1,23 @@
|
||||
Wed Jan 27 21:56:07 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
[ patch from Takashi Matsuda <matsu@arch.comp.kyutech.ac.jp> ]
|
||||
|
||||
* acconfig.h configure.in gdk/gdkim.c: Add configure
|
||||
flag for disabling XRegisterIMInstantiateCallback(), default
|
||||
it to off for Solaris. Always try to open the
|
||||
input method immediately, and only if that fails,
|
||||
register than instantiate callback.
|
||||
|
||||
* gdk/gdkentry.c: Some tweaks to make sure that we
|
||||
only get and set the IC attributes when appropriate.
|
||||
|
||||
Wed Jan 27 20:08:54 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkfilesel.c (open_user_dir): Patch from
|
||||
Sebastian Wilhelmi <wilhelmi@ira.uka.de> to
|
||||
use g_get_home_dir() instead of calling getpwuid()
|
||||
ourselves.
|
||||
|
||||
Wed Jan 27 20:06:06 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtklayout.c (gtk_layout_adjustment_changed):
|
||||
|
@ -1,3 +1,23 @@
|
||||
Wed Jan 27 21:56:07 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
[ patch from Takashi Matsuda <matsu@arch.comp.kyutech.ac.jp> ]
|
||||
|
||||
* acconfig.h configure.in gdk/gdkim.c: Add configure
|
||||
flag for disabling XRegisterIMInstantiateCallback(), default
|
||||
it to off for Solaris. Always try to open the
|
||||
input method immediately, and only if that fails,
|
||||
register than instantiate callback.
|
||||
|
||||
* gdk/gdkentry.c: Some tweaks to make sure that we
|
||||
only get and set the IC attributes when appropriate.
|
||||
|
||||
Wed Jan 27 20:08:54 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkfilesel.c (open_user_dir): Patch from
|
||||
Sebastian Wilhelmi <wilhelmi@ira.uka.de> to
|
||||
use g_get_home_dir() instead of calling getpwuid()
|
||||
ourselves.
|
||||
|
||||
Wed Jan 27 20:06:06 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtklayout.c (gtk_layout_adjustment_changed):
|
||||
|
@ -1,3 +1,23 @@
|
||||
Wed Jan 27 21:56:07 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
[ patch from Takashi Matsuda <matsu@arch.comp.kyutech.ac.jp> ]
|
||||
|
||||
* acconfig.h configure.in gdk/gdkim.c: Add configure
|
||||
flag for disabling XRegisterIMInstantiateCallback(), default
|
||||
it to off for Solaris. Always try to open the
|
||||
input method immediately, and only if that fails,
|
||||
register than instantiate callback.
|
||||
|
||||
* gdk/gdkentry.c: Some tweaks to make sure that we
|
||||
only get and set the IC attributes when appropriate.
|
||||
|
||||
Wed Jan 27 20:08:54 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkfilesel.c (open_user_dir): Patch from
|
||||
Sebastian Wilhelmi <wilhelmi@ira.uka.de> to
|
||||
use g_get_home_dir() instead of calling getpwuid()
|
||||
ourselves.
|
||||
|
||||
Wed Jan 27 20:06:06 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtklayout.c (gtk_layout_adjustment_changed):
|
||||
|
@ -1,3 +1,23 @@
|
||||
Wed Jan 27 21:56:07 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
[ patch from Takashi Matsuda <matsu@arch.comp.kyutech.ac.jp> ]
|
||||
|
||||
* acconfig.h configure.in gdk/gdkim.c: Add configure
|
||||
flag for disabling XRegisterIMInstantiateCallback(), default
|
||||
it to off for Solaris. Always try to open the
|
||||
input method immediately, and only if that fails,
|
||||
register than instantiate callback.
|
||||
|
||||
* gdk/gdkentry.c: Some tweaks to make sure that we
|
||||
only get and set the IC attributes when appropriate.
|
||||
|
||||
Wed Jan 27 20:08:54 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkfilesel.c (open_user_dir): Patch from
|
||||
Sebastian Wilhelmi <wilhelmi@ira.uka.de> to
|
||||
use g_get_home_dir() instead of calling getpwuid()
|
||||
ourselves.
|
||||
|
||||
Wed Jan 27 20:06:06 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtklayout.c (gtk_layout_adjustment_changed):
|
||||
|
@ -1,3 +1,23 @@
|
||||
Wed Jan 27 21:56:07 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
[ patch from Takashi Matsuda <matsu@arch.comp.kyutech.ac.jp> ]
|
||||
|
||||
* acconfig.h configure.in gdk/gdkim.c: Add configure
|
||||
flag for disabling XRegisterIMInstantiateCallback(), default
|
||||
it to off for Solaris. Always try to open the
|
||||
input method immediately, and only if that fails,
|
||||
register than instantiate callback.
|
||||
|
||||
* gdk/gdkentry.c: Some tweaks to make sure that we
|
||||
only get and set the IC attributes when appropriate.
|
||||
|
||||
Wed Jan 27 20:08:54 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkfilesel.c (open_user_dir): Patch from
|
||||
Sebastian Wilhelmi <wilhelmi@ira.uka.de> to
|
||||
use g_get_home_dir() instead of calling getpwuid()
|
||||
ourselves.
|
||||
|
||||
Wed Jan 27 20:06:06 1999 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtklayout.c (gtk_layout_adjustment_changed):
|
||||
|
@ -38,6 +38,8 @@
|
||||
/* Define to enable POSIX threading awareness */
|
||||
#undef USE_PTHREADS
|
||||
|
||||
#undef XIM_INST_IS_MISSING_OR_STRANGE
|
||||
|
||||
#undef XINPUT_NONE
|
||||
#undef XINPUT_GXI
|
||||
#undef XINPUT_XFREE
|
||||
|
22
configure.in
22
configure.in
@ -64,6 +64,8 @@ AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]]
|
||||
AC_ARG_WITH(glib, [ --with-glib=DIR Use uninstalled copy of glib])
|
||||
AC_ARG_ENABLE(xim, [ --enable-xim support XIM [default=yes]],
|
||||
, enable_xim="yes")
|
||||
AC_ARG_ENABLE(xim_inst, [ --disable-xim-inst does not use xim instantiate callback],
|
||||
, enable_xim_inst="maybe")
|
||||
AC_ARG_WITH(locale, [ --with-locale=LOCALE locale name you want to use ])
|
||||
|
||||
AC_ARG_WITH(xinput, [ --with-xinput=[no/gxi/xfree] support XInput ])
|
||||
@ -290,11 +292,29 @@ AC_CHECK_LIB(X11, XConvertCase,
|
||||
|
||||
AC_CHECK_LIB(X11, XUnregisterIMInstantiateCallback,
|
||||
: ,
|
||||
enable_xim=no,
|
||||
enable_xim_inst="no",
|
||||
$x_libs)
|
||||
|
||||
# On Solaris, calling XRegisterIMInstantiateCallback seems to
|
||||
# cause an immediate segfault, so we disable it, unless
|
||||
# the user specifically forces it to be on.
|
||||
|
||||
if test x$enable_xim_inst = xmaybe ; then
|
||||
case host in
|
||||
*-*-solaris*)
|
||||
enable_xim_inst="no"
|
||||
;;
|
||||
*)
|
||||
enable_xim_inst="yes"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "x$enable_xim" = "xyes"; then
|
||||
GTK_XIM_FLAGS="-DUSE_XIM"
|
||||
if test "x$enable_xim_inst" = "xno"; then
|
||||
AC_DEFINE(XIM_INST_IS_MISSING_OR_STRANGE)
|
||||
fi
|
||||
fi
|
||||
|
||||
x_cflags="$X_CFLAGS"
|
||||
|
67
gdk/gdkim.c
67
gdk/gdkim.c
@ -54,13 +54,15 @@ typedef struct {
|
||||
gpointer value;
|
||||
} GdkImArg;
|
||||
|
||||
#ifndef XIM_INSTANTIATE_IS_MISSING_OR_STRANGE
|
||||
static void gdk_im_instantiate_cb (Display *display,
|
||||
XPointer client_data,
|
||||
XPointer call_data);
|
||||
#endif
|
||||
static void gdk_im_destroy_cb (XIM im,
|
||||
XPointer client_data,
|
||||
XPointer call_data);
|
||||
|
||||
static gint gdk_im_real_open (void);
|
||||
static void gdk_ic_real_new (GdkIC *ic);
|
||||
|
||||
static GdkICAttributesType gdk_ic_real_set_attr (GdkIC *ic,
|
||||
@ -338,39 +340,57 @@ gdk_im_destroy_cb (XIM im, XPointer client_data, XPointer call_data)
|
||||
private->xic = NULL;
|
||||
}
|
||||
|
||||
#ifndef XIM_INSTANTIATE_IS_MISSING_OR_STRANGE
|
||||
XRegisterIMInstantiateCallback (gdk_display, NULL, NULL, NULL,
|
||||
gdk_im_instantiate_cb, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef XIM_INSTANTIATE_IS_MISSING_OR_STRANGE
|
||||
static void
|
||||
gdk_im_instantiate_cb (Display *display,
|
||||
XPointer client_data, XPointer call_data)
|
||||
{
|
||||
XIMCallback destroy_cb;
|
||||
GList *node;
|
||||
|
||||
GDK_NOTE (XIM, g_message ("New IM is instantiated."));
|
||||
if (display != gdk_display)
|
||||
return;
|
||||
|
||||
XUnregisterIMInstantiateCallback (gdk_display, NULL, NULL, NULL,
|
||||
gdk_im_instantiate_cb, NULL);
|
||||
gdk_im_real_open ();
|
||||
|
||||
if (xim_im != NULL)
|
||||
XUnregisterIMInstantiateCallback (gdk_display, NULL, NULL, NULL,
|
||||
gdk_im_instantiate_cb, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
static gint
|
||||
gdk_im_real_open (void)
|
||||
{
|
||||
XIMCallback destroy_cb;
|
||||
GList *node;
|
||||
|
||||
xim_im = XOpenIM (GDK_DISPLAY(), NULL, NULL, NULL);
|
||||
if (xim_im == NULL)
|
||||
GDK_NOTE (XIM, g_warning ("Unable to open open IM."));
|
||||
|
||||
destroy_cb.callback = gdk_im_destroy_cb;
|
||||
destroy_cb.client_data = NULL;
|
||||
XSetIMValues (xim_im, XNDestroyCallback, &destroy_cb, NULL);
|
||||
|
||||
XGetIMValues (xim_im, XNQueryInputStyle, &xim_styles, NULL, NULL);
|
||||
|
||||
for (node = xim_ic_list; node != NULL; node = g_list_next(node))
|
||||
{
|
||||
GdkICPrivate *private = (GdkICPrivate *) (node->data);
|
||||
if (private->xic == NULL)
|
||||
gdk_ic_real_new ((GdkIC *)private);
|
||||
GDK_NOTE (XIM, g_warning ("Unable to open IM."));
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
destroy_cb.callback = gdk_im_destroy_cb;
|
||||
destroy_cb.client_data = NULL;
|
||||
if (NULL != XSetIMValues (xim_im, XNDestroyCallback, &destroy_cb, NULL))
|
||||
GDK_NOTE (XIM, g_warning ("Could not set destroy callback to IM. Be careful to not destroy your input method."));
|
||||
|
||||
XGetIMValues (xim_im, XNQueryInputStyle, &xim_styles, NULL, NULL);
|
||||
|
||||
for (node = xim_ic_list; node != NULL; node = g_list_next(node))
|
||||
{
|
||||
GdkICPrivate *private = (GdkICPrivate *) (node->data);
|
||||
if (private->xic == NULL)
|
||||
gdk_ic_real_new ((GdkIC *)private);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -388,10 +408,15 @@ gdk_im_open (void)
|
||||
if (!(xim_best_allowed_style & GDK_IM_STATUS_MASK))
|
||||
gdk_im_set_best_style (GDK_IM_STATUS_CALLBACKS);
|
||||
|
||||
XRegisterIMInstantiateCallback (gdk_display, NULL, NULL, NULL,
|
||||
gdk_im_instantiate_cb, NULL);
|
||||
if (gdk_im_real_open ())
|
||||
return TRUE;
|
||||
|
||||
return (xim_im != NULL);
|
||||
#ifndef XIM_INSTANTIATE_IS_MISSING_OR_STRANGE
|
||||
XRegisterIMInstantiateCallback (gdk_display, NULL, NULL, NULL,
|
||||
gdk_im_instantiate_cb, NULL);
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -54,13 +54,15 @@ typedef struct {
|
||||
gpointer value;
|
||||
} GdkImArg;
|
||||
|
||||
#ifndef XIM_INSTANTIATE_IS_MISSING_OR_STRANGE
|
||||
static void gdk_im_instantiate_cb (Display *display,
|
||||
XPointer client_data,
|
||||
XPointer call_data);
|
||||
#endif
|
||||
static void gdk_im_destroy_cb (XIM im,
|
||||
XPointer client_data,
|
||||
XPointer call_data);
|
||||
|
||||
static gint gdk_im_real_open (void);
|
||||
static void gdk_ic_real_new (GdkIC *ic);
|
||||
|
||||
static GdkICAttributesType gdk_ic_real_set_attr (GdkIC *ic,
|
||||
@ -338,39 +340,57 @@ gdk_im_destroy_cb (XIM im, XPointer client_data, XPointer call_data)
|
||||
private->xic = NULL;
|
||||
}
|
||||
|
||||
#ifndef XIM_INSTANTIATE_IS_MISSING_OR_STRANGE
|
||||
XRegisterIMInstantiateCallback (gdk_display, NULL, NULL, NULL,
|
||||
gdk_im_instantiate_cb, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef XIM_INSTANTIATE_IS_MISSING_OR_STRANGE
|
||||
static void
|
||||
gdk_im_instantiate_cb (Display *display,
|
||||
XPointer client_data, XPointer call_data)
|
||||
{
|
||||
XIMCallback destroy_cb;
|
||||
GList *node;
|
||||
|
||||
GDK_NOTE (XIM, g_message ("New IM is instantiated."));
|
||||
if (display != gdk_display)
|
||||
return;
|
||||
|
||||
XUnregisterIMInstantiateCallback (gdk_display, NULL, NULL, NULL,
|
||||
gdk_im_instantiate_cb, NULL);
|
||||
gdk_im_real_open ();
|
||||
|
||||
if (xim_im != NULL)
|
||||
XUnregisterIMInstantiateCallback (gdk_display, NULL, NULL, NULL,
|
||||
gdk_im_instantiate_cb, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
static gint
|
||||
gdk_im_real_open (void)
|
||||
{
|
||||
XIMCallback destroy_cb;
|
||||
GList *node;
|
||||
|
||||
xim_im = XOpenIM (GDK_DISPLAY(), NULL, NULL, NULL);
|
||||
if (xim_im == NULL)
|
||||
GDK_NOTE (XIM, g_warning ("Unable to open open IM."));
|
||||
|
||||
destroy_cb.callback = gdk_im_destroy_cb;
|
||||
destroy_cb.client_data = NULL;
|
||||
XSetIMValues (xim_im, XNDestroyCallback, &destroy_cb, NULL);
|
||||
|
||||
XGetIMValues (xim_im, XNQueryInputStyle, &xim_styles, NULL, NULL);
|
||||
|
||||
for (node = xim_ic_list; node != NULL; node = g_list_next(node))
|
||||
{
|
||||
GdkICPrivate *private = (GdkICPrivate *) (node->data);
|
||||
if (private->xic == NULL)
|
||||
gdk_ic_real_new ((GdkIC *)private);
|
||||
GDK_NOTE (XIM, g_warning ("Unable to open IM."));
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
destroy_cb.callback = gdk_im_destroy_cb;
|
||||
destroy_cb.client_data = NULL;
|
||||
if (NULL != XSetIMValues (xim_im, XNDestroyCallback, &destroy_cb, NULL))
|
||||
GDK_NOTE (XIM, g_warning ("Could not set destroy callback to IM. Be careful to not destroy your input method."));
|
||||
|
||||
XGetIMValues (xim_im, XNQueryInputStyle, &xim_styles, NULL, NULL);
|
||||
|
||||
for (node = xim_ic_list; node != NULL; node = g_list_next(node))
|
||||
{
|
||||
GdkICPrivate *private = (GdkICPrivate *) (node->data);
|
||||
if (private->xic == NULL)
|
||||
gdk_ic_real_new ((GdkIC *)private);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -388,10 +408,15 @@ gdk_im_open (void)
|
||||
if (!(xim_best_allowed_style & GDK_IM_STATUS_MASK))
|
||||
gdk_im_set_best_style (GDK_IM_STATUS_CALLBACKS);
|
||||
|
||||
XRegisterIMInstantiateCallback (gdk_display, NULL, NULL, NULL,
|
||||
gdk_im_instantiate_cb, NULL);
|
||||
if (gdk_im_real_open ())
|
||||
return TRUE;
|
||||
|
||||
return (xim_im != NULL);
|
||||
#ifndef XIM_INSTANTIATE_IS_MISSING_OR_STRANGE
|
||||
XRegisterIMInstantiateCallback (gdk_display, NULL, NULL, NULL,
|
||||
gdk_im_instantiate_cb, NULL);
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2189,6 +2189,9 @@ gtk_entry_update_ic_attr (GtkWidget *widget)
|
||||
GtkEditable *editable = (GtkEditable *) widget;
|
||||
GdkICAttributesType mask = 0;
|
||||
|
||||
if (editable->ic == NULL)
|
||||
return;
|
||||
|
||||
gdk_ic_get_attr (editable->ic, editable->ic_attr,
|
||||
GDK_IC_PREEDIT_FOREGROUND |
|
||||
GDK_IC_PREEDIT_BACKGROUND |
|
||||
@ -2209,6 +2212,8 @@ gtk_entry_update_ic_attr (GtkWidget *widget)
|
||||
= widget->style->base[GTK_STATE_NORMAL];
|
||||
}
|
||||
if ((gdk_ic_get_style (editable->ic) & GDK_IM_PREEDIT_POSITION) &&
|
||||
widget->style->font != NULL &&
|
||||
widget->style->font->type == GDK_FONT_FONTSET &&
|
||||
!gdk_font_equal (editable->ic_attr->preedit_fontset,
|
||||
widget->style->font))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user