Compare commits

..

11 Commits

Author SHA1 Message Date
Kovid Goyal
f3726023c2 version 0.20.1 2021-04-19 21:45:08 +05:30
Kovid Goyal
cb41683f47 ... 2021-04-19 20:12:20 +05:30
Kovid Goyal
629a8ad055 Fix #3501 2021-04-19 19:58:02 +05:30
Kovid Goyal
4ba0fa00b4 Update changelog 2021-04-19 18:07:03 +05:30
Kovid Goyal
f1e73c015a Merge branch 'hyperlink_unbound_variable' of https://github.com/miseran/kitty 2021-04-19 18:03:18 +05:30
Reto Schnyder
926c3540ff Fix unbound variable in hyperlink handling 2021-04-19 14:19:13 +02:00
Kovid Goyal
1aebd83e45 A little clearer code 2021-04-19 17:42:15 +05:30
Kovid Goyal
8225351145 icat: When displaying an animated GIF image with no delays between frames, add a 100ms delay between every frame.
This allows some broken images tested with broken software *cough* browsers to work.
See #3498
2021-04-19 17:17:45 +05:30
Kovid Goyal
379add8d6f IntEnum was needed 2021-04-19 17:09:23 +05:30
Kovid Goyal
ea11ce8664 Use a normal enum for Dispose rather than an IntEnum 2021-04-19 16:57:43 +05:30
Kovid Goyal
82e9e96f0c Fix CodeQL warnings 2021-04-19 14:00:53 +05:30
6 changed files with 29 additions and 5 deletions

View File

@@ -4,6 +4,19 @@ Changelog
|kitty| is a feature-rich, cross-platform, *fast*, GPU based terminal.
To update |kitty|, :doc:`follow the instructions <binary>`.
0.20.1 [2021-04-19]
----------------------
- icat: Fix some broken GIF images with no frame delays not being animated
(:iss:`3498`)
- hints kitten: Fix sending hyperlinks to their default handler not working
(:pull:`3500`)
- Wayland: Fix regression in previous release causing window decorations to
be drawn even when compositor supports server side decorations (:iss:`3501`)
0.20.0 [2021-04-19]
----------------------

1
glfw/wl_window.c vendored
View File

@@ -486,6 +486,7 @@ static void setXdgDecorations(_GLFWwindow* window)
{
if (_glfw.wl.decorationManager)
{
window->wl.decorations.serverSide = true;
window->wl.xdg.decoration =
zxdg_decoration_manager_v1_get_toplevel_decoration(
_glfw.wl.decorationManager, window->wl.xdg.toplevel);

View File

@@ -756,6 +756,7 @@ def handle_result(args: List[str], data: Dict[str, Any], target_window_id: int,
cwd = data['cwd']
program = None if program == 'default' else program
if text_type == 'hyperlink':
w = boss.window_id_map.get(target_window_id)
for m in matches:
if w is not None:
w.open_url(m, hyperlink_id=1, cwd=cwd)

View File

@@ -75,7 +75,7 @@ class Frame:
def __repr__(self) -> str:
canvas = f'{self.canvas_width}x{self.canvas_height}:{self.canvas_x}+{self.canvas_y}'
geom = f'{self.width}x{self.height}'
return f'Frame(index={self.index}, gap={self.gap}, geom={geom}, canvas={canvas})'
return f'Frame(index={self.index}, gap={self.gap}, geom={geom}, canvas={canvas}, dispose={self.dispose.name})'
class ImageData:
@@ -153,12 +153,21 @@ def identify(path: str) -> ImageData:
data = json.loads(b'[' + p.stdout.rstrip(b',') + b']')
first = data[0]
frames = list(map(Frame, data))
image_fmt = first['fmt'].lower()
if image_fmt == 'gif' and not any(f.gap > 0 for f in frames):
# Some broken GIF images have all zero gaps, browsers with their usual
# idiot ideas render these with a default 100ms gap https://bugzilla.mozilla.org/show_bug.cgi?id=125137
# Browsers actually force a 100ms gap at any zero gap frame, but that
# just means it is impossible to deliberately use zero gap frames for
# sophisticated blending, so we dont do that.
for f in frames:
f.gap = 100
mode = 'rgb'
for f in frames:
if f.mode == 'rgba':
mode = 'rgba'
break
return ImageData(first['fmt'].lower(), frames[0].canvas_width, frames[0].canvas_height, mode, frames)
return ImageData(image_fmt, frames[0].canvas_width, frames[0].canvas_height, mode, frames)
class RenderedImage(ImageData):

View File

@@ -21,7 +21,7 @@ class Version(NamedTuple):
appname: str = 'kitty'
kitty_face = '🐱'
version: Version = Version(0, 20, 0)
version: Version = Version(0, 20, 1)
str_version: str = '.'.join(map(str, version))
_plat = sys.platform.lower()
is_macos: bool = 'darwin' in _plat

View File

@@ -344,7 +344,7 @@ render_run(RenderCtx *ctx, RenderState *rs) {
if (pbm.rows > bm_height) {
double ratio = pbm.width / (double)pbm.rows;
bm_width = (unsigned)(ratio * bm_height);
buf = calloc(sizeof(pixel), bm_height * bm_width);
buf = calloc(sizeof(pixel), (size_t)bm_height * bm_width);
if (!buf) break;
downsample_32bit_image(pbm.buf, pbm.width, pbm.rows, pbm.stride, buf, bm_width, bm_height);
pbm.buf = buf; pbm.stride = 4 * bm_width; pbm.width = bm_width; pbm.rows = bm_height;
@@ -502,7 +502,7 @@ render_line(PyObject *self UNUSED, PyObject *args, PyObject *kw) {
float x_offset = 0, y_offset = 0;
static const char* kwlist[] = {"text", "width", "height", "font_family", "bold", "italic", "fg", "bg", "x_offset", "y_offset", "right_margin", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kw, "|sIIzppkkffI", (char**)kwlist, &text, &width, &height, &family, &bold, &italic, &fg, &bg, &x_offset, &y_offset, &right_margin)) return NULL;
PyObject *ans = PyBytes_FromStringAndSize(NULL, width * height * 4);
PyObject *ans = PyBytes_FromStringAndSize(NULL, (Py_ssize_t)width * height * 4);
if (!ans) return NULL;
uint8_t *buffer = (u_int8_t*) PyBytes_AS_STRING(ans);
RenderCtx *ctx = (RenderCtx*)create_freetype_render_context(family, bold, italic);