Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ime and enable build option #1999

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
option('drun', type: 'boolean', value: true, description: 'Desktop file mode')
option('window', type: 'boolean', value: true, description: 'Window switcher mode')
option('check', type: 'feature', description: 'Build and run libcheck-based tests')
option('imdkit', type: 'boolean', value: false, description: 'IMDKit support')
option('imdkit', type: 'boolean', value: true, description: 'IMDKit support')
22 changes: 5 additions & 17 deletions source/xcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1383,14 +1383,7 @@ static void main_loop_x11_event_handler_view(xcb_generic_event_t *event) {
}
case XCB_KEY_RELEASE: {
xcb_key_release_event_t *xkre = (xcb_key_release_event_t *)event;
#ifdef XCB_IMDKIT
if (xcb->ic) {
xcb_xim_forward_event(xcb->im, xcb->ic, xkre);
} else
#endif
{
rofi_key_release_event_handler(xkre, state);
}
rofi_key_release_event_handler(xkre, state);
break;
}
default:
Expand All @@ -1408,13 +1401,7 @@ void x11_event_handler_fowarding(G_GNUC_UNUSED xcb_xim_t *im,
if (state == NULL) {
return;
}
uint8_t type = event->response_type & ~0x80;
if (type == XCB_KEY_PRESS) {
rofi_key_press_event_handler(event, state);
} else if (type == XCB_KEY_RELEASE) {
xcb_key_release_event_t *xkre = (xcb_key_release_event_t *)event;
rofi_key_release_event_handler(xkre, state);
}
rofi_key_press_event_handler(event, state);
}
#endif

Expand All @@ -1435,9 +1422,10 @@ static gboolean main_loop_x11_event_handler(xcb_generic_event_t *ev,
}

#ifdef XCB_IMDKIT
if (xcb->im && xcb_xim_filter_event(xcb->im, ev)) {
if (xcb->im
&& (ev->response_type & ~0x80) != XCB_KEY_PRESS
&& !xcb_xim_filter_event(xcb->im, ev))
return G_SOURCE_CONTINUE;
}
#endif

uint8_t type = ev->response_type & ~0x80;
Expand Down
Loading