ITADN

[GTK, Wayland] Shell can be resized smaller than set minimum size

#3281Opentmssngr 创建于 2026-05-05
Wayland
T
tmssngrcommented
**Describe the bug** When setting the minimum size of a shell, it is expected that the user can't make it smaller than this by resizing the window. This works as expected on Windows, macOS and Linux with X11, but not on Linux with Wayland. **To Reproduce** ```java import org.eclipse.swt.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*; public class MinimumSizeShell { public static void main(String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); final Composite composite = new Composite(shell, 0); composite.addListener(SWT.Paint, event -> { final Point size = composite.getSize(); event.gc.setForeground(new Color(255, 0, 0)); event.gc.setLineWidth(5); event.gc.drawRectangle(0, 0, size.x - 1, size.y - 1); }); shell.setLayout(new Layout() { @Override protected Point computeSize(Composite unused, int wHint, int hHint, boolean flushCache) { return new Point(400, 300); } @Override protected void layout(Composite unused, boolean flushCache) { composite.setSize(400, 300); } }); final Point size = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT); shell.setSize(size); shell.setMinimumSize(size); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } } ``` - launch and try to make the shell smaller **Expected behavior** It must not be possible to make the shell smaller than the set minimum size. **Screenshots** Initially: <img width="452" height="397" alt="Image" src="https://github.com/user-attachments/assets/a9413638-9342-4c39-a92c-6a259ff09e7a" /> After making smaller: <img width="400" height="300" alt="Image" src="https://github.com/user-attachments/assets/5b16a7fd-dfc7-43dc-a29f-61067adcdb7b" /> **Environment:** 1. Select the platform(s) on which the behavior is seen: - - [ ] All OS - - [ ] Windows - - [x] Linux - - [ ] macOS 2. Additional OS info (e.g. OS version, Linux Desktop, etc) Tried on Ubuntu 26.04 and Fedora Silverblue 43.
0 条评论