store env and class

Signed-off-by: Mattias Andrée <maandree@operamail.com>
c part of broadcasting X events

Signed-off-by: Mattias Andrée <maandree@operamail.com>