From f4817e7a68533c90b9469fe666f360fe0908d9e2 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 1 Apr 2021 17:56:43 +1100 Subject: [PATCH 1/9] ci: add crashpad to path on mac --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4eaccbe4..39e69decb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -316,7 +316,7 @@ jobs: working-directory: ${{ runner.workspace }}/build run: | brew install ninja - PATH=$DEP_LOCATION:$PATH \ + PATH=$DEP_LOCATION:$DEP_LOCATION/crashpad:$PATH \ cmake $GITHUB_WORKSPACE -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G "${{ matrix.cmake-gen }}" -DCMAKE_INSTALL_PREFIX=$DEP_LOCATION - name: Build From cd96ccec70aab598cfbd2b49b5c2312fc3092fd0 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 1 Apr 2021 18:23:46 +1100 Subject: [PATCH 2/9] ci: use fake ID from crashpad --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39e69decb..2cf05e5b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,8 +85,10 @@ jobs: # Dump Crashpad symbols dump_syms app/olive-editor > olive-editor.sym - SYM_HEADER=($(head -n 1 olive-editor.sym)) # Read first line of symbol file - SYM_DIR=appdir/usr/share/olive-editor/symbols/olive-editor/${SYM_HEADER[3]} + #SYM_HEADER=($(head -n 1 olive-editor.sym)) # Read first line of symbol file + #SYM_DIR=appdir/usr/share/olive-editor/symbols/olive-editor/${SYM_HEADER[3]} + # HACK: For some reason, minidump_stackwalk reads identifier as all 0s + SYM_DIR=appdir/usr/share/olive-editor/symbols/olive-editor/000000000000000000000000000000000 mkdir -p "$SYM_DIR" mv olive-editor.sym "$SYM_DIR" From 3f0707ad3d6ae1569bac78135b25f74b909872e1 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 1 Apr 2021 19:44:09 +1100 Subject: [PATCH 3/9] ci: split appimage steps for symbol creation Apparently the AppDir process changes the olive-editor binary enough to break the symbols. As such, they must be made after creating the AppDir but before creating the AppImage. --- .github/workflows/ci.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cf05e5b9..de6dbd058 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,25 +83,28 @@ jobs: # Create install tree cmake --install app --prefix appdir/usr + # Process AppDir + /usr/local/linuxdeployqt-x86_64.AppImage \ + appdir/usr/share/applications/org.olivevideoeditor.Olive.desktop \ + -bundle-non-qt-libs \ + -executable=appdir/usr/bin/crashpad_handler \ + -executable=appdir/usr/bin/minidump_stackwalk \ + -executable=appdir/usr/bin/olive-crashhandler \ + --appimage-extract-and-run + # Dump Crashpad symbols - dump_syms app/olive-editor > olive-editor.sym - #SYM_HEADER=($(head -n 1 olive-editor.sym)) # Read first line of symbol file - #SYM_DIR=appdir/usr/share/olive-editor/symbols/olive-editor/${SYM_HEADER[3]} + dump_syms appdir/usr/bin/olive-editor > olive-editor.sym # HACK: For some reason, minidump_stackwalk reads identifier as all 0s SYM_DIR=appdir/usr/share/olive-editor/symbols/olive-editor/000000000000000000000000000000000 mkdir -p "$SYM_DIR" mv olive-editor.sym "$SYM_DIR" # Package AppImage - VERSION=${GITHUB_SHA::8} - export VERSION - /usr/local/linuxdeployqt-x86_64.AppImage \ - appdir/usr/share/applications/org.olivevideoeditor.Olive.desktop \ - -appimage \ - -executable=appdir/usr/bin/crashpad_handler \ - -executable=appdir/usr/bin/minidump_stackwalk \ - -executable=appdir/usr/bin/olive-crashhandler \ - --appimage-extract-and-run + $DOWNLOAD_TOOL https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage + chmod_+x appimagetool-x86_64.AppImage + VERSION=${GITHUB_SHA::8} ./appimagetool-x86_64.AppImage appdir + + # Set env variables filename=$(echo Olive*.AppImage) pkgname="${filename/x86_64/Linux-x86_64}" mv "${filename}" "${pkgname}" From 2cae14b71c13b7b7c5c2f9ac5697b2b48f5ac08a Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 1 Apr 2021 19:59:10 +1100 Subject: [PATCH 4/9] ci: fixed typo --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de6dbd058..7a771fd39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,7 +101,7 @@ jobs: # Package AppImage $DOWNLOAD_TOOL https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage - chmod_+x appimagetool-x86_64.AppImage + chmod +x appimagetool-x86_64.AppImage VERSION=${GITHUB_SHA::8} ./appimagetool-x86_64.AppImage appdir # Set env variables From 29dca599331c58361a9cb234f4ed665202dceec9 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 1 Apr 2021 20:06:32 +1100 Subject: [PATCH 5/9] fixed issue where autorecovery would show even after startup --- app/window/mainwindow/mainwindow.cpp | 12 +++++------- app/window/mainwindow/mainwindow.h | 4 +--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/app/window/mainwindow/mainwindow.cpp b/app/window/mainwindow/mainwindow.cpp index 89838fee9..69d81309c 100644 --- a/app/window/mainwindow/mainwindow.cpp +++ b/app/window/mainwindow/mainwindow.cpp @@ -50,9 +50,7 @@ MainWindow::MainWindow(QWidget *parent) : taskbar_interface_ = nullptr; #endif -#ifdef Q_OS_LINUX - checked_graphics_vendor_ = false; -#endif + first_show_ = true; // Create empty central widget - we don't actually want a central widget (so we set its maximum // size to 0,0) but some of Qt's docking/undocking fails without it @@ -635,10 +633,10 @@ void MainWindow::showEvent(QShowEvent *e) { QMainWindow::showEvent(e); - QMetaObject::invokeMethod(Core::instance(), "CheckForAutoRecoveries", Qt::QueuedConnection); + if (first_show_) { + QMetaObject::invokeMethod(Core::instance(), "CheckForAutoRecoveries", Qt::QueuedConnection); #ifdef Q_OS_LINUX - if (!checked_graphics_vendor_) { // Check for nouveau since that driver really doesn't work with Olive QOffscreenSurface surface; surface.create(); @@ -651,9 +649,9 @@ void MainWindow::showEvent(QShowEvent *e) QMetaObject::invokeMethod(this, "ShowNouveauWarning", Qt::QueuedConnection); } - checked_graphics_vendor_ = true; - } + first_show_ = false; #endif + } } template diff --git a/app/window/mainwindow/mainwindow.h b/app/window/mainwindow/mainwindow.h index 19760b8bf..68c34a01c 100644 --- a/app/window/mainwindow/mainwindow.h +++ b/app/window/mainwindow/mainwindow.h @@ -156,9 +156,7 @@ private: ITaskbarList3* taskbar_interface_; #endif -#ifdef Q_OS_LINUX - bool checked_graphics_vendor_; -#endif + bool first_show_; private slots: void FocusedPanelChanged(PanelWidget* panel); From 79823200c38d2883eb156dc3fc357bad05032039 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 1 Apr 2021 20:11:47 +1100 Subject: [PATCH 6/9] ci: use extract and run on all appimages --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a771fd39..de7d1167d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,7 +102,7 @@ jobs: # Package AppImage $DOWNLOAD_TOOL https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage chmod +x appimagetool-x86_64.AppImage - VERSION=${GITHUB_SHA::8} ./appimagetool-x86_64.AppImage appdir + VERSION=${GITHUB_SHA::8} ./appimagetool-x86_64.AppImage appdir --appimage-extract-and-run # Set env variables filename=$(echo Olive*.AppImage) From 2ea152479e07547060f5c1c9b9b3b050073bfadb Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 1 Apr 2021 23:45:28 +1100 Subject: [PATCH 7/9] nodeview: override icon pixmap retrieval --- app/widget/nodeview/nodeviewitem.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/widget/nodeview/nodeviewitem.cpp b/app/widget/nodeview/nodeviewitem.cpp index 7b284725e..09b899eb8 100644 --- a/app/widget/nodeview/nodeviewitem.cpp +++ b/app/widget/nodeview/nodeviewitem.cpp @@ -371,15 +371,18 @@ void NodeViewItem::DrawNodeTitle(QPainter* painter, QString text, const QRectF& { QFontMetrics fm = painter->fontMetrics(); + painter->setRenderHint(QPainter::SmoothPixmapTransform); + // Draw right or down arrow based on expanded state int icon_size = fm.height() / 2; int icon_padding = title_bar_rect_.height() / 2 - icon_size / 2; int icon_full_size = icon_size + icon_padding * 2; const QIcon& expand_icon = IsExpanded() ? icon::TriDown : icon::TriRight; - expand_icon.paint(painter, QRect(title_bar_rect_.x() + icon_padding, - title_bar_rect_.y() + icon_padding, - icon_size, - icon_size)); + int icon_size_scaled = icon_size * painter->matrix().m11(); + painter->drawPixmap(QRect(title_bar_rect_.x() + icon_padding, + title_bar_rect_.y() + icon_padding, + icon_size, + icon_size), expand_icon.pixmap(QSize(icon_size_scaled, icon_size_scaled))); // Calculate how much space we have for text int item_width = title_bar_rect_.width(); From ce2e51fc2aa61280aede52b0447e07a0e44577fc Mon Sep 17 00:00:00 2001 From: Simran Date: Thu, 1 Apr 2021 18:00:12 +0200 Subject: [PATCH 8/9] QPainter::matrix is obsolete, use transform() instead --- app/widget/nodeview/nodeviewitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/widget/nodeview/nodeviewitem.cpp b/app/widget/nodeview/nodeviewitem.cpp index 09b899eb8..1107cdd60 100644 --- a/app/widget/nodeview/nodeviewitem.cpp +++ b/app/widget/nodeview/nodeviewitem.cpp @@ -378,7 +378,7 @@ void NodeViewItem::DrawNodeTitle(QPainter* painter, QString text, const QRectF& int icon_padding = title_bar_rect_.height() / 2 - icon_size / 2; int icon_full_size = icon_size + icon_padding * 2; const QIcon& expand_icon = IsExpanded() ? icon::TriDown : icon::TriRight; - int icon_size_scaled = icon_size * painter->matrix().m11(); + int icon_size_scaled = icon_size * painter->transform().m11(); painter->drawPixmap(QRect(title_bar_rect_.x() + icon_padding, title_bar_rect_.y() + icon_padding, icon_size, From dddc110841f586eb3926cb234b306fe5c71e07d9 Mon Sep 17 00:00:00 2001 From: Simran Date: Fri, 2 Apr 2021 02:40:47 +0200 Subject: [PATCH 9/9] Build with multiple threads, not install! [skip ci] --- docker/scripts/build_crashpad.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/scripts/build_crashpad.sh b/docker/scripts/build_crashpad.sh index f935966ba..843dd3754 100644 --- a/docker/scripts/build_crashpad.sh +++ b/docker/scripts/build_crashpad.sh @@ -78,5 +78,5 @@ cd breakpad fetch breakpad cd src ./configure --prefix="${OLIVE_INSTALL_PREFIX}" -make -make install -j$(nproc) +make -j$(nproc) +make install