summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2012-10-30 17:02:58 +0100
committerDaniel Stone <daniel@fooishbar.org>2012-11-21 11:13:55 +1100
commitcf05db8ddec948d907915e1c9569d743e8771def (patch)
treeacbe88be6cafc0aa3ec08a43386e0be97e6a6665 /hw
parentac1a60e7b6f06fd075cc5bf55d6bc67206a01d29 (diff)
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 <sjoerd.simons@collabora.co.uk> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/kdrive/ephyr/hostx.c4
1 files changed, 3 insertions, 1 deletions
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;
}