gtkimmulticontext: Handle switches between displays
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 31 Mar 2022 14:29:34 +0000 (16:29 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 31 Mar 2022 14:35:29 +0000 (16:35 +0200)
commitb67da38916b710ba6eedd65ffb569a29e47ddb4d
treea6d41eb8202bffcbddd296c4ea1bc23450ddea30
parent04c9c6b4284110746089adadc12701b7f3bbf379
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
gtk/gtkimmulticontext.c