Merge branch 'main' into beta

This commit is contained in:
David Capello 2022-03-10 15:50:05 -03:00
commit ffc7af2ee8
5 changed files with 25 additions and 5 deletions

2
laf

@ -1 +1 @@
Subproject commit 02ed21d1214ff913150fe3caf1470f2ee0dc6f14
Subproject commit 1597f3550ad8cff3424a22b0deb1c49720dcb483

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2020-2021 Igara Studio S.A.
// Copyright (C) 2020-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_window_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());
@ -301,6 +317,10 @@ bool Clipboard::getNativeBitmap(doc::Image** image,
bool Clipboard::getNativeBitmapSize(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;

@ -1 +1 @@
Subproject commit c46c49141f72dd753b260eea4e6d7b37413f0ff6
Subproject commit 2ada8b17b39bf41a669248a2be5c6e4be4c27f14

@ -1 +1 @@
Subproject commit 16b8bb25e34bfb0193609012257502be62539d35
Subproject commit d537510d98bc9706675746d132fa460639254a78

View File

@ -30,7 +30,7 @@ namespace gfx {
namespace os {
class DrawTextDelegate;
class Sampling;
struct Sampling;
}
namespace ui {