diff --git a/include/xkb-internal.h b/include/xkb-internal.h index 2cbef99f..861d4462 100644 --- a/include/xkb-internal.h +++ b/include/xkb-internal.h @@ -40,6 +40,7 @@ struct xkb_stuff /** Keyboard device id */ int32_t device_id; NkBindings *bindings; + NkBindingsSeat *bindings_seat; }; #endif diff --git a/source/keyb.c b/source/keyb.c index 26837c05..394be6eb 100644 --- a/source/keyb.c +++ b/source/keyb.c @@ -140,7 +140,7 @@ void setup_abe ( void ) } } -static gboolean binding_trigger_action ( guint scope, gpointer user_data ) +static gboolean binding_trigger_action ( guint64 scope, gpointer user_data ) { return rofi_view_trigger_action ( rofi_view_get_active (), scope, GPOINTER_TO_UINT ( user_data ) ); } diff --git a/source/rofi.c b/source/rofi.c index 441edebf..92c1da86 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -91,6 +91,7 @@ void rofi_add_error_message ( GString *str ) struct xkb_stuff xkb = { .xcb_connection = NULL, .bindings = NULL, + .bindings_seat = NULL, }; /** Path to the configuration file */ @@ -667,9 +668,9 @@ static gboolean main_loop_x11_event_handler ( xcb_generic_event_t *ev, G_GNUC_UN { case XCB_XKB_MAP_NOTIFY: { - struct xkb_keymap *keymap = xkb_x11_keymap_new_from_device ( nk_bindings_get_context ( xkb.bindings ), xcb->connection, xkb.device_id, 0 ); + struct xkb_keymap *keymap = xkb_x11_keymap_new_from_device ( nk_bindings_seat_get_context ( xkb.bindings_seat ), xcb->connection, xkb.device_id, 0 ); struct xkb_state *state = xkb_x11_state_new_from_device ( keymap, xcb->connection, xkb.device_id ); - nk_bindings_update_keymap ( xkb.bindings, keymap, state ); + nk_bindings_seat_update_keymap ( xkb.bindings_seat, keymap, state ); xkb_keymap_unref ( keymap ); xkb_state_unref ( state ); break; @@ -677,13 +678,13 @@ static gboolean main_loop_x11_event_handler ( xcb_generic_event_t *ev, G_GNUC_UN case XCB_XKB_STATE_NOTIFY: { xcb_xkb_state_notify_event_t *ksne = (xcb_xkb_state_notify_event_t *) ev; - nk_bindings_update_mask ( xkb.bindings, - ksne->baseMods, - ksne->latchedMods, - ksne->lockedMods, - ksne->baseGroup, - ksne->latchedGroup, - ksne->lockedGroup ); + nk_bindings_seat_update_mask ( xkb.bindings_seat, + ksne->baseMods, + ksne->latchedMods, + ksne->lockedMods, + ksne->baseGroup, + ksne->latchedGroup, + ksne->lockedGroup ); xcb_generic_event_t dev; dev.response_type = 0; main_loop_x11_event_handler_view ( &dev ); @@ -1063,7 +1064,8 @@ int main ( int argc, char *argv[] ) return EXIT_FAILURE; } - xkb.bindings = nk_bindings_new ( xkb_context, keymap, state ); + xkb.bindings = nk_bindings_new (); + xkb.bindings_seat = nk_bindings_seat_new ( xkb.bindings, xkb_context, keymap, state ); if ( xcb_connection_has_error ( xcb->connection ) ) { g_warning ( "Connection has error" ); diff --git a/source/view.c b/source/view.c index 921c0d5f..3e5e0a8f 100644 --- a/source/view.c +++ b/source/view.c @@ -1438,13 +1438,13 @@ void rofi_view_itterrate ( RofiViewState *state, xcb_generic_event_t *event, xkb xcb_button_press_event_t *bpe = (xcb_button_press_event_t *) event; state->mouse.x = bpe->event_x; state->mouse.y = bpe->event_y; - nk_bindings_handle_button ( xkb->bindings, bpe->detail, NK_BINDINGS_BUTTON_STATE_PRESS, bpe->time ); + nk_bindings_seat_handle_button ( xkb->bindings_seat, bpe->detail, NK_BINDINGS_BUTTON_STATE_PRESS, bpe->time ); break; } case XCB_BUTTON_RELEASE: { xcb_button_release_event_t *bre = (xcb_button_release_event_t *) event; - nk_bindings_handle_button ( xkb->bindings, bre->detail, NK_BINDINGS_BUTTON_STATE_RELEASE, bre->time ); + nk_bindings_seat_handle_button ( xkb->bindings_seat, bre->detail, NK_BINDINGS_BUTTON_STATE_RELEASE, bre->time ); if ( config.click_to_exit == TRUE ) { if ( ( CacheState.flags & MENU_NORMAL_WINDOW ) == 0 ) { if ( ( state->mouse_seen == FALSE ) && ( bre->event != CacheState.main_window ) ) { @@ -1467,7 +1467,7 @@ void rofi_view_itterrate ( RofiViewState *state, xcb_generic_event_t *event, xkb for ( gint8 bi = 0; bi < 7; ++bi ) { if ( kne->keys[by] & ( 1 << bi ) ) { // X11 keycodes starts at 8 - nk_bindings_handle_key ( xkb->bindings, ( 8 * by + bi ) + 8, NK_BINDINGS_KEY_STATE_PRESSED ); + nk_bindings_seat_handle_key ( xkb->bindings_seat, ( 8 * by + bi ) + 8, NK_BINDINGS_KEY_STATE_PRESSED ); } } } @@ -1478,7 +1478,7 @@ void rofi_view_itterrate ( RofiViewState *state, xcb_generic_event_t *event, xkb xcb_key_press_event_t *xkpe = (xcb_key_press_event_t *) event; gchar *text; - text = nk_bindings_handle_key ( xkb->bindings, xkpe->detail, NK_BINDINGS_KEY_STATE_PRESS ); + text = nk_bindings_seat_handle_key ( xkb->bindings_seat, xkpe->detail, NK_BINDINGS_KEY_STATE_PRESS ); if ( ( text != NULL ) && ( textbox_append_char ( state->text, text, strlen ( text ) ) ) ) { state->refilter = TRUE; } @@ -1487,7 +1487,7 @@ void rofi_view_itterrate ( RofiViewState *state, xcb_generic_event_t *event, xkb case XCB_KEY_RELEASE: { xcb_key_release_event_t *xkre = (xcb_key_release_event_t *) event; - nk_bindings_handle_key ( xkb->bindings, xkre->detail, NK_BINDINGS_KEY_STATE_RELEASE ); + nk_bindings_seat_handle_key ( xkb->bindings_seat, xkre->detail, NK_BINDINGS_KEY_STATE_RELEASE ); break; } default: diff --git a/subprojects/libnkutils b/subprojects/libnkutils index a997ea9e..e468a6a2 160000 --- a/subprojects/libnkutils +++ b/subprojects/libnkutils @@ -1 +1 @@ -Subproject commit a997ea9ef7c8805f928ea325b0463931284afa17 +Subproject commit e468a6a24c97b595ed65f5d638dfea94a718c88c