From cf05db8ddec948d907915e1c9569d743e8771def Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Tue, 30 Oct 2012 17:02:58 +0100 Subject: [PATCH] Ephyr: Find the right host screen when embedded When Xephyr is embedded into another application (e.g. in xoo), the input events may come from the parent Window instead of our own. So make sure we find the host screen in that case as well instead of crashing. Signed-off-by: Sjoerd Simons Reviewed-by: Daniel Stone --- hw/kdrive/ephyr/hostx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index 02729d6f6..157ac36b2 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -881,7 +881,9 @@ host_screen_from_window(Window w) struct EphyrHostScreen *result = NULL; for (index = 0; index < HostX.n_screens; index++) { - if (HostX.screens[index].win == w || HostX.screens[index].peer_win == w) { + if (HostX.screens[index].win == w + || HostX.screens[index].peer_win == w + || HostX.screens[index].win_pre_existing == w) { result = &HostX.screens[index]; goto out; }