diff options
author | James Ross-Gowan <rossymiles@gmail.com> | 2016-08-25 23:07:42 +1000 |
---|---|---|
committer | James Ross-Gowan <rossymiles@gmail.com> | 2016-08-26 20:02:58 +1000 |
commit | 31f28da0f32f1fd37925b2c30a53c83916583ef7 (patch) | |
tree | ced1b30bb1eaadc5f6d3d936da5759809784a868 /.travis.yml | |
parent | ef0b2e33b1cc8d064f64b864443bf1c233691508 (diff) | |
download | mpv-31f28da0f32f1fd37925b2c30a53c83916583ef7.tar.bz2 mpv-31f28da0f32f1fd37925b2c30a53c83916583ef7.tar.xz |
w32_common: use hooks to detect parent window resize
Because VOCTRL_CHECK_EVENTS is processed asynchronously (as of 088a007,)
the GUI thread no longer gets regular wakeups, so the old check that
made sure the video window matched the parent window's size in --wid
embedding mode did not run very often. This made --wid embedding not
very usable.
Instead of polling for window size changes, use Windows hooks to react
to them when they happen. When the parent window is owned by the same
process as the video window, use a WH_CALLWNDPROC hook. When the parent
window is not owned by the same process, WinEvents must be used, which
are not as smooth, but still work for this purpose.
Since neither SetWindowsHookEx nor SetWinEventHook take a context
parameter to send data to the hook function, the hook functions must
find the child window by its class instead, so there are a few changes
to ensure this is fast and the class is unique.
This also fixes up the logic to handle window destruction. When a parent
window is destroyed, its children are also destroyed, so this gives us a
way to react to parent window destruction without polling.
Diffstat (limited to '.travis.yml')
0 files changed, 0 insertions, 0 deletions