clutter: Do not depend on device stage on ClutterInputMethod

Look it up through other means.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1486
This commit is contained in:
Carlos Garnacho 2020-06-05 16:05:20 +02:00 committed by Jonas Ådahl
parent f99fc2ae9c
commit af249ddf44

View File

@ -286,14 +286,14 @@ clutter_input_method_put_im_event (ClutterInputMethod *im,
{ {
ClutterInputDevice *keyboard; ClutterInputDevice *keyboard;
ClutterSeat *seat; ClutterSeat *seat;
ClutterStageManager *stage_manager;
ClutterStage *stage; ClutterStage *stage;
ClutterEvent *event; ClutterEvent *event;
seat = clutter_backend_get_default_seat (clutter_get_default_backend ()); seat = clutter_backend_get_default_seat (clutter_get_default_backend ());
keyboard = clutter_seat_get_keyboard (seat); keyboard = clutter_seat_get_keyboard (seat);
stage = _clutter_input_device_get_stage (keyboard); stage_manager = clutter_stage_manager_get_default ();
if (stage == NULL) stage = clutter_stage_manager_get_default_stage (stage_manager);
return;
event = clutter_event_new (event_type); event = clutter_event_new (event_type);
event->im.text = g_strdup (text); event->im.text = g_strdup (text);
@ -474,6 +474,7 @@ clutter_input_method_forward_key (ClutterInputMethod *im,
ClutterInputMethodPrivate *priv; ClutterInputMethodPrivate *priv;
ClutterInputDevice *keyboard; ClutterInputDevice *keyboard;
ClutterSeat *seat; ClutterSeat *seat;
ClutterStageManager *stage_manager;
ClutterStage *stage; ClutterStage *stage;
ClutterEvent *event; ClutterEvent *event;
@ -484,10 +485,9 @@ clutter_input_method_forward_key (ClutterInputMethod *im,
return; return;
seat = clutter_backend_get_default_seat (clutter_get_default_backend ()); seat = clutter_backend_get_default_seat (clutter_get_default_backend ());
stage_manager = clutter_stage_manager_get_default ();
stage = clutter_stage_manager_get_default_stage (stage_manager);
keyboard = clutter_seat_get_keyboard (seat); keyboard = clutter_seat_get_keyboard (seat);
stage = _clutter_input_device_get_stage (keyboard);
if (stage == NULL)
return;
event = clutter_event_new (press ? CLUTTER_KEY_PRESS : CLUTTER_KEY_RELEASE); event = clutter_event_new (press ? CLUTTER_KEY_PRESS : CLUTTER_KEY_RELEASE);
event->key.time = time_; event->key.time = time_;