]> git.lizzy.rs Git - plan9front.git/commit
rio: make window focus changes deterministic, cleanup wind.c
authorcinap_lenrek <cinap_lenrek@felloff.net>
Sun, 7 Mar 2021 19:26:30 +0000 (20:26 +0100)
committercinap_lenrek <cinap_lenrek@felloff.net>
Sun, 7 Mar 2021 19:26:30 +0000 (20:26 +0100)
commitb5783b1e39122f466c1a577720496284223e2217
tree1f56ab52e2968a14fba725c3d5ec15b9114e1dd0
parentea347ee7f181208be5a2ace0e35d268ccfefa1e4
rio: make window focus changes deterministic, cleanup wind.c

Switching window focus used to be non deterministic
as the current window in focus (Window *input) was set
concurrently while processing window messages such as
Resized and Topped.

This implements a new approach where wcurrent() and
wuncurrent() are responsible for the synchronization
and switch of the input.

It is implemented by sending a Repaint message to the
old input window first, neccesarily waiting until that
window releases the focus and then input is updated
and then a Topped or Reshaped message is send to the
new input window.

Note, that when the whole screen is resized that no
input changes need to happening anymore.
sys/src/cmd/rio/dat.h
sys/src/cmd/rio/rio.c
sys/src/cmd/rio/wctl.c
sys/src/cmd/rio/wind.c