Mousepad does not enable TAB with IBus

Mousepad is a simple text editor for Xfce and it’s available on Fedora too.
I got the following request:

If I’m not mistaken, you’re the author of this patch for mousepad: http://code.google.com/p/ibus/issues/detail?id=1192
First off, thank you very much for fixing this annoying bug that has vexed me for months!
Now, the only problem is that the same bug still exists for the TAB key, as in TAB key strokes are not recognized with ibus running, but work if I kill ibus.
Sadly, I couldn’t really tell how you fixed the enter key, so I couldn’t reproduce a fix for TAB either.
Maybe your could help me? This problem just seems way too small to open up yet another bug report, so I hope you can help me.

お願いします!

I checked the source code and the similar fix also needs to be applied for TAB key.
The following is the all the fix of Enter and TAB keys:

--- mousepad-0.2.16/src/keyevent.c.orig
+++ mousepad-0.2.16/src/keyevent.c
@@ -89,19 +89,19 @@ static gboolean cb_key_press_event(GtkWi
 	case GDK_Return:
 		if (check_preedit(text_view))
 			return FALSE;
-		if ((indent_get_state() && !(event->state &= GDK_SHIFT_MASK)) ||
-			(!indent_get_state() && (event->state &= GDK_SHIFT_MASK))) {
+		if ((indent_get_state() && !(event->state & GDK_SHIFT_MASK)) ||
+			(!indent_get_state() && (event->state & GDK_SHIFT_MASK))) {
 			indent_real(text_view);
 			return TRUE;
 		}
 		break;
 	case GDK_Tab:
-		if (event->state &= GDK_CONTROL_MASK) {
+		if (event->state & GDK_CONTROL_MASK) {
 			indent_toggle_tab_width(text_view);
 			return TRUE;
 		}
 	case GDK_ISO_Left_Tab:
-		if (event->state &= GDK_SHIFT_MASK) {
+		if (event->state & GDK_SHIFT_MASK) {
 			keyval = 0;
 			indent_multi_line_unindent(buffer);
 		} else if (!check_selection_bound(buffer))
Advertisements

About fujiwara

I'm an open-sourced desktop i18n developer.
This entry was posted in IBus and tagged , , . Bookmark the permalink.

2 Responses to Mousepad does not enable TAB with IBus

  1. Ancurio says:

    心から感謝します!! (^o^)
    This bug had been so annoying all this time,
    and I had already given up on mousepad and considered just using leafpad.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s