diff -urN ami-1.2.3.ORIG/src/applet.c ami-1.2.3/src/applet.c --- ami-1.2.3.ORIG/src/applet.c 2003-06-27 08:51:27.000000000 +0900 +++ ami-1.2.3/src/applet.c 2004-05-30 17:58:49.921295168 +0900 @@ -37,12 +36,46 @@ static void wm_change_shape_mask(GtkWidget *win, GdkPixbuf *pixbuf); static void expose_cb(GtkWidget *w, GdkEventExpose *event, gpointer data); +/* support for imhangul_status_applet */ +enum { MODE_NONE, MODE_ENGLISH, MODE_HANGUL }; + +void +imhangul_status_update(gint32 state) +{ + static GdkAtom input_mode_info_atom = 0; + static GdkAtom input_mode_info_type = 0; + + if (input_mode_info_atom == 0 || input_mode_info_type == 0) { + input_mode_info_atom = gdk_atom_intern("_HANGUL_INPUT_MODE", TRUE); + input_mode_info_type = gdk_atom_intern("INTEGER", TRUE); + } + + gdk_property_change(GDK_ROOT_PARENT(), + input_mode_info_atom, + input_mode_info_type, + 32, GDK_PROP_MODE_REPLACE, + (guchar *)&state, 1); +} + /* Common functions */ void draw_applet_image(gint hangul_mode) { GdkPixbuf *pixbuf; + + /* support for imhangul_status_applet */ + switch (hangul_mode) { + case AMI_PIXMAP_ENGLISH: + imhangul_status_update(MODE_ENGLISH); + break; + case AMI_PIXMAP_HANGUL: + imhangul_status_update(MODE_HANGUL); + break; + default: + imhangul_status_update(MODE_NONE); + } + if(ami_run_mode == AMI_NORMAL_RUN) { static int old_mode = -3; if ((!unique_han && support_status) || old_mode == hangul_mode) return;