djpohly / dwl

dwm for Wayland - ARCHIVE: development has moved to Codeberg
https://codeberg.org/dwl/dwl
Other
1.93k stars 284 forks source link

Some applications with minimum value restrictions refuse to resize the window size, resulting in layout chaos. #499

Closed DreamMaoMao closed 10 months ago

DreamMaoMao commented 10 months ago

Info

dwl version: v0.4-60-gab87410-dirty

wlroots version: 0.16.2

Description

swappy-20231015-122150

This phenomenon is currently observed in blueman and obs, where their window widths have minimum value restrictions, but they can be forced to resize to preset window sizes in the sway wm.

Can anyone suggest a solution? How to force these applications with window size restrictions to draw to a preset size in dwl

sevz17 commented 10 months ago

Right, we need to improve the handling of size hints.

The problem is that some (most?) applications that ported their code to wayland (also X11 apps) do not resize when they are told to, and there are other that comply with the protocol and do it, so in order to do not have problems with the broken applications, dwl respects size hints for all clients.

DreamMaoMao commented 10 months ago

@sevz17

i try to ignore size hints for thoese clients,but they still refuse to resize.

Is there a more general way, for example, we just send a resize request to the client, but regardless of whether the client resizes its own window size, we just display our default client area size (with the upper-left coordinate as the origin). I feel like swaywm and hyprland are both taking this approach, but I'm not sure.

DreamMaoMao commented 10 months ago

I haven't written interface rendering code before, so I don't quite understand the logic of sway in this part.

sevz17 commented 10 months ago

There is a way, but it's not merged in wlroots yet: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4131

I haven't written interface rendering code before, so I don't quite understand the logic of sway in this part.

dwl uses the scene-graph api, we let wlroots do the rendering stuff. And because of that we cannot fully control how buffers are rendered

EDIT: dwl patch using the wlroots' patch of above: https://github.com/djpohly/dwl/pull/455

sevz17 commented 10 months ago

Duplicate of #411.