gtkimmulticontext: Handle switches between displays
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 31 Mar 2022 14:29:34 +0000 (16:29 +0200)
committerMichael Catanzaro <mcatanzaro@gnome.org>
Wed, 20 Apr 2022 14:54:04 +0000 (14:54 +0000)
commitbc4b2c142fa5076120ae5f5b26745d3536d9578b
tree826db65a6c8d77f0169091d886cf179cb2908a74
parentb65d7c86d7523f5093ec0ac88d603e2ffb47c2b1
gtkimmulticontext: Handle switches between displays

Currently the GtkIMMultiContext may stick to a delegate GtkIMContext
that no longer applies after the multicontext is dissociated from
any widget.

Handle set_client_widget() so that it can handle changes between
widgets from 2 different display, but also so the delegate is made
NULL whenever the context has a NULL widget.

Doing so, any new client widget results in a new delegate IM context
lookup from the right GdkDisplay and GtkSettings, which avoids any
mix up.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4805
(cherry picked from commit b67da38916b710ba6eedd65ffb569a29e47ddb4d)
gtk/gtkimmulticontext.c