diff options
author | Andoni Morales Alastruey <ylatuya@gmail.com> | 2010-07-25 17:04:12 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2010-08-06 10:21:48 +0100 |
commit | c2c32fe773aacfdcf823e6faf4a2327e6f997760 (patch) | |
tree | 4cbf91e897d8a167aa0d6e7db4d6fe3784624bc2 /sys | |
parent | 7ab007bafeb5e3b32b0156235f51c1f4b4f442d9 (diff) | |
download | gstreamer-plugins-bad-c2c32fe773aacfdcf823e6faf4a2327e6f997760.tar.gz |
dshowvideosink: close our own window when changing the window id
If we created the window, it needs to be closed after setting a new
window id.
https://bugzilla.gnome.org/show_bug.cgi?id=574290
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dshowvideosink/dshowvideosink.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dshowvideosink/dshowvideosink.cpp b/sys/dshowvideosink/dshowvideosink.cpp index bfc1c2576..1e4f219cd 100644 --- a/sys/dshowvideosink/dshowvideosink.cpp +++ b/sys/dshowvideosink/dshowvideosink.cpp @@ -123,9 +123,16 @@ gst_dshowvideosink_set_window_id (GstXOverlay * overlay, ULONG window_id) if (sink->connected && sink->filter_media_event) { HRESULT hres; - /* Return control of application window */ - SetWindowLongPtr (previous_window, GWL_WNDPROC, (LONG)sink->prevWndProc); - SetWindowPos (previous_window, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); + if (sink->is_new_window) { + /* If we created a new window */ + SendMessage (previous_window, WM_CLOSE, NULL, NULL); + sink->is_new_window = FALSE; + sink->window_closed = FALSE; + } else { + /* Return control of application window */ + SetWindowLongPtr (previous_window, GWL_WNDPROC, (LONG)sink->prevWndProc); + SetWindowPos (previous_window, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); + } gst_dshowvideosink_set_window_for_renderer (sink); |