[packages/uim] - gnome-panel-3.16 patch replaced by more updates from git (gtk+gnome-git patch); now compatible wit
qboosh
qboosh at pld-linux.org
Sat Feb 11 18:30:37 CET 2017
commit f72e2b22d2bb8d95ecce32468a43adee94de9db7
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sat Feb 11 18:32:20 2017 +0100
- gnome-panel-3.16 patch replaced by more updates from git (gtk+gnome-git patch); now compatible with gnome-panel 3.22
- release 4
gnome-panel-3.16.patch | 39 --
uim-gtk+gnome-git.patch | 1710 +++++++++++++++++++++++++++++++++++++++++++++++
uim.spec | 27 +-
3 files changed, 1729 insertions(+), 47 deletions(-)
---
diff --git a/uim.spec b/uim.spec
index 2b849d3..3f54b19 100644
--- a/uim.spec
+++ b/uim.spec
@@ -9,14 +9,14 @@
%bcond_without eb # EB text search support
%bcond_without m17n # m17n IM support
%bcond_without mana # mana IM support
-%bcond_with scim # scim support [broken acc. to configure]
+%bcond_with scim # scim support [broken, already removed in 1.9.0-git]
%bcond_without wnn # Wnn IM support
#
Summary: Multilingual input method library
Summary(pl.UTF-8): Biblioteka obsługująca wejście w wielu językach
Name: uim
Version: 1.8.6
-Release: 3
+Release: 4
License: GPL or BSD
Group: Libraries
#Source0Download: https://github.com/uim/uim/releases
@@ -25,7 +25,7 @@ Source0: https://github.com/uim/uim/releases/download/%{name}-%{version}/%{name}
Source1: %{name}.xinputd
Source2: %{name}-init.el
Patch0: %{name}-emacs-utf8.patch
-Patch1: gnome-panel-3.16.patch
+Patch1: %{name}-gtk+gnome-git.patch
URL: https://github.com/uim/uim/wiki
%{?with_canna:BuildRequires: Canna-devel}
%{?with_wnn:BuildRequires: FreeWnn-devel}
@@ -56,6 +56,8 @@ BuildRequires: ncurses-devel
BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: pkgconfig(libffi) >= 3.0.0
+# since 1.9.0-git for PRIME support
+#BuildRequires: prime >= 0.8.5.2
%{?with_qt3:BuildRequires: qt-devel >= 3.2.0}
%{?with_qt4:BuildRequires: qt4-qmake >= 4}
%{?with_scim:BuildRequires: scim-devel >= 1.3.0}
@@ -489,16 +491,20 @@ install -d $RPM_BUILD_ROOT%{_sysconfdir}/X11/xinit/xinput.d \
DESTDIR=$RPM_BUILD_ROOT \
UIMEL_LISP_DIR=%{_datadir}/xemacs-packages/lisp/uim-el
-%{__rm} $RPM_BUILD_ROOT%{_libdir}{,/gtk*/*/immodules,/uim/*%{?with_qt3:,/qt/plugins-mt/*}}/*.la
+%{__rm} $RPM_BUILD_ROOT%{_libdir}{,/gtk*/*/immodules,/uim/*%{?with_gnome:,/uim}%{?with_qt3:,/qt/plugins-mt/*}}/*.la
%{__sed} -e 's|@@LIB@@|%{_lib}|g' %{SOURCE1} >$RPM_BUILD_ROOT%{_sysconfdir}/X11/xinit/xinput.d/uim.conf
install -p %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/site-start.d/
install -p %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/xemacs-packages/lisp/
-mv $RPM_BUILD_ROOT%{_datadir}/uim/{installed-modules,loader}.scm $RPM_BUILD_ROOT%{_localstatedir}/lib/uim/
+%{__mv} $RPM_BUILD_ROOT%{_datadir}/uim/{installed-modules,loader}.scm $RPM_BUILD_ROOT%{_localstatedir}/lib/uim/
ln -sf %{_localstatedir}/lib/uim/installed-modules.scm $RPM_BUILD_ROOT%{_datadir}/uim/
ln -sf %{_localstatedir}/lib/uim/loader.scm $RPM_BUILD_ROOT%{_datadir}/uim/
+%if %{without scim}
+%{__rm} $RPM_BUILD_ROOT%{_datadir}/uim/{scim.scm,pixmaps/scim.svg}
+%endif
+
# OSX-specific
%{__rm} $RPM_BUILD_ROOT%{_datadir}/uim/annotation-osx-dcs.scm
@@ -679,8 +685,10 @@ fi
%exclude %{_datadir}/uim/pixmaps/mana.png
%exclude %{_datadir}/uim/pixmaps/mana.svg
%exclude %{_datadir}/uim/pixmaps/prime*.png
+%if %{with scim}
%exclude %{_datadir}/uim/pixmaps/scim.png
%exclude %{_datadir}/uim/pixmaps/scim.svg
+%endif
%exclude %{_datadir}/uim/pixmaps/sj3.png
%exclude %{_datadir}/uim/pixmaps/sj3.svg
%exclude %{_datadir}/uim/pixmaps/skk*.png
@@ -693,7 +701,9 @@ fi
%exclude %{_datadir}/uim/m17nlib*.scm
%exclude %{_datadir}/uim/mana*.scm
%exclude %{_datadir}/uim/prime*.scm
+%if %{with scim}
%exclude %{_datadir}/uim/scim.scm
+%endif
%exclude %{_datadir}/uim/sj3*.scm
%exclude %{_datadir}/uim/skk*.scm
%exclude %{_datadir}/uim/wnn*.scm
@@ -736,13 +746,14 @@ fi
%attr(755,root,root) %{_libdir}/uim-candwin-gtk3
%attr(755,root,root) %{_libdir}/uim-candwin-tbl-gtk3
%attr(755,root,root) %{_libdir}/uim-candwin-horizontal-gtk3
+%dir %{_datadir}/uim/ui
+%{_datadir}/uim/ui/uim-applet-menu.xml
%if %{with gnome}
%files gnome
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/uim-toolbar-applet-gnome3
-%{_datadir}/dbus-1/services/org.gnome.panel.applet.UimAppletFactory.service
-%{_datadir}/gnome-panel/5.0/applets/UimApplet.panel-applet
+%attr(755,root,root) %{_libdir}/uim/libuim-toolbar-applet-gnome3.so
+%{_datadir}/gnome-panel/applets/UimApplet.panel-applet
%endif
%if %{with qt3}
diff --git a/gnome-panel-3.16.patch b/gnome-panel-3.16.patch
deleted file mode 100644
index 53f63b8..0000000
--- a/gnome-panel-3.16.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- uim-1.8.6/configure.ac~ 2013-06-30 06:26:20.000000000 +0200
-+++ uim-1.8.6/configure.ac 2015-04-12 14:21:41.827256716 +0200
-@@ -898,12 +898,12 @@
- use_applet_gnome3="no"
- ;;
- yes|*)
-- PKG_CHECK_MODULES(APPLET_GNOME3, libpanelapplet-4.0, use_applet_gnome3="yes",use_applet_gnome3="no")
-+ PKG_CHECK_MODULES(APPLET_GNOME3, libpanel-applet, use_applet_gnome3="yes",use_applet_gnome3="no")
- ;;
- esac
- ],
- [
-- PKG_CHECK_MODULES(APPLET_GNOME3, libpanelapplet-4.0, use_applet_gnome3="yes",use_applet_gnome3="no")
-+ PKG_CHECK_MODULES(APPLET_GNOME3, libpanel-applet, use_applet_gnome3="yes",use_applet_gnome3="no")
- ])
-
- dnl ****************************
---- uim-1.8.6/gtk3/toolbar/applet-gnome3.c~ 2013-06-30 06:26:09.000000000 +0200
-+++ uim-1.8.6/gtk3/toolbar/applet-gnome3.c 2015-04-12 14:36:02.283917154 +0200
-@@ -168,7 +168,7 @@
- gtk_action_group_set_translation_domain(action_group, GETTEXT_PACKAGE);
- gtk_action_group_add_actions(action_group, uim_menu_actions,
- G_N_ELEMENTS(uim_menu_actions), toolbar);
-- panel_applet_setup_menu(applet, uim_menu_xml, action_group);
-+ panel_applet_setup_menu(applet, uim_menu_xml, action_group, "uim");
- #if LIBPANEL_APPLET_HAVE_SET_BACKGROUND_WIDGET
- panel_applet_set_background_widget(applet, GTK_WIDGET(applet));
- #endif
---- uim-1.8.6/gtk3/toolbar/Makefile.am~ 2013-06-30 06:26:09.000000000 +0200
-+++ uim-1.8.6/gtk3/toolbar/Makefile.am 2015-04-12 14:50:19.527244281 +0200
-@@ -18,7 +18,7 @@
- uim_toolbar_applet_gnome3_SOURCES = applet-gnome3.c \
- ../../gtk2/toolbar/common-gtk.c
-
--appletdir = $(datadir)/gnome-panel/4.0/applets
-+appletdir = $(datadir)/gnome-panel/5.0/applets
- applet_DATA = UimApplet.panel-applet
- applet_in_files = $(applet_DATA:=.in)
- applet_in_in_files = $(applet_in_files:=.in)
diff --git a/uim-gtk+gnome-git.patch b/uim-gtk+gnome-git.patch
new file mode 100644
index 0000000..91058fe
--- /dev/null
+++ b/uim-gtk+gnome-git.patch
@@ -0,0 +1,1710 @@
+diff --git a/configure.ac b/configure.ac
+index 9be879ce..0429f601 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -823,88 +823,104 @@ uim_pixmapsdir=`eval eval echo ${datadir}/${PACKAGE_TARNAME}/pixmaps`
+ AC_DEFINE_UNQUOTED(UIM_PIXMAPSDIR, "${uim_pixmapsdir}", [pixmaps directory])
+ AC_SUBST(uim_pixmapsdir)
+
+-dnl *****************************
+-dnl *** Check for Gtk Library ***
+-dnl *****************************
++dnl ******************************
++dnl *** Check for GTK+ Library ***
++dnl ******************************
+ AC_ARG_WITH(gtk2,
+ AC_HELP_STRING([--without-gtk2],
+- [don't build against Gtk+2]),
+- [
+- case $with_gtk2 in
+- no)
+- use_gtk2="no"
+- ;;
+- yes|*)
+- PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.2.0 gdk-x11-2.0, use_gtk2="yes",use_gtk2="no")
+- PKG_CHECK_MODULES(GTK2_4, gtk+-2.0 >= 2.4.0 gdk-x11-2.0, use_gtk2_4="yes",use_gtk2_4="no")
+- ;;
+- esac
+- ],
+- [ PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.2.0 gdk-x11-2.0, use_gtk2="yes",use_gtk2="no")
+- PKG_CHECK_MODULES(GTK2_4, gtk+-2.0 >= 2.4.0 gdk-x11-2.0, use_gtk2_4="yes",use_gtk2_4="no") ])
++ [do not build against GTK+2]),
++ [],
++ [with_gtk2=yes])
++
++if test "x$with_gtk2" != xno; then
++ PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.2.0 gdk-x11-2.0,
++ with_gtk2=yes, with_gtk2=no)
++ PKG_CHECK_MODULES(GTK2_4, gtk+-2.0 >= 2.4.0 gdk-x11-2.0,
++ with_gtk2_4=yes, with_gtk2_4=no)
++fi
++
++AM_CONDITIONAL(GTK2, test "x$with_gtk2" = xyes)
++AM_CONDITIONAL(GTK2_4, test "x$with_gtk2_4" = xyes)
++
++if test "x$with_gtk2" = xyes; then
++ GTK_BINARY_VERSION=`$PKG_CONFIG gtk+-2.0 --variable=gtk_binary_version`
++ GTK_LIBDIR=`$PKG_CONFIG gtk+-2.0 --variable=libdir`
++ AC_SUBST(GTK_BINARY_VERSION)
++ AC_SUBST(GTK_LIBDIR)
++ AC_DEFINE(USE_GTK2, 1, [use GTK+2])
++fi
+
+ AC_ARG_ENABLE(gnome-applet,
+ AC_HELP_STRING([--disable-gnome-applet],
+- [disable uim applet for Gnome panel]),
+- [
+- case $enable_gnome_applet in
+- no)
+- use_applet_gnome="no"
+- ;;
+- yes|*)
+- PKG_CHECK_MODULES(APPLET_GNOME, libpanelapplet-2.0, use_applet_gnome="yes",use_applet_gnome="no")
+- PKG_CHECK_MODULES(APPLET_2_14, libpanelapplet-2.0 >= 2.14.0, panelapplet_have_set_background_api="yes",panelapplet_have_set_background_api="no")
+- ;;
+- esac
+- ],
+- [
+- PKG_CHECK_MODULES(APPLET_GNOME, libpanelapplet-2.0, use_applet_gnome="yes",use_applet_gnome="no")
+- PKG_CHECK_MODULES(APPLET_2_14, libpanelapplet-2.0 >= 2.14.0, panelapplet_have_set_background_api="yes",panelapplet_have_set_background_api="no")
+- ])
++ [disable uim applet for GNOME2 panel]),
++ [],
++ [enable_gnome_applet=yes])
++
++if test "x$enable_gnome_applet" != xno; then
++ PKG_CHECK_MODULES(GNOME_APPLET, libpanelapplet-2.0,
++ enable_gnome_applet=yes, enable_gnome_applet=no)
++ PKG_CHECK_MODULES(APPLET_2_14, libpanelapplet-2.0 >= 2.14.0,
++ panelapplet_have_set_background_api=yes,
++ panelapplet_have_set_background_api=no)
++fi
+
+ if test x"$panelapplet_have_set_background_api" = xyes; then
+ AC_DEFINE(LIBPANEL_APPLET_HAVE_SET_BACKGROUND_WIDGET, 1 , [libpanel-applet have set_background api])
+ fi
+
++AM_CONDITIONAL(GNOME_APPLET, test "x$enable_gnome_applet" = xyes)
+
+-dnl ******************************
+-dnl *** Check for Gtk3 Library ***
+-dnl ******************************
++dnl *******************************
++dnl *** Check for GTK+3 Library ***
++dnl *******************************
+ AC_ARG_WITH(gtk3,
+- AC_HELP_STRING([--with-gtk3],
+- [build GTK+3 immodule and helper applications
+- @<:@default=yes@:>@]),
+- [
+- case $with_gtk3 in
+- no)
+- use_gtk3="no"
+- ;;
+- yes|*)
+- PKG_CHECK_MODULES(GTK3, gtk+-3.0, use_gtk3="yes",use_gtk3="no")
+- ;;
+- esac
+- ],
+- [
+- PKG_CHECK_MODULES(GTK3, gtk+-3.0, use_gtk3="yes",use_gtk3="no")
+- ])
++ AC_HELP_STRING([--without-gtk3],
++ [do not build GTK+3 immodule and helper applications]),
++ [],
++ [with_gtk3=yes])
++
++if test "x$with_gtk3" != xno; then
++ PKG_CHECK_MODULES(GTK3, gtk+-3.0, with_gtk3=yes, with_gtk3=no)
++fi
++
++AM_CONDITIONAL(GTK3, test "x$with_gtk3" = xyes)
++
++if test "x$with_gtk3" = xyes; then
++ AC_DEFINE(USE_GTK3, 1, [use GTK+3])
++ GTK3_BINARY_VERSION=`$PKG_CONFIG gtk+-3.0 --variable=gtk_binary_version`
++ GTK3_LIBDIR=`$PKG_CONFIG gtk+-3.0 --variable=libdir`
++ AC_SUBST(GTK3_BINARY_VERSION)
++ AC_SUBST(GTK3_LIBDIR)
++fi
+
+ AC_ARG_ENABLE(gnome3-applet,
+- AC_HELP_STRING([--enable-gnome3-applet],
+- [enable uim applet for Gnome3 panel
+- @<:@default=yes@:>@]),
+- [
+- case $enable_gnome3_applet in
+- no)
+- use_applet_gnome3="no"
+- ;;
+- yes|*)
+- PKG_CHECK_MODULES(APPLET_GNOME3, libpanelapplet-4.0, use_applet_gnome3="yes",use_applet_gnome3="no")
+- ;;
+- esac
+- ],
+- [
+- PKG_CHECK_MODULES(APPLET_GNOME3, libpanelapplet-4.0, use_applet_gnome3="yes",use_applet_gnome3="no")
+- ])
++ AC_HELP_STRING([--disable-gnome3-applet],
++ [disable uim applet for GNOME3 panel]),
++ [],
++ [enable_gnome3_applet=yes])
++
++if test "x$enable_gnome3_applet" != xno; then
++ PKG_CHECK_MODULES(GNOME3_APPLET, libpanel-applet,
++ enable_gnome3_applet=yes, enable_gnome3_applet=no)
++fi
++
++AM_CONDITIONAL(GNOME3_APPLET, test "x$enable_gnome3_applet" = xyes)
++
++if test "x$enable_gnome3_applet" = xyes; then
++ AC_ARG_WITH([libpanel-applet-dir], [], [LIBPANEL_APPLET_DIR=$withval], [LIBPANEL_APPLET_DIR=""])
++ if test "$LIBPANEL_APPLET_DIR" == ""; then
++ LIBPANEL_APPLET_DIR=`$PKG_CONFIG --variable=libpanel_applet_dir libpanel-applet`
++ fi
++ AC_SUBST(LIBPANEL_APPLET_DIR)
++fi
++
++AC_ARG_ENABLE(debug,
++ AC_HELP_STRING([--enable-debug],
++ [enable debugging]),
++ [],
++ [enable_debug=no])
++
++AM_CONDITIONAL(DEBUG, test "x$enable_debug" = xyes)
+
+ dnl ****************************
+ dnl *** Check for Qt Library ***
+diff --git a/gtk2/candwin/gtk.c b/gtk2/candwin/gtk.c
+index 3964ccd9..dfc9fc40 100644
+--- a/gtk2/candwin/gtk.c
++++ b/gtk2/candwin/gtk.c
+@@ -1,6 +1,6 @@
+ /*
+
+- Copyright (c) 2003-2013 uim Project http://code.google.com/p/uim/
++ Copyright (c) 2003-2013 uim Project https://github.com/uim/uim
+
+ All rights reserved.
+
+@@ -801,6 +801,9 @@ candwin_show_page(gchar **str)
+
+ uim_cand_win_gtk_set_page(cwin, page);
+ gtk_widget_show_all(GTK_WIDGET(cwin));
++#if GTK_CHECK_VERSION(3, 7, 8)
++ gtk_widget_queue_resize_no_redraw(cwin->view);
++#endif
+ }
+
+ static void str_parse(gchar *str)
+diff --git a/gtk2/candwin/horizontal-gtk.c b/gtk2/candwin/horizontal-gtk.c
+index 9620d223..752fb829 100644
+--- a/gtk2/candwin/horizontal-gtk.c
++++ b/gtk2/candwin/horizontal-gtk.c
+@@ -1,6 +1,6 @@
+ /*
+
+- Copyright (c) 2003-2013 uim Project http://code.google.com/p/uim/
++ Copyright (c) 2003-2013 uim Project https://github.com/uim/uim
+
+ All rights reserved.
+
+@@ -181,7 +181,11 @@ static void candwin_set_page_candidates(gchar **str);
+ static void candwin_show_page(gchar **str);
+ static void str_parse(char *str);
+ static void clear_button(struct index_button *idxbutton, gint cell_index);
++#if GTK_CHECK_VERSION(3, 4, 0)
++static void show_table(GtkGrid *view, GPtrArray *buttons);
++#else
+ static void show_table(GtkTable *view, GPtrArray *buttons);
++#endif
+ static void scale_label(GtkEventBox *button, double factor);
+
+ static void index_changed_cb(UIMCandidateWindow *cwin)
+@@ -345,8 +349,7 @@ button_clicked(GtkEventBox *button, GdkEventButton *event, gpointer data)
+ prev_selected = cwin->selected;
+ if (prev_selected) {
+ GtkWidget *label = gtk_bin_get_child(GTK_BIN(prev_selected->button));
+- gtk_widget_unmap(label);
+- gtk_widget_map(label);
++ gtk_widget_queue_draw(label);
+ }
+
+ for (i = 0; i < (gint)cwin->buttons->len; i++) {
+@@ -360,8 +363,7 @@ button_clicked(GtkEventBox *button, GdkEventButton *event, gpointer data)
+ if (p == button) {
+ GtkWidget *label = gtk_bin_get_child(GTK_BIN(button));
+ idx = idxbutton->cand_index_in_page;
+- gtk_widget_unmap(label);
+- gtk_widget_map(label);
++ gtk_widget_queue_draw(label);
+ cwin->selected = idxbutton;
+ break;
+ }
+@@ -481,8 +483,13 @@ candidate_window_init(UIMCandidateWindow *cwin)
+ GTK_POLICY_NEVER);
+ gtk_box_pack_start(GTK_BOX(cwin->vbox), cwin->scrolled_window, TRUE, TRUE, 0);
+
++#if GTK_CHECK_VERSION(3, 4, 0)
++ cwin->view = gtk_grid_new();
++ gtk_grid_set_column_spacing(GTK_GRID(cwin->view), 10);
++#else
+ cwin->view = gtk_table_new(1, DEFAULT_NR_CELLS, FALSE);
+ gtk_table_set_col_spacings(GTK_TABLE(cwin->view), 10);
++#endif
+ g_signal_connect(G_OBJECT(cwin->view), "destroy",
+ G_CALLBACK(cb_table_view_destroy), cwin->stores);
+ cwin->viewport = gtk_viewport_new(NULL, NULL);
+@@ -505,7 +512,13 @@ candidate_window_init(UIMCandidateWindow *cwin)
+ #else
+ g_signal_connect_after(label, "expose-event", G_CALLBACK(label_exposed), cwin);
+ #endif
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(button, TRUE);
++ gtk_widget_set_vexpand(button, TRUE);
++ gtk_grid_attach(GTK_GRID(cwin->view), button, col, 0, 1, 1);
++#else
+ gtk_table_attach_defaults(GTK_TABLE(cwin->view), button, col, col + 1, 0, 1);
++#endif
+ idxbutton = g_malloc(sizeof(struct index_button));
+ if (idxbutton) {
+ idxbutton->button = GTK_EVENT_BOX(button);
+@@ -579,7 +592,13 @@ assign_cellbutton(GPtrArray *buttons, gint cand_index, gint display_limit)
+ #else
+ g_signal_connect_after(label, "expose-event", G_CALLBACK(label_exposed), cwin);
+ #endif
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(button, TRUE);
++ gtk_widget_set_vexpand(button, TRUE);
++ gtk_grid_attach(GTK_GRID(cwin->view), button, cand_index, 0, 1, 1);
++#else
+ gtk_table_attach_defaults(GTK_TABLE(cwin->view), button, cand_index, cand_index + 1, 0, 1);
++#endif
+ idxbutton = g_malloc(sizeof(struct index_button));
+ if (idxbutton) {
+ idxbutton->button = GTK_EVENT_BOX(button);
+@@ -1019,12 +1038,10 @@ uim_cand_win_gtk_set_index(UIMCandidateWindow *cwin, gint index)
+ prev_selected = (gpointer)cwin->selected;
+ if (prev_selected && prev_index != cwin->candidate_index) {
+ label = gtk_bin_get_child(GTK_BIN(prev_selected->button));
+- gtk_widget_unmap(label);
+- gtk_widget_map(label);
++ gtk_widget_queue_draw(label);
+ }
+ label = gtk_bin_get_child(GTK_BIN(idxbutton->button));
+- gtk_widget_unmap(label);
+- gtk_widget_map(label);
++ gtk_widget_queue_draw(label);
+ cwin->selected = idxbutton;
+
+ /* show subwin */
+@@ -1157,8 +1174,9 @@ update_table_button(GtkTreeModel *model, GPtrArray *buttons, gint display_limit)
+ g_free(idxbutton);
+ g_ptr_array_remove_index(buttons, i);
+ }
+-
++#if !GTK_CHECK_VERSION(3, 4, 0)
+ gtk_table_resize(GTK_TABLE(cwin->view), 1, cand_index);
++#endif
+ }
+ }
+
+@@ -1185,7 +1203,11 @@ uim_cand_win_gtk_set_page(UIMCandidateWindow *cwin, gint page)
+ if (cwin->stores->pdata[new_page]) {
+ update_table_button(GTK_TREE_MODEL(cwin->stores->pdata[new_page]),
+ cwin->buttons, cwin->display_limit);
++#if GTK_CHECK_VERSION(3, 4, 0)
++ show_table(GTK_GRID(cwin->view), cwin->buttons);
++#else
+ show_table(GTK_TABLE(cwin->view), cwin->buttons);
++#endif
+ }
+
+ cwin->page_index = new_page;
+@@ -1372,7 +1394,11 @@ uim_cand_win_gtk_layout_sub_window(UIMCandidateWindow *cwin)
+ gtk_window_move(GTK_WINDOW(cwin->sub_window.window), x3, y);
+ }
+ static void
++#if GTK_CHECK_VERSION(3, 4, 0)
++show_table(GtkGrid *view, GPtrArray *buttons)
++#else
+ show_table(GtkTable *view, GPtrArray *buttons)
++#endif
+ {
+ gint col;
+
+diff --git a/gtk2/dict/word-win-gtk.c b/gtk2/dict/word-win-gtk.c
+index 64d583e4..a4c3c3ec 100644
+--- a/gtk2/dict/word-win-gtk.c
++++ b/gtk2/dict/word-win-gtk.c
+@@ -1,6 +1,6 @@
+ /*
+
+- Copyright (c) 2004-2013 uim Project http://code.google.com/p/uim/
++ Copyright (c) 2004-2013 uim Project https://github.com/uim/uim
+
+ All rights reserved.
+
+@@ -144,7 +144,7 @@ word_window_init(WordWindow *window)
+ #endif
+ gtk_container_set_border_width(GTK_CONTAINER(vbox1), 10);
+
+- /* Necessary infomation area */
++ /* Necessary information area */
+ #if GTK_CHECK_VERSION(3, 2, 0)
+ vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
+ #else
+@@ -152,7 +152,7 @@ word_window_init(WordWindow *window)
+ #endif
+ gtk_box_pack_start(GTK_BOX(vbox1), vbox2, TRUE, TRUE, 0);
+
+- label = gtk_label_new(_("Necessary infomation"));
++ label = gtk_label_new(_("Necessary information"));
+ gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+ gtk_box_pack_start(GTK_BOX(vbox2), label, TRUE, TRUE, 0);
+
+@@ -172,7 +172,7 @@ word_window_init(WordWindow *window)
+ gtk_container_add(GTK_CONTAINER(alignment),
+ word_window_necessary_create(window));
+
+- /* Additional infomation area */
++ /* Additional information area */
+ #if GTK_CHECK_VERSION(3, 2, 0)
+ vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
+ #else
+@@ -180,7 +180,7 @@ word_window_init(WordWindow *window)
+ #endif
+ gtk_box_pack_start(GTK_BOX(vbox1), vbox2, TRUE, TRUE, 0);
+
+- label = gtk_label_new (_("Additional infomation"));
++ label = gtk_label_new (_("Additional information"));
+ gtk_misc_set_alignment(GTK_MISC(label), 0.0, 1.0);
+ gtk_box_pack_start(GTK_BOX(vbox2), label, TRUE, TRUE, 0);
+
+@@ -293,27 +293,56 @@ word_window_necessary_create(WordWindow *window)
+ GtkWidget *alignment, *spin_freq;
+ int i;
+
++#if GTK_CHECK_VERSION(3, 4, 0)
++ table1 = gtk_grid_new();
++ gtk_grid_set_row_spacing(GTK_GRID(table1), 5);
++ gtk_grid_set_column_spacing(GTK_GRID(table1), 5);
++#else
+ table1 = gtk_table_new(5, 5, FALSE);
++#endif
+
+ label = gtk_label_new_with_mnemonic(_("_Phonetic:"));
+ gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(label, TRUE);
++ gtk_grid_attach(GTK_GRID(table1), label, 0, 0, 1, 1);
++#else
+ gtk_table_attach(GTK_TABLE(table1), label, 0, 1, 0, 1, GTK_FILL, 0, 5, 5);
++#endif
+
+ entry_phon = gtk_entry_new();
+ gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry_phon);
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_grid_attach(GTK_GRID(table1), entry_phon, 1, 0, 1, 1);
++#else
+ gtk_table_attach(GTK_TABLE(table1), entry_phon, 1, 2, 0, 1, 0, 0, 5, 5);
++#endif
+
+ label = gtk_label_new_with_mnemonic(_("_Literal:"));
+ gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(label, TRUE);
++ gtk_grid_attach(GTK_GRID(table1), label, 0, 1, 1, 1);
++#else
+ gtk_table_attach(GTK_TABLE(table1), label, 0, 1, 1, 2, GTK_FILL, 0, 5, 5);
++#endif
+
+ entry_desc = gtk_entry_new();
+ gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry_desc);
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_grid_attach(GTK_GRID(table1), entry_desc, 1, 1, 1, 1);
++#else
+ gtk_table_attach(GTK_TABLE(table1), entry_desc, 1, 2, 1, 2, 0, 0, 5, 5);
++#endif
+
+ label = gtk_label_new_with_mnemonic(_("Part of _Speech:"));
+ gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(label, TRUE);
++ gtk_grid_attach(GTK_GRID(table1), label, 0, 2, 1, 1);
++#else
+ gtk_table_attach(GTK_TABLE(table1), label, 0, 1, 2, 3, GTK_FILL, 0, 5, 5);
++#endif
+ {
+ GtkWidget *alignment_pos_broad;
+ gint pos_num;
+@@ -341,8 +370,15 @@ word_window_necessary_create(WordWindow *window)
+ gtk_container_add(GTK_CONTAINER(alignment_pos_broad),
+ combobox_pos_broad);
+ gtk_widget_show(alignment_pos_broad);
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(alignment_pos_broad, TRUE);
++ gtk_widget_set_vexpand(alignment_pos_broad, TRUE);
++ gtk_grid_attach(GTK_GRID(table1), alignment_pos_broad,
++ 1, 2, 1, 1);
++#else
+ gtk_table_attach(GTK_TABLE(table1), alignment_pos_broad,
+ 1, 2, 2, 3, GTK_FILL, GTK_FILL, 5, 5);
++#endif
+ gtk_combo_box_set_active(GTK_COMBO_BOX(combobox_pos_broad), 0);
+
+ g_signal_connect(G_OBJECT(combobox_pos_broad), "changed",
+@@ -352,11 +388,22 @@ word_window_necessary_create(WordWindow *window)
+ label = gtk_label_new_with_mnemonic(_("_Frequency:"));
+ gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
+ gtk_widget_show(label);
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(label, TRUE);
++ gtk_grid_attach(GTK_GRID(table1), label, 0, 4, 1, 1);
++#else
+ gtk_table_attach(GTK_TABLE(table1), label, 0, 1, 4, 5, GTK_FILL, 0, 5, 5);
++#endif
+
+ alignment = gtk_alignment_new(0.0, 0.5, 0.0, 0.0);
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(alignment, TRUE);
++ gtk_grid_attach(GTK_GRID(table1), alignment,
++ 1, 4, 1, 1);
++#else
+ gtk_table_attach(GTK_TABLE(table1), alignment,
+ 1, 2, 4, 5, GTK_FILL, 0, 5, 5);
++#endif
+ gtk_widget_show(alignment);
+ adjustment_freq = (GtkAdjustment*)gtk_adjustment_new(1.0, 1.0, 65535.0,
+ 1.0, 100.0, 0);
+@@ -378,22 +425,43 @@ word_window_additional_create(WordWindow *window)
+ GtkWidget *table;
+ GtkWidget *label, *entry, *button;
+
++#if GTK_CHECK_VERSION(3, 4, 0)
++ table = gtk_grid_new();
++ gtk_grid_set_row_spacing(GTK_GRID(table), 5);
++ gtk_grid_set_column_spacing(GTK_GRID(table), 5);
++#else
+ table = gtk_table_new(5, 5, FALSE);
++#endif
+
+ label = gtk_label_new_with_mnemonic(_("Part of Speech(_narrow):"));
+ gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
+ gtk_widget_show(label);
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(label, TRUE);
++ gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 1);
++#else
+ gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 5, 5);
++#endif
+
+ entry = gtk_entry_new();
+ gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE);
+ gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
+ gtk_widget_show(entry);
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(entry, TRUE);
++ gtk_grid_attach(GTK_GRID(table), entry, 1, 0, 1, 1);
++#else
+ gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 5, 5);
++#endif
+
+ button = gtk_button_new_with_mnemonic(_("_Browse..."));
+ gtk_widget_show(button);
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(button, TRUE);
++ gtk_grid_attach(GTK_GRID(table), button, 2, 0, 1, 1);
++#else
+ gtk_table_attach(GTK_TABLE(table), button, 2, 3, 0, 1, GTK_FILL, 0, 5, 5);
++#endif
+ g_signal_connect(G_OBJECT(button), "clicked",
+ G_CALLBACK(button_cclass_browse_clicked_cb), window);
+
+@@ -533,7 +601,7 @@ word_window_add(WordWindow *window)
+ GTK_DIALOG_MODAL,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_CLOSE,
+- "%s", _("Word registration succeded."));
++ "%s", _("Word registration succeeded."));
+ }
+
+ g_signal_connect(G_OBJECT(dialog), "response",
+@@ -563,7 +631,7 @@ word_window_validate_values(WordWindow *window)
+ GTK_DIALOG_MODAL,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+- "%s", _("Phonetic is emtpy!"));
++ "%s", _("Phonetic is empty!"));
+ g_signal_connect(G_OBJECT(dialog), "response",
+ G_CALLBACK(message_dialog_response_cb), window);
+ gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(window));
+@@ -578,7 +646,7 @@ word_window_validate_values(WordWindow *window)
+ GTK_DIALOG_MODAL,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+- "%s", _("Literal is emtpy!"));
++ "%s", _("Literal is empty!"));
+ g_signal_connect(G_OBJECT(dialog), "response",
+ G_CALLBACK(message_dialog_response_cb), window);
+ gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(window));
+@@ -596,7 +664,7 @@ word_window_validate_values(WordWindow *window)
+ GTK_DIALOG_MODAL,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+- "%s", _("Part of speech is emtpy!"));
++ "%s", _("Part of speech is empty!"));
+ g_signal_connect(G_OBJECT(dialog), "response",
+ G_CALLBACK(message_dialog_response_cb), window);
+ gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(window));
+diff --git a/gtk2/immodule/gtk-im-uim.c b/gtk2/immodule/gtk-im-uim.c
+index 940f5a63..ac2918ce 100644
+--- a/gtk2/immodule/gtk-im-uim.c
++++ b/gtk2/immodule/gtk-im-uim.c
+@@ -1,6 +1,6 @@
+ /*
+
+- Copyright (c) 2003-2013 uim Project http://code.google.com/p/uim/
++ Copyright (c) 2003-2013 uim Project https://github.com/uim/uim
+
+ All rights reserved.
+
+@@ -1283,12 +1283,13 @@ helper_read_cb(GIOChannel *channel, GIOCondition c, gpointer p)
+ }
+
+ static void
+-check_helper_connection()
++check_helper_connection(uim_context uc)
+ {
+ if (im_uim_fd < 0) {
+ im_uim_fd = uim_helper_init_client_fd(helper_disconnect_cb);
+ if (im_uim_fd >= 0) {
+ GIOChannel *channel;
++ uim_set_uim_fd(uc, im_uim_fd);
+ channel = g_io_channel_unix_new(im_uim_fd);
+ read_tag = g_io_add_watch(channel, G_IO_IN | G_IO_HUP | G_IO_ERR,
+ helper_read_cb, NULL);
+@@ -1416,7 +1417,7 @@ im_uim_focus_in(GtkIMContext *ic)
+ update_cur_toplevel(uic);
+ #endif
+
+- check_helper_connection();
++ check_helper_connection(uic->uc);
+ uim_helper_client_focus_in(uic->uc);
+ uim_prop_list_update(uic->uc);
+
+@@ -1447,7 +1448,7 @@ im_uim_focus_out(GtkIMContext *ic)
+
+ uim_focus_out_context(uic->uc);
+
+- check_helper_connection();
++ check_helper_connection(uic->uc);
+ uim_helper_client_focus_out(uic->uc);
+
+ if (uic->cwin)
+@@ -1681,7 +1682,7 @@ im_module_create(const gchar *context_id)
+ return NULL;
+ }
+
+- check_helper_connection();
++ check_helper_connection(uic->uc);
+
+ uim_set_preedit_cb(uic->uc, clear_cb, pushback_cb, update_cb);
+ uim_set_prop_list_update_cb(uic->uc, update_prop_list_cb);
+diff --git a/gtk2/immodule/key-util-gtk.c b/gtk2/immodule/key-util-gtk.c
+index 6c0c2183..27abd834 100644
+--- a/gtk2/immodule/key-util-gtk.c
++++ b/gtk2/immodule/key-util-gtk.c
+@@ -1,6 +1,6 @@
+ /*
+
+- Copyright (c) 2003-2013 uim Project http://code.google.com/p/uim/
++ Copyright (c) 2003-2013 uim Project https://github.com/uim/uim
+
+ All rights reserved.
+
+@@ -55,6 +55,7 @@
+ #endif
+
+ #include "uim/uim.h"
++#include "uim/uim-scm.h"
+ #if UIM_GTK_USE_JAPANESE_KANA_KEYBOARD_HACK
+ #include "uim/uim-x-util.h"
+ #endif
+@@ -389,6 +390,9 @@ im_uim_init_modifier_keys()
+ XFreeModifiermap(map);
+ XFree(sym);
+
++ if (uim_scm_c_bool(uim_scm_callf("require-dynlib", "s", "xkb")))
++ uim_scm_callf("%xkb-set-display", "p", display);
++
+ #if UIM_GTK_USE_JAPANESE_KANA_KEYBOARD_HACK
+ uim_x_kana_input_hack_init(display);
+ #endif
+diff --git a/gtk2/immodule/uim-cand-win-gtk.c b/gtk2/immodule/uim-cand-win-gtk.c
+index 4d282660..41590d06 100644
+--- a/gtk2/immodule/uim-cand-win-gtk.c
++++ b/gtk2/immodule/uim-cand-win-gtk.c
+@@ -1,6 +1,6 @@
+ /*
+
+- copyright (c) 2003-2013 uim Project http://code.google.com/p/uim/
++ copyright (c) 2003-2013 uim Project https://github.com/uim/uim
+
+ All rights reserved.
+
+@@ -225,7 +225,7 @@ uim_cand_win_gtk_init (UIMCandWinGtk *cwin)
+
+ gtk_widget_set_size_request(cwin->num_label, DEFAULT_MIN_WINDOW_WIDTH, -1);
+ gtk_window_set_default_size(GTK_WINDOW(cwin), DEFAULT_MIN_WINDOW_WIDTH, -1);
+- gtk_window_set_resizable(GTK_WINDOW(cwin), FALSE);
++ gtk_window_set_resizable(GTK_WINDOW(cwin), TRUE);
+ }
+
+ static void
+@@ -765,6 +765,10 @@ uim_cand_win_gtk_layout(UIMCandWinGtk *cwin,
+ }
+
+ gtk_window_move(GTK_WINDOW(cwin), x, y);
++#if GTK_CHECK_VERSION(3, 7, 8)
++ if (gtk_widget_get_mapped(cwin->view) && GTK_IS_TREE_VIEW(cwin->view))
++ gtk_widget_queue_resize_no_redraw(cwin->view);
++#endif
+
+ uim_cand_win_gtk_layout_sub_window(cwin);
+ }
+diff --git a/gtk2/immodule/uim-cand-win-horizontal-gtk.c b/gtk2/immodule/uim-cand-win-horizontal-gtk.c
+index 4fac7411..0e008cd0 100644
+--- a/gtk2/immodule/uim-cand-win-horizontal-gtk.c
++++ b/gtk2/immodule/uim-cand-win-horizontal-gtk.c
+@@ -1,6 +1,6 @@
+ /*
+
+- copyright (c) 2003-2013 uim Project http://code.google.com/p/uim/
++ copyright (c) 2003-2013 uim Project https://github.com/uim/uim
+
+ All rights reserved.
+
+@@ -68,7 +68,11 @@ static gboolean label_draw(GtkWidget *label, cairo_t *cr, gpointer data);
+ static gboolean label_exposed(GtkWidget *label, GdkEventExpose *event, gpointer data);
+ #endif
+ static void clear_button(struct index_button *idxbutton, gint cell_index);
++#if GTK_CHECK_VERSION(3, 4, 0)
++static void show_table(GtkGrid *view, GPtrArray *buttons);
++#else
+ static void show_table(GtkTable *view, GPtrArray *buttons);
++#endif
+ static void scale_label(GtkEventBox *button, double factor);
+
+
+@@ -133,8 +137,13 @@ uim_cand_win_horizontal_gtk_init (UIMCandWinHorizontalGtk *horizontal_cwin)
+ horizontal_cwin->buttons = g_ptr_array_new();
+ horizontal_cwin->selected = NULL;
+
++#if GTK_CHECK_VERSION(3, 4, 0)
++ cwin->view = gtk_grid_new();
++ gtk_grid_set_column_spacing(GTK_GRID(cwin->view), 10);
++#else
+ cwin->view = gtk_table_new(1, DEFAULT_NR_CELLS, FALSE);
+ gtk_table_set_col_spacings(GTK_TABLE(cwin->view), 10);
++#endif
+ viewport = gtk_viewport_new(NULL, NULL);
+ gtk_container_add(GTK_CONTAINER(viewport), cwin->view);
+ gtk_container_add(GTK_CONTAINER(cwin->scrolled_window), viewport);
+@@ -155,7 +164,13 @@ uim_cand_win_horizontal_gtk_init (UIMCandWinHorizontalGtk *horizontal_cwin)
+ #else
+ g_signal_connect_after(label, "expose-event", G_CALLBACK(label_exposed), horizontal_cwin);
+ #endif
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(button, TRUE);
++ gtk_widget_set_vexpand(button, TRUE);
++ gtk_grid_attach(GTK_GRID(cwin->view), button, col, 0, 1, 1);
++#else
+ gtk_table_attach_defaults(GTK_TABLE(cwin->view), button, col, col + 1, 0, 1);
++#endif
+ idxbutton = g_malloc(sizeof(struct index_button));
+ if (idxbutton) {
+ idxbutton->button = GTK_EVENT_BOX(button);
+@@ -283,8 +298,7 @@ button_clicked(GtkEventBox *button, GdkEventButton *event, gpointer data)
+ prev_selected = horizontal_cwin->selected;
+ if (prev_selected) {
+ GtkWidget *label = gtk_bin_get_child(GTK_BIN(prev_selected->button));
+- gtk_widget_unmap(label);
+- gtk_widget_map(label);
++ gtk_widget_queue_draw(label);
+ }
+
+ for (i = 0; i < (gint)horizontal_cwin->buttons->len; i++) {
+@@ -298,8 +312,7 @@ button_clicked(GtkEventBox *button, GdkEventButton *event, gpointer data)
+ if (p == button) {
+ GtkWidget *label = gtk_bin_get_child(GTK_BIN(button));
+ idx = idxbutton->cand_index_in_page;
+- gtk_widget_unmap(label);
+- gtk_widget_map(label);
++ gtk_widget_queue_draw(label);
+ horizontal_cwin->selected = idxbutton;
+ break;
+ }
+@@ -379,7 +392,14 @@ assign_cellbutton(UIMCandWinHorizontalGtk *horizontal_cwin,
+ #else
+ g_signal_connect_after(label, "expose-event", G_CALLBACK(label_exposed), horizontal_cwin);
+ #endif
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(button, TRUE);
++ gtk_widget_set_vexpand(button, TRUE);
++ gtk_grid_attach(GTK_GRID(UIM_CAND_WIN_GTK(horizontal_cwin)->view), button,
++ cand_index, 0, 1, 1);
++#else
+ gtk_table_attach_defaults(GTK_TABLE(UIM_CAND_WIN_GTK(horizontal_cwin)->view), button, cand_index, cand_index + 1, 0, 1);
++#endif
+ idxbutton = g_malloc(sizeof(struct index_button));
+ if (idxbutton) {
+ idxbutton->button = GTK_EVENT_BOX(button);
+@@ -432,12 +452,10 @@ uim_cand_win_horizontal_gtk_set_index(UIMCandWinHorizontalGtk *horizontal_cwin,
+ prev_selected = (gpointer)horizontal_cwin->selected;
+ if (prev_selected && prev_index != cwin->candidate_index) {
+ label = gtk_bin_get_child(GTK_BIN(prev_selected->button));
+- gtk_widget_unmap(label);
+- gtk_widget_map(label);
++ gtk_widget_queue_draw(label);
+ }
+ label = gtk_bin_get_child(GTK_BIN(idxbutton->button));
+- gtk_widget_unmap(label);
+- gtk_widget_map(label);
++ gtk_widget_queue_draw(label);
+ horizontal_cwin->selected = idxbutton;
+
+ /* show subwin */
+@@ -580,8 +598,9 @@ update_table_button(UIMCandWinHorizontalGtk *horizontal_cwin, guint new_page)
+ g_free(idxbutton);
+ g_ptr_array_remove_index(buttons, i);
+ }
+-
++#if !GTK_CHECK_VERSION(3, 4, 0)
+ gtk_table_resize(GTK_TABLE(cwin->view), 1, cand_index);
++#endif
+ }
+ }
+
+@@ -607,7 +626,11 @@ uim_cand_win_horizontal_gtk_set_page(UIMCandWinHorizontalGtk *horizontal_cwin, g
+ new_page = page;
+
+ update_table_button(horizontal_cwin, new_page);
++#if GTK_CHECK_VERSION(3, 4, 0)
++ show_table(GTK_GRID(cwin->view), horizontal_cwin->buttons);
++#else
+ show_table(GTK_TABLE(cwin->view), horizontal_cwin->buttons);
++#endif
+
+ cwin->page_index = new_page;
+
+@@ -629,7 +652,11 @@ uim_cand_win_horizontal_gtk_set_page(UIMCandWinHorizontalGtk *horizontal_cwin, g
+ }
+
+ static void
++#if GTK_CHECK_VERSION(3, 4, 0)
++show_table(GtkGrid *view, GPtrArray *buttons)
++#else
+ show_table(GtkTable *view, GPtrArray *buttons)
++#endif
+ {
+ gint col;
+
+diff --git a/gtk2/immodule/uim-cand-win-vertical-gtk.c b/gtk2/immodule/uim-cand-win-vertical-gtk.c
+index 8034cbd9..eec0fbeb 100644
+--- a/gtk2/immodule/uim-cand-win-vertical-gtk.c
++++ b/gtk2/immodule/uim-cand-win-vertical-gtk.c
+@@ -1,6 +1,6 @@
+ /*
+
+- copyright (c) 2011-2013 uim Project http://code.google.com/p/uim/
++ copyright (c) 2011-2013 uim Project https://github.com/uim/uim
+
+ All rights reserved.
+
+@@ -206,16 +206,19 @@ tree_selection_change(GtkTreeSelection *selection,
+ g_return_val_if_fail(indicies, TRUE);
+ idx = *indicies + cwin->display_limit * cwin->page_index;
+
++ if (path_currently_selected && cwin->candidate_index >= 0) {
++ /* if emit "index-changed" here and IM deactivates this candwin,
++ * activates new candwin and selects a candidate on new candwin
++ * from index-changed callback, SEGV occurs in gtk because gtk tries to
++ * select on old candwin after return of this tree_selection_change().
++ * To avoid SEGV, instead of emitting before selection change by gtk,
++ * emit after selection changed by gtk. */
++ cwin->index_changed = TRUE;
++ }
++
+ if (!path_currently_selected && cwin->candidate_index != idx) {
+ if (cwin->candidate_index >= 0) {
+ cwin->candidate_index = idx;
+- /* if emit "index-changed" here and IM deactivates this candwin,
+- * activates new candwin and selects a candidate on new candwin
+- * from index-changed callback, SEGV occurs in gtk because gtk tries to
+- * select on old candwin after return of this tree_selection_change().
+- * To avoid SEGV, instead of emitting before selection change by gtk,
+- * emit after selection changed by gtk. */
+- cwin->index_changed = TRUE;
+ }
+
+ uim_cand_win_gtk_update_label(cwin);
+diff --git a/gtk2/pad/ja.c b/gtk2/pad/ja.c
+index f1b87fc0..a93bc6db 100644
+--- a/gtk2/pad/ja.c
++++ b/gtk2/pad/ja.c
+@@ -1,6 +1,6 @@
+ /*
+
+- Copyright (c) 2004-2013 uim Project http://code.google.com/p/uim/
++ Copyright (c) 2004-2013 uim Project https://github.com/uim/uim
+
+ All rights reserved.
+
+@@ -264,6 +264,7 @@ gchar *line[] = {
+ };
+
+ static int uim_fd = -1;
++static unsigned int read_tag;
+
+ static GtkWidget *buttontable_create(char **table, int tablelen);
+ static GtkWidget *create_hiragana_tab(void);
+@@ -280,13 +281,34 @@ static GtkWidget *input_table_create(gchar *localename);
+ static void padbutton_clicked(GtkButton *button, gpointer user_data);
+
+
++static gboolean
++fd_read_cb(GIOChannel *channel, GIOCondition c, gpointer p)
++{
++ gchar *msg;
++ int fd = g_io_channel_unix_get_fd(channel);
++
++ uim_helper_read_proc(fd);
++
++ while ((msg = uim_helper_get_message())) {
++ /* do nothing */
++ free(msg);
++ }
++
++ return TRUE;
++}
++
+ static void
+ check_helper_connection(void)
+ {
+ if (uim_fd < 0) {
+ uim_fd = uim_helper_init_client_fd(helper_disconnect_cb);
+- if (uim_fd < 0)
+- return;
++ if (uim_fd >= 0) {
++ GIOChannel *channel;
++ channel = g_io_channel_unix_new(uim_fd);
++ read_tag = g_io_add_watch(channel, G_IO_IN | G_IO_HUP | G_IO_ERR,
++ fd_read_cb, NULL);
++ g_io_channel_unref(channel);
++ }
+ }
+ }
+
+@@ -294,6 +316,7 @@ static void
+ helper_disconnect_cb(void)
+ {
+ uim_fd = -1;
++ g_source_remove(read_tag);
+ }
+
+ static void
+@@ -321,11 +344,17 @@ buttontable_create(gchar **table, int len)
+ gint i,j;
+ gint rows = ((len-2)/ BUTTON_H_ALIGN)+1;
+
++#if GTK_CHECK_VERSION(3, 4, 0)
++ _table = gtk_grid_new();
++ gtk_grid_set_row_spacing(GTK_GRID(_table), 3);
++ gtk_grid_set_column_spacing(GTK_GRID(_table), 3);
++#else
+ _table = gtk_table_new(rows,
+ BUTTON_H_ALIGN,
+ TRUE);
+ gtk_table_set_row_spacings(GTK_TABLE(_table), 3);
+ gtk_table_set_col_spacings(GTK_TABLE(_table), 3);
++#endif
+
+ for (i=0; i < rows; i++) {
+ for (j=0; j < BUTTON_H_ALIGN; j++) {
+@@ -338,10 +367,16 @@ buttontable_create(gchar **table, int len)
+ g_signal_connect(button, "clicked",
+ G_CALLBACK(padbutton_clicked), "button");
+
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(button, TRUE);
++ gtk_widget_set_vexpand(button, TRUE);
++ gtk_grid_attach(GTK_GRID(_table), button, j, i, 1, 1);
++#else
+ gtk_table_attach_defaults(GTK_TABLE(_table),
+ button,
+ j, j + 1,
+ i, i + 1);
++#endif
+ }
+ }
+ out:
+diff --git a/gtk2/pref/gtk-custom-widgets.c b/gtk2/pref/gtk-custom-widgets.c
+index b1cdff6e..1307d7c0 100644
+--- a/gtk2/pref/gtk-custom-widgets.c
++++ b/gtk2/pref/gtk-custom-widgets.c
+@@ -1,6 +1,6 @@
+ /*
+
+- Copyright (c) 2005-2013 uim Project http://code.google.com/p/uim/
++ Copyright (c) 2005-2013 uim Project https://github.com/uim/uim
+
+ All rights reserved.
+
+@@ -1280,18 +1280,30 @@ choose_olist_clicked_cb(GtkWidget *widget, GtkEntry *olist_entry)
+ FALSE, FALSE, 4);
+ gtk_widget_show(vbox);
+
++#if GTK_CHECK_VERSION(3, 4, 0)
++ table = gtk_grid_new();
++ gtk_grid_set_row_spacing(GTK_GRID(table), 3);
++ gtk_grid_set_column_spacing(GTK_GRID(table), 3);
++#else
+ table = gtk_table_new(3, 6, FALSE);
+ gtk_table_set_row_spacings(GTK_TABLE(table), 3);
+ gtk_table_set_col_spacings(GTK_TABLE(table), 3);
++#endif
+ gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
+ gtk_widget_show(table);
+
+ /* up button */
+ button = gtk_button_new();
+ olist_pref_win.up_button = button;
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(button, TRUE);
++ gtk_widget_set_vexpand(button, TRUE);
++ gtk_grid_attach(GTK_GRID(table), button, 1, 0, 1, 1);
++#else
+ gtk_table_attach_defaults(GTK_TABLE(table), button,
+ 1, 2,
+ 0, 1);
++#endif
+ gtk_widget_show(button);
+ arrow = gtk_arrow_new(GTK_ARROW_UP, GTK_SHADOW_NONE);
+ gtk_container_add(GTK_CONTAINER(button), arrow);
+@@ -1302,9 +1314,15 @@ choose_olist_clicked_cb(GtkWidget *widget, GtkEntry *olist_entry)
+ /* down button */
+ button = gtk_button_new();
+ olist_pref_win.down_button = button;
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(button, TRUE);
++ gtk_widget_set_vexpand(button, TRUE);
++ gtk_grid_attach(GTK_GRID(table), button, 1, 2, 1, 1);
++#else
+ gtk_table_attach_defaults(GTK_TABLE(table), button,
+ 1, 2,
+ 2, 3);
++#endif
+ gtk_widget_show(button);
+ arrow = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_NONE);
+ gtk_container_add(GTK_CONTAINER(button), arrow);
+@@ -1315,9 +1333,15 @@ choose_olist_clicked_cb(GtkWidget *widget, GtkEntry *olist_entry)
+ /* left button */
+ button = gtk_button_new();
+ olist_pref_win.left_button = button;
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(button, TRUE);
++ gtk_widget_set_vexpand(button, TRUE);
++ gtk_grid_attach(GTK_GRID(table), button, 0, 1, 1, 1);
++#else
+ gtk_table_attach_defaults(GTK_TABLE(table), button,
+ 0, 1,
+ 1, 2);
++#endif
+ gtk_widget_show(button);
+ arrow = gtk_arrow_new(GTK_ARROW_LEFT, GTK_SHADOW_NONE);
+ gtk_container_add(GTK_CONTAINER(button), arrow);
+@@ -1328,9 +1352,15 @@ choose_olist_clicked_cb(GtkWidget *widget, GtkEntry *olist_entry)
+ /* right button */
+ button = gtk_button_new();
+ olist_pref_win.right_button = button;
++#if GTK_CHECK_VERSION(3, 4, 0)
++ gtk_widget_set_hexpand(button, TRUE);
++ gtk_widget_set_vexpand(button, TRUE);
++ gtk_grid_attach(GTK_GRID(table), button, 2, 1, 1, 1);
++#else
+ gtk_table_attach_defaults(GTK_TABLE(table), button,
+ 2, 3,
+ 1, 2);
++#endif
+ gtk_widget_show(button);
+ arrow = gtk_arrow_new(GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
+ gtk_container_add(GTK_CONTAINER(button), arrow);
+diff --git a/gtk2/pref/gtk.c b/gtk2/pref/gtk.c
+index 72747362..08a02fdb 100644
+--- a/gtk2/pref/gtk.c
++++ b/gtk2/pref/gtk.c
+@@ -1,6 +1,6 @@
+ /*
+
+- Copyright (c) 2005-2013 uim Project http://code.google.com/p/uim/
++ Copyright (c) 2005-2013 uim Project https://github.com/uim/uim
+
+ All rights reserved.
+
+@@ -439,8 +439,12 @@ create_group_widget(const char *group_name)
+ #else
+ vbox = gtk_vbox_new(FALSE, 8);
+ #endif
++#if GTK_CHECK_VERSION(3, 8, 0)
++ gtk_container_add(GTK_CONTAINER(scrolled_win), vbox);
++#else
+ gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_win),
+ vbox);
++#endif
+
+ gtk_container_set_border_width(GTK_CONTAINER(vbox), 4);
+
+diff --git a/gtk2/toolbar/Makefile.am b/gtk2/toolbar/Makefile.am
+index 887fb6f0..48773a56 100644
+--- a/gtk2/toolbar/Makefile.am
++++ b/gtk2/toolbar/Makefile.am
+@@ -2,15 +2,15 @@ EXTRA_DIST = GNOME_UimApplet.server.in.in
+
+ helper_defs = -DUIM_DATADIR=\""$(datadir)/@PACKAGE@"\"
+
+-if APPLET_GNOME
++if GNOME_APPLET
+ libexec_PROGRAMS = uim-toolbar-applet
+
+-uim_toolbar_applet_LDADD = @GTK2_LIBS@ @APPLET_GNOME_LIBS@ \
++uim_toolbar_applet_LDADD = @GTK2_LIBS@ @GNOME_APPLET_LIBS@ \
+ $(top_builddir)/uim/libuim-scm.la \
+ $(top_builddir)/uim/libuim.la \
+ $(top_builddir)/uim/libuim-custom.la
+ uim_toolbar_applet_CPPFLAGS = $(helper_defs) -I$(top_srcdir) -I$(top_builddir)
+-uim_toolbar_applet_CFLAGS = @GTK2_CFLAGS@ @APPLET_GNOME_CFLAGS@
++uim_toolbar_applet_CFLAGS = @GTK2_CFLAGS@ @GNOME_APPLET_CFLAGS@
+ if GCC
+ # to cancel "-std=gnu89 -pedantic -Werror" and accept the string
+ # uim_menu_xml longer than ISO C 89 maximum length (509)
+diff --git a/gtk2/toolbar/common-gtk.c b/gtk2/toolbar/common-gtk.c
+index 1deefaa6..c63519ba 100644
+--- a/gtk2/toolbar/common-gtk.c
++++ b/gtk2/toolbar/common-gtk.c
+@@ -1,6 +1,6 @@
+ /*
+
+- Copyright (c) 2003-2013 uim Project http://code.google.com/p/uim/
++ Copyright (c) 2003-2013 uim Project https://github.com/uim/uim
+
+ All rights reserved.
+
+@@ -171,31 +171,65 @@ static gboolean prop_menu_showing = FALSE;
+ static gboolean custom_enabled;
+ static gboolean with_dark_bg;
+
+-static void set_button_style(GtkWidget *button);
++static void set_button_style(GtkWidget *button, gint type);
+ static const char *safe_gettext(const char *msgid);
+ static gboolean has_n_strs(gchar **str_list, guint n);
+ static gboolean register_icon(const gchar *name);
+ static void reset_icon(void);
+
+ static void
+-set_button_style(GtkWidget *button)
++set_button_style(GtkWidget *button, gint type)
+ {
+ #if GTK_CHECK_VERSION(2, 90, 0)
+ GtkStyleContext *context = gtk_widget_get_style_context(button);
+ GtkCssProvider *provider = gtk_css_provider_new();
+- gtk_css_provider_load_from_data(provider,
+- "#uim-systray-button {\n"
+- " -GtkWidget-focus-line-width: 0;\n"
+- " -GtkWidget-focus-padding: 0;\n"
+- " padding-top: 0;\n"
+- " padding-bottom: 0;\n"
+- "}\n", -1, NULL);
++ switch (type) {
++ case TYPE_ICON:
++ gtk_css_provider_load_from_data(provider,
++ "#uim-systray-button {\n"
++#if GTK_CHECK_VERSION(3, 14, 0)
++ " outline-width: 0;\n"
++#else
++ " -GtkWidget-focus-line-width: 0;\n"
++ " -GtkWidget-focus-padding: 0;\n"
++#endif
++ " padding-top: 0;\n"
++ " padding-bottom: 0;\n"
++ " padding-left: 2px;\n"
++ " padding-right: 2px;\n"
++ "}\n", -1, NULL);
++ break;
++ case TYPE_STANDALONE:
++ gtk_css_provider_load_from_data(provider,
++ "#uim-toolbar-button {\n"
++ " padding-left: 5px;\n"
++ " padding-right: 5px;\n"
++ "}\n", -1, NULL);
++ break;
++ case TYPE_APPLET:
++ gtk_css_provider_load_from_data(provider,
++ "#uim-applet-button {\n"
++ " padding-left: 2px;\n"
++ " padding-right: 2px;\n"
++ "}\n", -1, NULL);
++ break;
++ }
+ gtk_style_context_add_provider(context,
+ GTK_STYLE_PROVIDER(provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref(provider);
+ #endif
+- gtk_widget_set_name(button, "uim-systray-button");
++ switch (type) {
++ case TYPE_ICON:
++ gtk_widget_set_name(button, "uim-systray-button");
++ break;
++ case TYPE_STANDALONE:
++ gtk_widget_set_name(button, "uim-toolbar-button");
++ break;
++ case TYPE_APPLET:
++ gtk_widget_set_name(button, "uim-applet-button");
++ break;
++ }
+ }
+
+ static const char *
+@@ -605,14 +639,11 @@ tool_button_destroy(gpointer data, gpointer user_data)
+ gtk_widget_destroy(GTK_WIDGET(data));
+ }
+
+-static GtkWidget *
+-prop_button_create(GtkWidget *widget, const gchar *icon_name,
+- const gchar *label, const gchar *tip_text)
++static GtkWidget*
++button_create(GtkWidget *widget, GtkSizeGroup *sg, const gchar *icon_name,
++ const gchar *label, gint type)
+ {
+ GtkWidget *button;
+- GtkSizeGroup *sg;
+-
+- sg = g_object_get_data(G_OBJECT(widget), OBJECT_DATA_SIZE_GROUP);
+
+ if (register_icon(icon_name)) {
+ GtkWidget *img = gtk_image_new_from_stock(icon_name, GTK_ICON_SIZE_MENU);
+@@ -622,18 +653,35 @@ prop_button_create(GtkWidget *widget, const gchar *icon_name,
+ button = gtk_button_new_with_label(label);
+ }
+
+- if (GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget),
+- OBJECT_DATA_TOOLBAR_TYPE)) == TYPE_ICON)
+- set_button_style(button);
++ set_button_style(button, type);
+
+ gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
+ gtk_size_group_add_widget(sg, button);
+ g_object_set_data(G_OBJECT(button), OBJECT_DATA_BUTTON_TYPE,
+ GINT_TO_POINTER(BUTTON_PROP));
+- gtk_widget_set_tooltip_text(button, tip_text);
+
+ g_signal_connect(G_OBJECT(button), "button-press-event",
+ G_CALLBACK(button_pressed), widget);
++
++ return button;
++}
++
++static GtkWidget *
++prop_button_create(GtkWidget *widget, const gchar *icon_name,
++ const gchar *label, const gchar *tip_text)
++{
++ GtkWidget *button;
++ GtkSizeGroup *sg;
++ gint type;
++
++ sg = g_object_get_data(G_OBJECT(widget), OBJECT_DATA_SIZE_GROUP);
++ type = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget),
++ OBJECT_DATA_TOOLBAR_TYPE));
++
++ button = button_create(widget, sg, icon_name, label, type);
++
++ gtk_widget_set_tooltip_text(button, tip_text);
++
+ g_signal_connect(G_OBJECT(button), "button-release-event",
+ G_CALLBACK(prop_button_released), widget);
+
+@@ -829,9 +877,9 @@ helper_toolbar_prop_list_update(GtkWidget *widget, gchar **lines)
+
+ tool_button = gtk_button_new();
+
+- if (GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget),
+- OBJECT_DATA_TOOLBAR_TYPE)) == TYPE_ICON)
+- set_button_style(tool_button);
++ set_button_style(tool_button,
++ GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget),
++ OBJECT_DATA_TOOLBAR_TYPE)));
+
+ g_object_set_data(G_OBJECT(tool_button), OBJECT_DATA_BUTTON_TYPE,
+ GINT_TO_POINTER(BUTTON_TOOL));
+@@ -1102,24 +1150,9 @@ toolbar_new(gint type)
+ sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+
+ /* prop menu button */
+- if (register_icon("uim-icon")) {
+- GtkWidget *img = gtk_image_new_from_stock("uim-icon", GTK_ICON_SIZE_MENU);
+- button = gtk_button_new();
+- gtk_container_add(GTK_CONTAINER(button), img);
+- } else {
+- button = gtk_button_new_with_label(" x");
+- }
++ button = button_create(hbox, sg, "uim-icon", " x", type);
+
+- if (type == TYPE_ICON)
+- set_button_style(button);
+-
+- gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
+- gtk_size_group_add_widget(sg, button);
+- g_signal_connect(G_OBJECT(button), "button-press-event",
+- G_CALLBACK(button_pressed), hbox);
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
+- g_object_set_data(G_OBJECT(button), OBJECT_DATA_BUTTON_TYPE,
+- GINT_TO_POINTER(BUTTON_PROP));
+
+ prop_buttons = g_list_append(prop_buttons, button);
+
+diff --git a/gtk2/toolbar/eggtrayicon.c b/gtk2/toolbar/eggtrayicon.c
+index 7c0f51f9..6d944ca6 100644
+--- a/gtk2/toolbar/eggtrayicon.c
++++ b/gtk2/toolbar/eggtrayicon.c
+@@ -727,8 +727,14 @@ egg_tray_icon_realize (GtkWidget *widget)
+ if (icon->manager_visual_rgba)
+ {
+ /* Set a transparent background */
++#if GTK_CHECK_VERSION(3, 4, 0)
++ GdkRGBA transparent = { 0, 0, 0, 0 };
++ gdk_window_set_background_rgba (gtk_widget_get_window(widget),
++ &transparent);
++#else
+ GdkColor transparent = { 0, 0, 0, 0 }; /* Only pixel=0 matters */
+ gdk_window_set_background (gtk_widget_get_window(widget), &transparent);
++#endif
+ }
+ else
+ {
+diff --git a/gtk3/immodule/Makefile.am b/gtk3/immodule/Makefile.am
+index 40554967..18c26f5f 100644
+--- a/gtk3/immodule/Makefile.am
++++ b/gtk3/immodule/Makefile.am
+@@ -35,26 +35,16 @@ IM_UIM_SOURCES = \
+ ../../gtk2/immodule/compose.c ../../gtk2/immodule/compose.h \
+ ../../gtk2/immodule/text-util.c ../../gtk2/immodule/text-util.h
+
+-noinst_PROGRAMS = gtk3-rc-get-immodule-file
+-gtk3_rc_get_immodule_file_SOURCES = \
+- ../../gtk2/immodule/gtk-rc-get-immodule-file.c
+-gtk3_rc_get_immodule_file_CFLAGS = @GTK3_CFLAGS@
+-gtk3_rc_get_immodule_file_LDADD = @GTK3_LIBS@
+-GTK3_RC_GET_IMMODULE_FILE = $(top_builddir)/gtk3/immodule/gtk3-rc-get-immodule-file
+ QUERY_COMMAND = gtk-query-immodules-3.0
+
+-install-data-hook: gtk3-rc-get-immodule-file
++install-data-hook:
+ if test -z $(DESTDIR); then \
+ if test $(libdir) = $(GTK3_LIBDIR); then \
+ if type $(QUERY_COMMAND) > /dev/null 2>&1; then \
+ $(QUERY_COMMAND) --update-cache; \
+- echo "*** \"`$(GTK3_RC_GET_IMMODULE_FILE)`\" is updated. ***"; \
+ else \
+ echo "********************** Warning ***********************"; \
+ echo " $(QUERY_COMMAND) not found"; \
+- echo " Please make sure to update"; \
+- echo " \"`$(GTK3_RC_GET_IMMODULE_FILE)`\""; \
+- echo " manually."; \
+ echo "******************************************************"; \
+ fi \
+ else \
+diff --git a/gtk3/toolbar/Makefile.am b/gtk3/toolbar/Makefile.am
+index 201d5121..e78fced5 100644
+--- a/gtk3/toolbar/Makefile.am
++++ b/gtk3/toolbar/Makefile.am
+@@ -1,46 +1,47 @@
+ EXTRA_DIST = UimApplet.panel-applet.in.in \
+- org.gnome.panel.applet.UimAppletFactory.service.in
++ uim-applet-menu.xml
+
+-if APPLET_GNOME3
++if GNOME3_APPLET
+ helper_defs = -DUIM_DATADIR=\""$(datadir)/@PACKAGE@"\"
+
+-libexec_PROGRAMS = uim-toolbar-applet-gnome3
++uim_toolbar_applet_gnome3_libdir = $(pkglibdir)
++uim_toolbar_applet_gnome3_lib_LTLIBRARIES = libuim-toolbar-applet-gnome3.la
+
+-uim_toolbar_applet_gnome3_LDADD = @GTK3_LIBS@ @APPLET_GNOME3_LIBS@ \
++xmluidir = $(pkgdatadir)/ui
++xmlui_DATA = uim-applet-menu.xml
++
++libuim_toolbar_applet_gnome3_la_LIBADD = @GTK3_LIBS@ @GNOME3_APPLET_LIBS@ \
+ $(top_builddir)/uim/libuim-scm.la \
+ $(top_builddir)/uim/libuim.la \
+ $(top_builddir)/uim/libuim-custom.la
+-uim_toolbar_applet_gnome3_CPPFLAGS = \
++libuim_toolbar_applet_gnome3_la_CPPFLAGS = \
++ -DUIM_UIDATADIR="\"${xmluidir}\"" \
+ $(helper_defs) -I$(top_srcdir) -I$(top_builddir)
+-
+-uim_toolbar_applet_gnome3_CFLAGS = @GTK3_CFLAGS@ @APPLET_GNOME3_CFLAGS@
++libuim_toolbar_applet_gnome3_la_LDFLAGS = \
++ -module -avoid-version
++
++libuim_toolbar_applet_gnome3_la_CFLAGS = @GTK3_CFLAGS@ @GNOME3_APPLET_CFLAGS@
+
+-uim_toolbar_applet_gnome3_SOURCES = applet-gnome3.c \
++libuim_toolbar_applet_gnome3_la_SOURCES = applet-gnome3.c \
+ ../../gtk2/toolbar/common-gtk.c
+
+-appletdir = $(datadir)/gnome-panel/4.0/applets
++APPLET_LOCATION = $(pkglibdir)/libuim-toolbar-applet-gnome3.so
++
++appletdir = $(LIBPANEL_APPLET_DIR)
+ applet_DATA = UimApplet.panel-applet
+ applet_in_files = $(applet_DATA:=.in)
+ applet_in_in_files = $(applet_in_files:=.in)
+
+ $(applet_in_files): $(applet_in_in_files) Makefile
+- $(SED) s, at LIBEXECDIR@,$(libexecdir),g <$< >$@.tmp
++ $(SED) s, at APPLET_LOCATION@,$(APPLET_LOCATION),g <$< >$@.tmp
+ $(SED) s, at UIM_PIXMAPSDIR@,$(uim_pixmapsdir),g <$@.tmp >$@
+
+ po_files = $(wildcard $(top_srcdir)/po/*.po)
+ $(applet_DATA): $(applet_in_files) $(INTLTOOL_MERGE) $(po_files)
+ LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+
+-servicedir = $(datadir)/dbus-1/services
+-service_DATA = org.gnome.panel.applet.UimAppletFactory.service
+-service_in_files = $(service_DATA:=.in)
+-
+-$(service_DATA): $(service_in_files) Makefile
+- sed s, at LIBEXECDIR@,$(libexecdir),g <$< >$@
+-
+ DISTCLEANFILES = UimApplet.panel-applet.in UimApplet.panel-applet \
+- UimApplet.panel-applet.in.tmp \
+- org.gnome.panel.applet.UimAppletFactory.service
++ UimApplet.panel-applet.in.tmp
+ endif
+
+ if GTK3
+diff --git a/gtk3/toolbar/UimApplet.panel-applet.in.in b/gtk3/toolbar/UimApplet.panel-applet.in.in
+index 88550957..c2e2696b 100644
+--- a/gtk3/toolbar/UimApplet.panel-applet.in.in
++++ b/gtk3/toolbar/UimApplet.panel-applet.in.in
+@@ -1,6 +1,7 @@
+ [Applet Factory]
+ Id=UimAppletFactory
+-Location=@LIBEXECDIR@/uim-toolbar-applet-gnome3
++InProcess=true
++Location=@APPLET_LOCATION@
+ _Name=uim Applet Factory
+ _Description=uim applet factory
+
+diff --git a/gtk3/toolbar/applet-gnome3.c b/gtk3/toolbar/applet-gnome3.c
+index 19d19930..708f0342 100644
+--- a/gtk3/toolbar/applet-gnome3.c
++++ b/gtk3/toolbar/applet-gnome3.c
+@@ -1,6 +1,6 @@
+ /*
+
+- Copyright (c) 2003-2013 uim Project http://code.google.com/p/uim/
++ Copyright (c) 2003-2013 uim Project https://github.com/uim/uim
+
+ All rights reserved.
+
+@@ -44,83 +44,66 @@
+
+ PanelApplet *uimapplet;
+
+-static void exec_switcher(GtkAction *action, gpointer data);
+-static void exec_pref(GtkAction *action, gpointer data);
+-static void exec_dic(GtkAction *action, gpointer data);
+-static void exec_pad(GtkAction *action, gpointer data);
+-static void exec_hand(GtkAction *action, gpointer data);
+-static void exec_help(GtkAction *action, gpointer data);
+-static void display_about_dialog(GtkAction *action, gpointer data);
++static void exec_switcher(GSimpleAction *action, GVariant *parameter, gpointer data);
++static void exec_pref(GSimpleAction *action, GVariant *parameter, gpointer data);
++static void exec_dic(GSimpleAction *action, GVariant *parameter, gpointer data);
++static void exec_pad(GSimpleAction *action, GVariant *parameter, gpointer data);
++static void exec_hand(GSimpleAction *action, GVariant *parameter, gpointer data);
++static void exec_help(GSimpleAction *action, GVariant *parameter, gpointer data);
++static void display_about_dialog(GSimpleAction *action, GVariant *parameter, gpointer data);
+
+ extern GtkWidget *uim_toolbar_applet_new(void);
+ extern void uim_toolbar_launch_helper_application(const char *command);
+
+-
+-static const GtkActionEntry uim_menu_actions[] = {
+- {"Switcher", "im_switcher",
+- N_("Switch input method"), NULL, NULL, G_CALLBACK(exec_switcher)},
+- {"Pref", GTK_STOCK_PREFERENCES,
+- N_("Preference"), NULL, NULL, G_CALLBACK(exec_pref)},
+- {"Dic", "uim-dict",
+- N_("Japanese dictionary editor"), NULL, NULL, G_CALLBACK(exec_dic)},
+- {"Pad", GTK_STOCK_BOLD,
+- N_("Input pad"), NULL, NULL, G_CALLBACK(exec_pad)},
+- {"Hand", GTK_STOCK_EDIT,
+- N_("Handwriting input pad"), NULL, NULL, G_CALLBACK(exec_hand)},
+- {"Help", GTK_STOCK_HELP,
+- N_("Help"), NULL, NULL, G_CALLBACK(exec_help)},
+- {"About", GTK_STOCK_ABOUT,
+- N_("About"), NULL, NULL, G_CALLBACK(display_about_dialog)}
++static const GActionEntry uim_menu_actions[] = {
++ { "switcher", exec_switcher },
++ { "pref", exec_pref },
++ { "dic", exec_dic },
++ { "pad", exec_pad },
++ { "hand", exec_hand },
++ { "help", exec_help },
++ { "about", display_about_dialog }
+ };
+
+-static const char uim_menu_xml[] =
+- "<menuitem action=\"Switcher\"/>"
+- "<menuitem action=\"Pref\"/>"
+- "<menuitem action=\"Dic\"/>"
+- "<menuitem action=\"Pad\"/>"
+- "<menuitem action=\"Hand\"/>"
+- "<menuitem action=\"Help\"/>"
+- "<menuitem action=\"About\"/>";
+-
+ static void
+-exec_switcher(GtkAction *action, gpointer data)
++exec_switcher(GSimpleAction *action, GVariant *parameter, gpointer data)
+ {
+ uim_toolbar_launch_helper_application("uim-im-switcher-gtk3");
+ }
+
+ static void
+-exec_pref(GtkAction *action, gpointer data)
++exec_pref(GSimpleAction *action, GVariant *parameter, gpointer data)
+ {
+ uim_toolbar_launch_helper_application("uim-pref-gtk3");
+ }
+
+ static void
+-exec_dic(GtkAction *action, gpointer data)
++exec_dic(GSimpleAction *action, GVariant *parameter, gpointer data)
+ {
+ uim_toolbar_launch_helper_application("uim-dict-gtk3");
+ }
+
+ static void
+-exec_pad(GtkAction *action, gpointer data)
++exec_pad(GSimpleAction *action, GVariant *parameter, gpointer data)
+ {
+ uim_toolbar_launch_helper_application("uim-input-pad-ja-gtk3");
+ }
+
+ static void
+-exec_hand(GtkAction *action, gpointer data)
++exec_hand(GSimpleAction *action, GVariant *parameter, gpointer data)
+ {
+ uim_toolbar_launch_helper_application("uim-tomoe-gtk");
+ }
+
+ static void
+-exec_help(GtkAction *uic, gpointer data)
++exec_help(GSimpleAction *action, GVariant *parameter, gpointer data)
+ {
+ uim_toolbar_launch_helper_application("uim-help");
+ }
+
+ /* Just the about window... If it's already open, just focus it */
+ static void
+-display_about_dialog(GtkAction *action, gpointer data)
++display_about_dialog(GSimpleAction *action, GVariant *parameter, gpointer data)
+ {
+ GdkPixbuf *icon = NULL;
+ const gchar *authors[] = {"uim Project", NULL};
+@@ -149,7 +132,8 @@ static gboolean
+ uim_applet_new(PanelApplet *applet, const gchar *iid, gpointer data)
+ {
+ GtkWidget *toolbar;
+- GtkActionGroup *action_group;
++ GSimpleActionGroup *action_group;
++ gchar *ui_path;
+
+ uimapplet = applet;
+
+@@ -164,11 +148,16 @@ uim_applet_new(PanelApplet *applet, const gchar *iid, gpointer data)
+
+ gtk_widget_show_all(GTK_WIDGET(applet));
+
+- action_group = gtk_action_group_new("uim Applet Actions");
+- gtk_action_group_set_translation_domain(action_group, GETTEXT_PACKAGE);
+- gtk_action_group_add_actions(action_group, uim_menu_actions,
++ action_group = g_simple_action_group_new();
++ g_action_map_add_action_entries(G_ACTION_MAP (action_group), uim_menu_actions,
+ G_N_ELEMENTS(uim_menu_actions), toolbar);
+- panel_applet_setup_menu(applet, uim_menu_xml, action_group);
++
++ ui_path = g_build_filename (UIM_UIDATADIR, "uim-applet-menu.xml", NULL);
++ panel_applet_setup_menu_from_file(applet, ui_path, action_group, GETTEXT_PACKAGE);
++ g_free(ui_path);
++
++ gtk_widget_insert_action_group (GTK_WIDGET (applet), "uim",
++ G_ACTION_GROUP (action_group));
+ #if LIBPANEL_APPLET_HAVE_SET_BACKGROUND_WIDGET
+ panel_applet_set_background_widget(applet, GTK_WIDGET(applet));
+ #endif
+@@ -179,7 +168,7 @@ uim_applet_new(PanelApplet *applet, const gchar *iid, gpointer data)
+
+
+
+-PANEL_APPLET_OUT_PROCESS_FACTORY("UimAppletFactory",
++PANEL_APPLET_IN_PROCESS_FACTORY("UimAppletFactory",
+ PANEL_TYPE_APPLET,
+ (PanelAppletFactoryCallback)uim_applet_new,
+ NULL)
+diff --git a/gtk3/toolbar/org.gnome.panel.applet.UimAppletFactory.service.in b/gtk3/toolbar/org.gnome.panel.applet.UimAppletFactory.service.in
+deleted file mode 100644
+index 04864d08..00000000
+--- a/gtk3/toolbar/org.gnome.panel.applet.UimAppletFactory.service.in
++++ /dev/null
+@@ -1,3 +0,0 @@
+-[D-BUS Service]
+-Name=org.gnome.panel.applet.UimAppletFactory
+-Exec=@LIBEXECDIR@/uim-toolbar-applet-gnome3
+diff --git a/gtk3/toolbar/uim-applet-menu.xml b/gtk3/toolbar/uim-applet-menu.xml
+new file mode 100644
+index 00000000..6220369d
+--- /dev/null
++++ b/gtk3/toolbar/uim-applet-menu.xml
+@@ -0,0 +1,30 @@
++<section>
++ <item>
++ <attribute name="label" translatable="yes">Switch input method</attribute>
++ <attribute name="action">uim.switcher</attribute>
++ </item>
++ <item>
++ <attribute name="label" translatable="yes">Preference</attribute>
++ <attribute name="action">uim.pref</attribute>
++ </item>
++ <item>
++ <attribute name="label" translatable="yes">Japanese dictionary editor</attribute>
++ <attribute name="action">uim.dic</attribute>
++ </item>
++ <item>
++ <attribute name="label" translatable="yes">Input pad</attribute>
++ <attribute name="action">uim.pad</attribute>
++ </item>
++ <item>
++ <attribute name="label" translatable="yes">Handwriting input pad</attribute>
++ <attribute name="action">uim.hand</attribute>
++ </item>
++ <item>
++ <attribute name="label" translatable="yes">Help</attribute>
++ <attribute name="action">uim.help</attribute>
++ </item>
++ <item>
++ <attribute name="label" translatable="yes">About</attribute>
++ <attribute name="action">uim.about</attribute>
++ </item>
++</section>
+--- uim-1.8.6/configure.ac.orig 2017-02-11 11:02:15.467236998 +0100
++++ uim-1.8.6/configure.ac 2017-02-11 11:02:19.537435202 +0100
+@@ -1041,10 +1041,10 @@
+ [Determine default toolkit (gtk, gtk3, qt, or qt4)
+ @<:@default=gtk@:>@]),
+ [
+- if test x"$enable_default_toolkit" = "xgtk" && test x"$use_gtk2" = "xyes"; then
++ if test x"$enable_default_toolkit" = "xgtk" && test x"$with_gtk2" = "xyes"; then
+ default_toolkit="gtk"
+ fi
+- if test x"$enable_default_toolkit" = "xgtk3" && test x"$use_gtk3" = "xyes"; then
++ if test x"$enable_default_toolkit" = "xgtk3" && test x"$with_gtk3" = "xyes"; then
+ default_toolkit="gtk3"
+ fi
+ if test x"$enable_default_toolkit" = "xqt" && test x"$use_qt" = "xyes"; then
+@@ -1277,15 +1277,10 @@
+ AM_CONDITIONAL(OPENSSL, test x$use_openssl = xyes)
+ AM_CONDITIONAL(SQLITE3, test x$use_sqlite3 = xyes)
+ AM_CONDITIONAL(FFI, test x$use_ffi = xyes)
+-AM_CONDITIONAL(GTK2, test x$use_gtk2 = xyes)
+-AM_CONDITIONAL(GTK2_4, test x$use_gtk2_4 = xyes)
+-AM_CONDITIONAL(GTK3, test x$use_gtk3 = xyes)
+ AM_CONDITIONAL(DEFAULT_TOOLKIT_GTK, test x$default_toolkit = xgtk)
+ AM_CONDITIONAL(DEFAULT_TOOLKIT_GTK3, test x$default_toolkit = xgtk3)
+ AM_CONDITIONAL(DEFAULT_TOOLKIT_QT, test x$default_toolkit = xqt)
+ AM_CONDITIONAL(DEFAULT_TOOLKIT_QT4, test x$default_toolkit = xqt4)
+-AM_CONDITIONAL(APPLET_GNOME, test x$use_applet_gnome = xyes)
+-AM_CONDITIONAL(APPLET_GNOME3, test x$use_applet_gnome3 = xyes)
+ AM_CONDITIONAL(UIM_FEP, test x$use_uim_fep = xyes)
+ AM_CONDITIONAL(UIM_EL, test x$use_uim_el = xyes)
+ AM_CONDITIONAL(XIM, test x$use_xim = xyes)
+@@ -1301,24 +1296,6 @@
+
+ IT_PROG_INTLTOOL([0.36.3], [no-xml])
+
+-GTK_BINARY_VERSION=`$PKG_CONFIG gtk+-2.0 --variable=gtk_binary_version`
+-GTK_LIBDIR=`$PKG_CONFIG gtk+-2.0 --variable=libdir`
+-AC_SUBST(GTK_BINARY_VERSION)
+-AC_SUBST(GTK_LIBDIR)
+-
+-GTK3_BINARY_VERSION=`$PKG_CONFIG gtk+-3.0 --variable=gtk_binary_version`
+-GTK3_LIBDIR=`$PKG_CONFIG gtk+-3.0 --variable=libdir`
+-AC_SUBST(GTK3_BINARY_VERSION)
+-AC_SUBST(GTK3_LIBDIR)
+-
+-if test x$use_gtk2 = xyes ; then
+-AC_DEFINE(USE_GTK2, 1, [use gtk2])
+-fi
+-
+-if test x$use_gtk3 = xyes ; then
+- AC_DEFINE(USE_GTK3, 1, [use gtk3])
+-fi
+-
+ if test x$use_qt = xyes ; then
+ # minimum version
+ QT_VERSION=3.2.0
+@@ -1570,10 +1570,10 @@
+ ;;
+ yes|*)
+ if test x"$default_toolkit" = "xgtk" && \
+- test x"$use_gtk2_4" = "xyes"; then
++ test x"$with_gtk2_4" = "xyes"; then
+ use_pref="yes"
+ elif test x"$default_toolkit" = "xgtk3" && \
+- test x"$use_gtk3" = "xyes"; then
++ test x"$with_gtk3" = "xyes"; then
+ use_pref="yes"
+ elif test x"$default_toolkit" = "xqt" && \
+ test x"$use_qt" = "xyes"; then
+@@ -1589,10 +1589,10 @@
+ esac ],
+ [
+ if test x"$default_toolkit" = "xgtk" && \
+- test x"$use_gtk2_4" = "xyes"; then
++ test x"$with_gtk2_4" = "xyes"; then
+ use_pref="yes"
+ elif test x"$default_toolkit" = "xgtk3" && \
+- test x"$use_gtk3" = "xyes"; then
++ test x"$with_gtk3" = "xyes"; then
+ use_pref="yes"
+ elif test x"$default_toolkit" = "xqt" && \
+ test x"$use_qt" = "xyes"; then
+@@ -2063,10 +2063,10 @@
+ OpenSSL : ${use_openssl}
+ SQLite3 : ${use_sqlite3}
+ ffi : ${use_ffi}
+- Gtk+ : ${use_gtk2}
+- Gnome Applet : ${use_applet_gnome}
+- Gtk+3 : ${use_gtk3}
+- Gnome3 Applet : ${use_applet_gnome3}
++ Gtk+ : ${with_gtk2}
++ Gnome Applet : ${enable_gnome_applet}
++ Gtk+3 : ${with_gtk3}
++ Gnome3 Applet : ${enable_gnome3_applet}
+ Qt3 : ${use_qt}
+ Qt3 immodule : ${use_qtimmodule}
+ Qt4 : ${use_qt4}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/uim.git/commitdiff/f72e2b22d2bb8d95ecce32468a43adee94de9db7
More information about the pld-cvs-commit
mailing list