mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-10-06 17:45:02 +00:00
xwayland: Don't allow resizing to 0x0 or less
X windows have to be at least 1x1 pixels. https://bugs.freedesktop.org/show_bug.cgi?id=63510
This commit is contained in:
parent
07d48a306e
commit
fa514b496e
|
@ -1870,19 +1870,29 @@ send_configure(struct weston_surface *surface,
|
|||
struct weston_wm_window *window = get_wm_window(surface);
|
||||
struct weston_wm *wm = window->wm;
|
||||
struct theme *t = window->wm->theme;
|
||||
int vborder, hborder;
|
||||
|
||||
if (window->fullscreen) {
|
||||
window->width = width;
|
||||
window->height = height;
|
||||
hborder = 0;
|
||||
vborder = 0;
|
||||
} else if (window->decorate) {
|
||||
window->width = width - 2 * (t->margin + t->width);
|
||||
window->height = height - 2 * t->margin -
|
||||
t->titlebar_height - t->width;
|
||||
hborder = 2 * (t->margin + t->width);
|
||||
vborder = 2 * t->margin + t->titlebar_height + t->width;
|
||||
} else {
|
||||
window->width = width - 2 * t->margin;
|
||||
window->height = height - 2 * t->margin;
|
||||
hborder = 2 * t->margin;
|
||||
vborder = 2 * t->margin;
|
||||
}
|
||||
|
||||
if (width > hborder)
|
||||
window->width = width - hborder;
|
||||
else
|
||||
window->width = 1;
|
||||
|
||||
if (height > vborder)
|
||||
window->height = height - vborder;
|
||||
else
|
||||
window->height = 1;
|
||||
|
||||
if (window->configure_source)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue