From e5b0d9de8da3d880d290c4a30730ef0f4ab29e48 Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 8 Mar 2022 20:57:19 -0300 Subject: [PATCH 1/3] Update tga module --- src/tga | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tga b/src/tga index 16b8bb25e..d537510d9 160000 --- a/src/tga +++ b/src/tga @@ -1 +1 @@ -Subproject commit 16b8bb25e34bfb0193609012257502be62539d35 +Subproject commit d537510d98bc9706675746d132fa460639254a78 From 8064179dfc122f82b97b68a92ddc93df7a7771e2 Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 10 Mar 2022 15:28:52 -0300 Subject: [PATCH 2/3] Don't show clipboard error when we're trying to show the File > New dialog The error is confusing because the user doesn't know that we're trying to access the clipboard info only to fill Width/Height fields automatically on File > New. Some errors (like "invalid image format") should be displayed only when we use Edit > Paste explicitly. --- src/app/util/clipboard_native.cpp | 22 +++++++++++++++++++++- src/clip | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/app/util/clipboard_native.cpp b/src/app/util/clipboard_native.cpp index 241d23845..a7df91a20 100644 --- a/src/app/util/clipboard_native.cpp +++ b/src/app/util/clipboard_native.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2021 Igara Studio S.A. +// Copyright (C) 2021-2022 Igara Studio S.A. // Copyright (C) 2016-2018 David Capello // // This program is distributed under the terms of @@ -36,12 +36,28 @@ using namespace base::serialization::little_endian; namespace { clip::format custom_image_format = 0; + bool show_clip_errors = true; + + class InhibitClipErrors { + bool m_saved; + public: + InhibitClipErrors() { + m_saved = show_clip_errors; + show_clip_errors = false; + } + ~InhibitClipErrors() { + show_clip_errors = m_saved; + } + }; void* native_display_handle() { return os::instance()->defaultWindow()->nativeHandle(); } void custom_error_handler(clip::ErrorCode code) { + if (!show_clip_errors) + return; + switch (code) { case clip::ErrorCode::CannotLock: ui::Alert::show(Strings::alerts_clipboard_access_locked()); @@ -289,6 +305,10 @@ bool get_native_clipboard_bitmap(doc::Image** image, bool get_native_clipboard_bitmap_size(gfx::Size* size) { + // Don't show errors when we are trying to get the size of the image + // only. (E.g. don't show "invalid image format error") + InhibitClipErrors inhibitErrors; + clip::image_spec spec; if (clip::get_image_spec(spec)) { size->w = spec.width; diff --git a/src/clip b/src/clip index c46c49141..2ada8b17b 160000 --- a/src/clip +++ b/src/clip @@ -1 +1 @@ -Subproject commit c46c49141f72dd753b260eea4e6d7b37413f0ff6 +Subproject commit 2ada8b17b39bf41a669248a2be5c6e4be4c27f14 From 54c354f5d2f83af4644695529f0d60f9215481a1 Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 10 Mar 2022 15:44:56 -0300 Subject: [PATCH 3/3] Fix forward declaration of os::Sampling --- laf | 2 +- src/ui/graphics.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/laf b/laf index 02ed21d12..1597f3550 160000 --- a/laf +++ b/laf @@ -1 +1 @@ -Subproject commit 02ed21d1214ff913150fe3caf1470f2ee0dc6f14 +Subproject commit 1597f3550ad8cff3424a22b0deb1c49720dcb483 diff --git a/src/ui/graphics.h b/src/ui/graphics.h index ebdc90ad4..7c250b2a6 100644 --- a/src/ui/graphics.h +++ b/src/ui/graphics.h @@ -30,7 +30,7 @@ namespace gfx { namespace os { class DrawTextDelegate; - class Sampling; + struct Sampling; } namespace ui {