mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-03 12:19:33 +01:00
Fix crashes on ARM due to window-size overflow
On Intel systems ArdourCanvas::COORD_MAX (1.7e+307) was rounded
to (gint) -2147483648. gtk+ treats negative window size-requests
as 1px.
However on ARM, COORD_MAX was truncated to +2147483648, gtk+ limits
this to 65535. Most WM/Xwin systems cannot handle windows this large.
It also exceeds the max size of cairo [image] surfaces.
This issue was introduced in a1c67b4ad7
when "natural_size" was removed. Before that change infinitely large
canvas had a natural_size of 2x2 px.
This commit is contained in:
parent
4048bcc6b6
commit
9e75235912
1 changed files with 14 additions and 3 deletions
|
|
@ -1559,7 +1559,18 @@ GtkCanvasViewport::on_size_request (Gtk::Requisition* req)
|
|||
_canvas.root()->size_request (width, height);
|
||||
_canvas.request_size (Duple (width, height));
|
||||
|
||||
req->width = width;
|
||||
req->height = height;
|
||||
}
|
||||
/* special case ArdourCanvas::COORD_MAX (really: no size constraint),
|
||||
* also limit to cairo constraints determined by coordinates of things
|
||||
* sent to pixman being in 16.16 format. */
|
||||
|
||||
if (width > 32767) {
|
||||
width = 0;
|
||||
}
|
||||
if (height > 32767) {
|
||||
height = 0;
|
||||
}
|
||||
|
||||
req->width = std::max<int>(1, width);
|
||||
req->height = std::max<int>(1, height);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue