Skip to content

qt: handle resize outside the client area on windows with csd

Fatih Uzunoğlu requested to merge fuzun/vlc:qt/windowsresize into master

See !6510 for more discussion.

I have tested this on Windows 7, Windows 10, and Windows 11.

This seems to have no adverse effect on Windows 11 [1]. However, it brings 1px border on Windows 10 [2], and aero border on Windows 7 [3].

Unlike !6510, there seems no other issues than having border on Windows 10 and Windows 7. Dwm transitions, aero snapping, and Windows 11 tiling are intact. And we will need some time for !6510 as Qt's new expanded client area feature (Qt::ExpandedClientAreaHint) is only available with Qt 6.9, and is not ready now. We currently use Qt 6.8, and it is not certain if we will switch to Qt 6.9, if not, we need to backport it and it may not worth the effort if they keep polishing it (they have to as it is not working properly now). The main advantage of that feature is not drawing or handling title bar buttons, but we already need to do that for Wayland and X11 anyway. It might make more sense to switch to it once they start supporting it on all platforms and not only Windows.

Since resizing outside is more important, and that it is fine on Windows 11, I propose that until !6510 gets ready we go forward with this.

With unofficial SetWindowCompositionAttribute(), it might be possible to get rid of the border on Windows 10, but it reportedly has another side effect that the shadows don't get adjusted properly (https://github.com/melak47/BorderlessWindow/issues/13#issuecomment-309154142). Considering the border is not terrible, at least without using DwmExtendFrameIntoClientArea(), I think it makes more sense to not use it.

Request review @chub. Ping @jbk.

[1]

explorer_FZSEAIufp6

[2]

resize-win10-2024-12-26_17.00.38.mkv

[3]

resize-win7-2024-12-26_16.59.02.mkv

Merge request reports

Loading