Disable compositing when using wxDragImage

ImageList_BeginDrag() doesn't seem to be compatible with the use of
WS_EX_COMPOSITED, so turn it off when using it.

We probably could turn it back on again in EndDrag(), but for now keep
things simple and just fix the regression which resulted in wxDragImage
not working at all any more since d4ced54755 (Merge branch
'msw-double-buffer', 2022-10-15).
This commit is contained in:
Vadim Zeitlin 2022-10-17 13:32:31 +01:00
parent b5d434dc91
commit 9261816feb

View file

@ -272,6 +272,10 @@ bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullS
wxASSERT_MSG( (m_hImageList != 0), wxT("Image list must not be null in BeginDrag."));
wxASSERT_MSG( (window != 0), wxT("Window must not be null in BeginDrag."));
// Using ImageList_BeginDrag() doesn't work with composited windows,
// nothing gets shown, so reset WS_EX_COMPOSITED to make it work.
window->MSWDisableComposited();
m_fullScreen = fullScreen;
if (rect)
m_boundingRect = * rect;