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:
@@ -1870,19 +1870,29 @@ send_configure(struct weston_surface *surface,
|
|||||||
struct weston_wm_window *window = get_wm_window(surface);
|
struct weston_wm_window *window = get_wm_window(surface);
|
||||||
struct weston_wm *wm = window->wm;
|
struct weston_wm *wm = window->wm;
|
||||||
struct theme *t = window->wm->theme;
|
struct theme *t = window->wm->theme;
|
||||||
|
int vborder, hborder;
|
||||||
|
|
||||||
if (window->fullscreen) {
|
if (window->fullscreen) {
|
||||||
window->width = width;
|
hborder = 0;
|
||||||
window->height = height;
|
vborder = 0;
|
||||||
} else if (window->decorate) {
|
} else if (window->decorate) {
|
||||||
window->width = width - 2 * (t->margin + t->width);
|
hborder = 2 * (t->margin + t->width);
|
||||||
window->height = height - 2 * t->margin -
|
vborder = 2 * t->margin + t->titlebar_height + t->width;
|
||||||
t->titlebar_height - t->width;
|
|
||||||
} else {
|
} else {
|
||||||
window->width = width - 2 * t->margin;
|
hborder = 2 * t->margin;
|
||||||
window->height = height - 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)
|
if (window->configure_source)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user