@@ -846,7 +846,8 @@ _ic_process_key_event_reply_cb (GObject *source,
846
846
/**
847
847
* _ic_process_key_event:
848
848
*
849
- * Implement the "ProcessKeyEvent" method call of the org.freedesktop.IBus.InputContext interface.
849
+ * Implement the "ProcessKeyEvent" method call of the
850
+ * org.freedesktop.IBus.InputContext interface.
850
851
*/
851
852
static void
852
853
_ic_process_key_event (BusInputContext * context ,
@@ -860,11 +861,13 @@ _ic_process_key_event (BusInputContext *context,
860
861
g_variant_get (parameters , "(uuu)" , & keyval , & keycode , & modifiers );
861
862
if (G_UNLIKELY (!context -> has_focus )) {
862
863
/* workaround: set focus if context does not have focus */
863
- BusInputContext * focused_context = bus_ibus_impl_get_focused_input_context (BUS_DEFAULT_IBUS );
864
+ BusInputContext * focused_context =
865
+ bus_ibus_impl_get_focused_input_context (BUS_DEFAULT_IBUS );
864
866
if (focused_context == NULL ||
865
867
focused_context -> fake == TRUE ||
866
868
context -> fake == FALSE) {
867
- /* grab focus, if context is a real IC or current focused IC is fake */
869
+ /* grab focus, if context is a real IC or current focused IC is
870
+ * fake */
868
871
bus_input_context_focus_in (context );
869
872
}
870
873
}
@@ -914,7 +917,8 @@ _ic_process_key_event (BusInputContext *context,
914
917
data );
915
918
}
916
919
else {
917
- g_dbus_method_invocation_return_value (invocation , g_variant_new ("(b)" , FALSE));
920
+ g_dbus_method_invocation_return_value (invocation ,
921
+ g_variant_new ("(b)" , FALSE));
918
922
}
919
923
}
920
924
@@ -1438,7 +1442,9 @@ bus_input_context_focus_in (BusInputContext *context)
1438
1442
context -> prev_modifiers = 0 ;
1439
1443
1440
1444
if (context -> engine ) {
1441
- bus_engine_proxy_focus_in (context -> engine );
1445
+ const gchar * path =
1446
+ ibus_service_get_object_path ((IBusService * )context );
1447
+ bus_engine_proxy_focus_in (context -> engine , path , context -> client );
1442
1448
bus_engine_proxy_enable (context -> engine );
1443
1449
bus_engine_proxy_set_capabilities (context -> engine , context -> capabilities );
1444
1450
bus_engine_proxy_set_cursor_location (context -> engine , context -> x , context -> y , context -> w , context -> h );
@@ -1538,7 +1544,9 @@ bus_input_context_focus_out (BusInputContext *context)
1538
1544
bus_input_context_register_properties (context , props_empty );
1539
1545
1540
1546
if (context -> engine ) {
1541
- bus_engine_proxy_focus_out (context -> engine );
1547
+ const gchar * path =
1548
+ ibus_service_get_object_path ((IBusService * )context );
1549
+ bus_engine_proxy_focus_out (context -> engine , path );
1542
1550
}
1543
1551
1544
1552
context -> has_focus = FALSE;
@@ -2376,11 +2384,19 @@ bus_input_context_enable (BusInputContext *context)
2376
2384
if (context -> engine == NULL )
2377
2385
return ;
2378
2386
2379
- bus_engine_proxy_focus_in (context -> engine );
2380
- bus_engine_proxy_enable (context -> engine );
2381
- bus_engine_proxy_set_capabilities (context -> engine , context -> capabilities );
2382
- bus_engine_proxy_set_cursor_location (context -> engine , context -> x , context -> y , context -> w , context -> h );
2383
- bus_engine_proxy_set_content_type (context -> engine , context -> purpose , context -> hints );
2387
+ {
2388
+ const gchar * path =
2389
+ ibus_service_get_object_path ((IBusService * )context );
2390
+ bus_engine_proxy_focus_in (context -> engine , path , context -> client );
2391
+ bus_engine_proxy_enable (context -> engine );
2392
+ bus_engine_proxy_set_capabilities (context -> engine ,
2393
+ context -> capabilities );
2394
+ bus_engine_proxy_set_cursor_location (context -> engine ,
2395
+ context -> x , context -> y ,
2396
+ context -> w , context -> h );
2397
+ bus_engine_proxy_set_content_type (context -> engine ,
2398
+ context -> purpose , context -> hints );
2399
+ }
2384
2400
}
2385
2401
2386
2402
void
@@ -2397,7 +2413,9 @@ bus_input_context_disable (BusInputContext *context)
2397
2413
bus_input_context_register_properties (context , props_empty );
2398
2414
2399
2415
if (context -> engine ) {
2400
- bus_engine_proxy_focus_out (context -> engine );
2416
+ const gchar * path =
2417
+ ibus_service_get_object_path ((IBusService * )context );
2418
+ bus_engine_proxy_focus_out (context -> engine , path );
2401
2419
bus_engine_proxy_disable (context -> engine );
2402
2420
}
2403
2421
}
@@ -2445,6 +2463,8 @@ bus_input_context_unset_engine (BusInputContext *context)
2445
2463
2446
2464
if (context -> engine ) {
2447
2465
gint i ;
2466
+ const gchar * path =
2467
+ ibus_service_get_object_path ((IBusService * )context );
2448
2468
/* uninstall signal handlers for the engine. */
2449
2469
for (i = 0 ; i < G_N_ELEMENTS (engine_signals ); i ++ ) {
2450
2470
g_signal_handlers_disconnect_by_func (context -> engine ,
@@ -2453,7 +2473,7 @@ bus_input_context_unset_engine (BusInputContext *context)
2453
2473
/* focus out engine so that the next call of
2454
2474
bus_engine_proxy_focus_in() will take effect and trigger
2455
2475
RegisterProperties. */
2456
- bus_engine_proxy_focus_out (context -> engine );
2476
+ bus_engine_proxy_focus_out (context -> engine , path );
2457
2477
g_object_unref (context -> engine );
2458
2478
context -> engine = NULL ;
2459
2479
}
@@ -2488,7 +2508,9 @@ bus_input_context_set_engine (BusInputContext *context,
2488
2508
context );
2489
2509
}
2490
2510
if (context -> has_focus ) {
2491
- bus_engine_proxy_focus_in (context -> engine );
2511
+ const gchar * path =
2512
+ ibus_service_get_object_path ((IBusService * )context );
2513
+ bus_engine_proxy_focus_in (context -> engine , path , context -> client );
2492
2514
bus_engine_proxy_enable (context -> engine );
2493
2515
bus_engine_proxy_set_capabilities (context -> engine , context -> capabilities );
2494
2516
bus_engine_proxy_set_cursor_location (context -> engine , context -> x , context -> y , context -> w , context -> h );
0 commit comments