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:
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))) {
 			return TRUE;
 	case GDK_Tab:
-		if (event->state &= GDK_CONTROL_MASK) {
+		if (event->state & GDK_CONTROL_MASK) {
 			return TRUE;
 	case GDK_ISO_Left_Tab:
-		if (event->state &= GDK_SHIFT_MASK) {
+		if (event->state & GDK_SHIFT_MASK) {
 			keyval = 0;
 		} else if (!check_selection_bound(buffer))

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: Logo

You are commenting using your 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