Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ksnip for openSUSE:Factory checked in at 2021-12-07 23:59:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ksnip (Old) and /work/SRC/openSUSE:Factory/.ksnip.new.31177 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ksnip" Tue Dec 7 23:59:47 2021 rev:12 rq:935192 version:1.9.2 Changes: -------- --- /work/SRC/openSUSE:Factory/ksnip/ksnip.changes 2021-09-27 20:08:48.870455920 +0200 +++ /work/SRC/openSUSE:Factory/.ksnip.new.31177/ksnip.changes 2021-12-07 23:59:48.403728266 +0100 @@ -1,0 +2,19 @@ +Thu Nov 25 23:12:07 UTC 2021 - Martin Hauke <[email protected]> + +- Update to 1.9.2 + New + * Set image save location on command line. + * Add debug logging. + * Add FTP upload. + * Upload image via command line without opening editor. + * Add multi-language comment option to desktop file. + * Add MimeType of Images to desktop file. + * Add .jpeg to open file dialog filter (File > Open). + * Escape closes window (and exits when not using tray). + Fixed + * Opens a new window for each capture. + * First cli invocation won't copy image to clipboard. + Changed + * Improve translation experience by using full sentences. + +------------------------------------------------------------------- Old: ---- ksnip-1.9.1.tar.gz New: ---- ksnip-1.9.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ksnip.spec ++++++ --- /var/tmp/diff_new_pack.cd8v7c/_old 2021-12-07 23:59:49.019726158 +0100 +++ /var/tmp/diff_new_pack.cd8v7c/_new 2021-12-07 23:59:49.019726158 +0100 @@ -17,7 +17,7 @@ Name: ksnip -Version: 1.9.1 +Version: 1.9.2 Release: 0 Summary: Screenshot tool License: GPL-2.0-or-later @@ -29,7 +29,7 @@ BuildRequires: gcc-c++ BuildRequires: hicolor-icon-theme BuildRequires: kColorPicker-devel -BuildRequires: kImageAnnotator-devel >= 0.5.2 +BuildRequires: kImageAnnotator-devel >= 0.5.3 BuildRequires: pkgconfig BuildRequires: update-desktop-files BuildRequires: xvfb-run ++++++ ksnip-1.9.1.tar.gz -> ksnip-1.9.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/.github/scripts/linux/deb/debian/control new/ksnip-1.9.2/.github/scripts/linux/deb/debian/control --- old/ksnip-1.9.1/.github/scripts/linux/deb/debian/control 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/.github/scripts/linux/deb/debian/control 2021-11-22 22:47:53.000000000 +0100 @@ -9,5 +9,6 @@ Package: ksnip Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} +Conflicts: libkimageannotator-common Description: Screenshot Tool Screenshot tool that provides many annotation features for your screenshots. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/.github/scripts/linux/deb/debian/rules new/ksnip-1.9.2/.github/scripts/linux/deb/debian/rules --- old/ksnip-1.9.1/.github/scripts/linux/deb/debian/rules 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/.github/scripts/linux/deb/debian/rules 2021-11-22 22:47:53.000000000 +0100 @@ -25,3 +25,9 @@ override_dh_shlibdeps: dh_shlibdeps -l"$(Qt5_DIR)/lib" --dpkg-shlibdeps-params=--ignore-missing-info + +# Manually install kimageannotator translation files +override_dh_auto_install: + dh_auto_install + mkdir -p $(CURDIR)/debian/ksnip/usr/ + cp -r $(INSTALL_PREFIX)/share $(CURDIR)/debian/ksnip/usr/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/.github/scripts/setup_build_variables.sh new/ksnip-1.9.2/.github/scripts/setup_build_variables.sh --- old/ksnip-1.9.1/.github/scripts/setup_build_variables.sh 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/.github/scripts/setup_build_variables.sh 2021-11-22 22:47:53.000000000 +0100 @@ -12,6 +12,7 @@ echo "BUILD_TIME=$BUILD_TIME" >> $GITHUB_ENV echo "BUILD_DATE=$BUILD_DATE" >> $GITHUB_ENV echo "BUILD_NUMBER=$BUILD_NUMBER" >> $GITHUB_ENV +echo "VERSION_REGEX=$VERSION_REGEX" >> $GITHUB_ENV echo "WORKSPACE=$WORKSPACE" >> $GITHUB_ENV echo "INSTALL_PREFIX=$INSTALL_PREFIX" >> $GITHUB_ENV echo "VERSION_NUMBER=$VERSION_NUMBER" >> $GITHUB_ENV @@ -20,7 +21,7 @@ if [[ "$GITHUB_REF" = refs/tags* ]]; then - GITHUB_TAG=${$GITHUB_REF#refs/tags/} + GITHUB_TAG=${GITHUB_REF#refs/tags/} echo "GitHub Tag is: $GITHUB_TAG" echo "GITHUB_TAG=$GITHUB_TAG" >> $GITHUB_ENV else @@ -41,5 +42,7 @@ # Message show on the release page -UPLOADTOOL_BODY="GitHub Action build logs: https://github.com/ksnip/ksnip/actions" +ACTION_LINK_TEXT="GitHub Action build logs: https://github.com/ksnip/ksnip/actions" +BUILD_TIME_TEXT="Build Time: $(date +"%a, %d %b %Y %T")" +UPLOADTOOL_BODY="${ACTION_LINK_TEXT}\n${BUILD_TIME_TEXT}" echo "UPLOADTOOL_BODY=$UPLOADTOOL_BODY" >> $GITHUB_ENV \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/.github/scripts/windows/package_exe.sh new/ksnip-1.9.2/.github/scripts/windows/package_exe.sh --- old/ksnip-1.9.1/.github/scripts/windows/package_exe.sh 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/.github/scripts/windows/package_exe.sh 2021-11-22 22:47:53.000000000 +0100 @@ -3,10 +3,13 @@ mkdir packageDir mv build/src/ksnip*.exe packageDir/ksnip.exe -windeployqt.exe packageDir/ksnip.exe +windeployqt.exe --no-opengl-sw --no-system-d3d-compiler --release packageDir/ksnip.exe cp build/translations/ksnip_*.qm ./packageDir/translations/ cp kImageAnnotator/build/translations/kImageAnnotator_*.qm ./packageDir/translations/ -cp open_ssl/{libeay32.dll,ssleay32.dll} ./packageDir/ || true + +cp "${OPENSSL_DIR}"/*.dll ./packageDir/ + +cp "${COMPILE_RUNTIME_DIR}"/*.dll ./packageDir/ 7z a ksnip-${VERSION}-windows.zip ./packageDir/* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/.github/scripts/windows/setup_windows_build_variables.sh new/ksnip-1.9.2/.github/scripts/windows/setup_windows_build_variables.sh --- old/ksnip-1.9.1/.github/scripts/windows/setup_windows_build_variables.sh 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/.github/scripts/windows/setup_windows_build_variables.sh 2021-11-22 22:47:53.000000000 +0100 @@ -6,4 +6,5 @@ echo "LIB=$LIB;$INSTALL_PREFIX/lib" >> $GITHUB_ENV echo "INCLUDE=$INCLUDE;$INSTALL_PREFIX/include" >> $GITHUB_ENV echo "OPENSSL_DIR=$WORKSPACE/OpenSSL" >> $GITHUB_ENV +echo "COMPILE_RUNTIME_DIR=$WORKSPACE/CompileRuntime" >> $GITHUB_ENV echo "KIMAGEANNOTATOR_DIR=${INSTALL_PREFIX}" >> $GITHUB_ENV \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/.github/workflows/linux.yml new/ksnip-1.9.2/.github/workflows/linux.yml --- old/ksnip-1.9.1/.github/workflows/linux.yml 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/.github/workflows/linux.yml 2021-11-22 22:47:53.000000000 +0100 @@ -107,7 +107,7 @@ - name: Install Qt uses: jurplel/install-qt-action@v2 with: - version: '5.15.2' + version: '5.12.7' host: 'linux' install-deps: 'true' @@ -153,7 +153,7 @@ - name: Install Qt uses: jurplel/install-qt-action@v2 with: - version: '5.15.2' + version: '5.12.7' host: 'linux' install-deps: 'true' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/.github/workflows/windows.yml new/ksnip-1.9.2/.github/workflows/windows.yml --- old/ksnip-1.9.1/.github/workflows/windows.yml 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/.github/workflows/windows.yml 2021-11-22 22:47:53.000000000 +0100 @@ -81,8 +81,13 @@ - name: Download OpenSSL run: | - curl "https://indy.fulgan.com/SSL/openssl-1.0.2q-i386-win32.zip" --output openssl.zip - 7z x openssl.zip -o"${{ env.OPENSSL_DIR }}" || true + curl -L "https://github.com/ksnip/dependencies/raw/master/windows/openSSL.zip" --output openssl.zip + 7z x openssl.zip -o"${{ env.OPENSSL_DIR }}" + + - name: Download CompileRuntime + run: | + curl -L "https://github.com/ksnip/dependencies/raw/master/windows/compileRuntime.zip" --output compileruntime.zip + 7z x compileruntime.zip -o"${{ env.COMPILE_RUNTIME_DIR }}" - name: Package exe run: bash ./.github/scripts/windows/package_exe.sh @@ -127,8 +132,13 @@ - name: Download OpenSSL run: | - curl "https://indy.fulgan.com/SSL/openssl-1.0.2q-i386-win32.zip" --output openssl.zip - 7z x openssl.zip -o"${{ env.OPENSSL_DIR }}" || true + curl -L "https://github.com/ksnip/dependencies/raw/master/windows/openSSL.zip" --output openssl.zip + 7z x openssl.zip -o"${{ env.OPENSSL_DIR }}" + + - name: Download CompileRuntime + run: | + curl -L "https://github.com/ksnip/dependencies/raw/master/windows/compileRuntime.zip" --output compileruntime.zip + 7z x compileruntime.zip -o"${{ env.COMPILE_RUNTIME_DIR }}" - name: Build run: bash ./.github/scripts/build_ksnip.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/CHANGELOG.md new/ksnip-1.9.2/CHANGELOG.md --- old/ksnip-1.9.1/CHANGELOG.md 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/CHANGELOG.md 2021-11-22 22:47:53.000000000 +0100 @@ -1,5 +1,25 @@ # Change log +## Release 1.9.2 +* Fixed: Version `Qt_5.15' not found (required by /usr/bin/ksnip). ([#712](https://github.com/ksnip/ksnip/issues/712)) +* Fixed: CI packages show continuous suffix for tagged build. ([#710](https://github.com/ksnip/ksnip/issues/710)) +* Fixed: kImageAnnotator not translated with deb package. ([#359](https://github.com/ksnip/ksnip/issues/359)) +* Fixed: Windows packages increased in size. ([#713](https://github.com/ksnip/ksnip/issues/713)) +* Fixed: The string 'Actions' is not available for translation. ([#729](https://github.com/ksnip/ksnip/issues/729)) +* Fixed: HiDPI issue with multiple screen on Windows. ([#668](https://github.com/ksnip/ksnip/issues/668)) +* Fixed: Snipping Area not closing when pressing ESC. ([#735](https://github.com/ksnip/ksnip/issues/735)) +* Fixed: Sometimes "Snipping Area Rulers" not shown after starting rectangular selection. ([#684](https://github.com/ksnip/ksnip/issues/684)) +* Fixed: Cursor not positioned correctly when snipping area opens. ([#736](https://github.com/ksnip/ksnip/issues/736)) +* Fixed: Mouse cursor not captured when triggered via global shortcut. ([#737](https://github.com/ksnip/ksnip/issues/737)) +* Fixed: Dual 4K screens get scrambled on X11. ([#734](https://github.com/ksnip/ksnip/issues/734)) +* Fixed: VCRUNTIME140_1.dll was not found. ([#743](https://github.com/ksnip/ksnip/issues/743)) +* Fixed: Screenshot area issue when monitor count changes on Windows. ([#722](https://github.com/ksnip/ksnip/issues/722)) +* Fixed: Wayland does not support QWindow::requestActivate(). ([#656](https://github.com/ksnip/ksnip/issues/656)) +* Fixed: Wrong area is captured on a Wayland screen scaling. ([#691](https://github.com/ksnip/ksnip/issues/691)) +* Changed: Enforce xdg-desktop-portal screenshots for Gnome >= 41. ([#727](https://github.com/ksnip/ksnip/issues/727)) +* Fixed kImageAnnotator: Crash while typing text on wayland. ([#256](https://github.com/ksnip/kImageAnnotator/issues/256)) +* Changed kImageAnnotator: Show scrollbar when not all tools visible. ([#258](https://github.com/ksnip/kImageAnnotator/issues/258)) + ## Release 1.9.1 * Fixed: MacOS package damaged and not starting. ([#653](https://github.com/ksnip/ksnip/issues/653)) * Fixed: Deb CI build is frequently failing due to docker image pull limit. ([#655](https://github.com/ksnip/ksnip/issues/655)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/CMakeLists.txt new/ksnip-1.9.2/CMakeLists.txt --- old/ksnip-1.9.1/CMakeLists.txt 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/CMakeLists.txt 2021-11-22 22:47:53.000000000 +0100 @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.5) -project(ksnip LANGUAGES CXX VERSION 1.9.1) +project(ksnip LANGUAGES CXX VERSION 1.9.2) if (DEFINED VERSION_SUFIX AND NOT "${VERSION_SUFIX}" STREQUAL "") set(KSNIP_VERSION_SUFIX "-${VERSION_SUFIX}") @@ -60,10 +60,10 @@ find_package(Qt5 ${QT_MIN_VERSION} REQUIRED ${QT_COMPONENTS}) -set(KIMAGEANNOTATOR_MIN_VERSION "0.5.2") +set(KIMAGEANNOTATOR_MIN_VERSION 0.5.3) find_package(kImageAnnotator ${KIMAGEANNOTATOR_MIN_VERSION} REQUIRED) -set(KCOLORPICKER_MIN_VERSION "0.1.6") +set(KCOLORPICKER_MIN_VERSION 0.1.6) find_package(kColorPicker ${KCOLORPICKER_MIN_VERSION} REQUIRED) set(BASEPATH "${CMAKE_SOURCE_DIR}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/README.md new/ksnip-1.9.2/README.md --- old/ksnip-1.9.1/README.md 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/README.md 2021-11-22 22:47:53.000000000 +0100 @@ -1,8 +1,9 @@ # [ksnip](http://ksnip.org/) [![Linux build status][github-linux-badge]][github-linux-url] [![Windows build status][github-windows-badge]][github-windows-url] [![MacOS build status][github-macos-badge]][github-macos-url] [![GitHub commits (since latest release)][gh-comm-since-badge]][gh-comm-since-url] [![Translation status][weblate-badge]][weblate-url] [![GitHub total downloads][gh-dl-badge]][gh-dl-url] [![SourceForge total downloads][sf-dt-badge]][sf-dt-badge-url] [![Discord][discord-badge]][discord-badge-url] +[![IRC: #ksnip on libera.chat][libera-badge]][libera-badge-url] -Version v1.9.1 +Version v1.9.2 Ksnip is a Qt-based cross-platform screenshot tool that provides many annotation features for your screenshots. @@ -64,8 +65,10 @@ ### AppImage To use AppImages, make them executable and run them, no installation required. -`$ chmod a+x ksnip*.AppImage` -`$ ./ksnip*.AppImage` +``` +$ chmod a+x ksnip*.AppImage +$ ./ksnip*.AppImage +``` More info about setting to executable can be found [here](https://discourse.appimage.org/t/how-to-make-an-appimage-executable/80). @@ -77,9 +80,9 @@ ``` ### DEB -Just install them via dpkg and start using. +Just install them via apt and start using. ``` -$ sudo dpkg -i ksnip*.deb +$ sudo apt install ./ksnip*.deb $ ksnip ``` @@ -97,6 +100,14 @@ sudo apt install ksnip ``` +For Debian 11 and later releases, you can install from the [official package](https://tracker.debian.org/pkg/ksnip): +``` +$ sudo apt install ksnip +``` + +For Debian 10 and Debian 9, ksnip is available via [Debian Backports](https://backports.debian.org/). +Please enable `bullseye-backports` and `buster-backports` repo for Debian 10 and Debian 9 respectively before installing using `sudo apt install ksnip`. + ### Archlinux Ksnip is in the [Community repository](https://archlinux.org/packages/community/x86_64/ksnip/), so you can install it directly via pacman. ``` @@ -215,6 +226,13 @@ 2. Under Gnome Wayland copying images to clipboard and then pasting them somewhere might not work. This happens currently with native Wayland. A workaround is using XWayland by starting ksnip like this `QT_QPA_PLATFORM=xcb /usr/bin/ksnip` or switch to XWayland completely by exporting that variable `export QT_QPA_PLATFORM=xcb`. Issue [#416](https://github.com/ksnip/ksnip/issues/416) +3. Native Wayland screenshots are no longer possible with Gnome 41 and higher. The Gnome developers have forbidden +access to the DBus interface that provides Screenshots under Wayland and leave non Gnome application only the possibility +to use xdg-desktop-portal screenshots. Security comes before usability for the Gnome developers. There is an open feature +request to only grant screenshot permission once instead of for every screenshot, help us raise awareness for such feature +[here](https://github.com/flatpak/xdg-desktop-portal/issues/649). +4. Global Hotkeys don't work under Wayland, this is due to the secure nature of Wayland. As long as compositor developers +don't provide an interface for us to work with Global Hotkeys, does won't be supported. # Discussion & Community If you have general questions, ideas or just want to talk about ksnip, please join our [Discord](http://discord.ksnip.org) server. @@ -257,3 +275,6 @@ [discord-badge]: https://img.shields.io/discord/812295724837371955.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2 [discord-badge-url]: http://discord.ksnip.org + +[libera-badge]: https://img.shields.io/badge/libera.chat-%23ksnip-brightgreen.svg +[libera-badge-url]: https://web.libera.chat/?channels=#ksnip diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/desktop/org.ksnip.ksnip.appdata.xml new/ksnip-1.9.2/desktop/org.ksnip.ksnip.appdata.xml --- old/ksnip-1.9.1/desktop/org.ksnip.ksnip.appdata.xml 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/desktop/org.ksnip.ksnip.appdata.xml 2021-11-22 22:47:53.000000000 +0100 @@ -84,6 +84,30 @@ <update_contact>[email protected]</update_contact> <content_rating type="oars-1.0" /> <releases> + <release type="stable" version="1.9.2" date="2021-11-22T00:00:00Z"> + <description> + <ul> + <li>Fixed: Version `Qt_5.15' not found (required by /usr/bin/ksnip).</li> + <li>Fixed: CI packages show continuous suffix for tagged build.</li> + <li>Fixed: kImageAnnotator not translated with deb package.</li> + <li>Fixed: Windows packages increased in size.</li> + <li>Fixed: The string 'Actions' is not available for translation.</li> + <li>Fixed: HiDPI issue with multiple screen on Windows.</li> + <li>Fixed: Snipping Area not closing when pressing ESC.</li> + <li>Fixed: Sometimes "Snipping Area Rulers" not shown after starting rectangular selection.</li> + <li>Fixed: Cursor not positioned correctly when snipping area opens.</li> + <li>Fixed: Mouse cursor not captured when triggered via global shortcut.</li> + <li>Fixed: Dual 4K screens get scrambled on X11.</li> + <li>Fixed: VCRUNTIME140_1.dll was not found.</li> + <li>Fixed: Screenshot area issues when monitor count changes on Windows.</li> + <li>Fixed: Wayland does not support QWindow::requestActivate().</li> + <li>Fixed: Wrong area is captured on a Wayland screen scaling.</li> + <li>Changed: Enforce xdg-desktop-portal screenshots for Gnome >= 41.</li> + <li>Fixed kImageAnnotator: Crash while typing text on wayland.</li> + <li>Changed kImageAnnotator: Show scrollbar when not all tools visible.</li> + </ul> + </description> + </release> <release type="stable" version="1.9.1" date="2021-09-13T00:00:00Z"> <description> <ul> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/desktop/org.ksnip.ksnip.desktop new/ksnip-1.9.2/desktop/org.ksnip.ksnip.desktop --- old/ksnip-1.9.1/desktop/org.ksnip.ksnip.desktop 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/desktop/org.ksnip.ksnip.desktop 2021-11-22 22:47:53.000000000 +0100 @@ -9,23 +9,24 @@ Comment=Cross-platform screenshot tool that provides many annotation features for your screenshots. Categories=Utility; Actions=Area;LastArea;FullScreen;Window; +X-KDE-DBUS-Restricted-Interfaces=org.kde.kwin.Screenshot,org.kde.KWin.ScreenShot2 [Desktop Action Area] -Exec=ksnip -r +Exec=ksnip -r -c Icon=ksnip Name=Capture a rectangular area [Desktop Action LastArea] -Exec=ksnip -l +Exec=ksnip -l -c Icon=ksnip Name=Capture last selected rectangular area [Desktop Action FullScreen] -Exec=ksnip -m +Exec=ksnip -m -c Icon=ksnip Name=Capture a fullscreen [Desktop Action Window] -Exec=ksnip -a +Exec=ksnip -a -c Icon=ksnip Name=Capture the focused window diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/snap/snapcraft.yaml new/ksnip-1.9.2/snap/snapcraft.yaml --- old/ksnip-1.9.1/snap/snapcraft.yaml 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/snap/snapcraft.yaml 2021-11-22 22:47:53.000000000 +0100 @@ -53,7 +53,7 @@ snapcraftctl set-version $(cat CMakeLists.txt | grep project\(ksnip | cut -d" " -f5 | cut -d")" -f1) kimageannotator: source: https://github.com/ksnip/kImageAnnotator.git - source-tag: v0.5.2 + source-tag: v0.5.3 plugin: cmake after: - kcolorpicker diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/CMakeLists.txt new/ksnip-1.9.2/src/CMakeLists.txt --- old/ksnip-1.9.1/src/CMakeLists.txt 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/CMakeLists.txt 2021-11-22 22:47:53.000000000 +0100 @@ -164,7 +164,8 @@ ${CMAKE_SOURCE_DIR}/src/common/platform/PlatformChecker.cpp ${CMAKE_SOURCE_DIR}/src/common/platform/CommandRunner.cpp ${CMAKE_SOURCE_DIR}/src/common/adapter/fileDialog/SnapFileDialogAdapter.cpp - ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/LinuxSnippingArea.cpp + ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/X11SnippingArea.cpp + ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/WaylandSnippingArea.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/X11KeyHandler.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/KeySequenceToX11KeyCodeTranslator.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/X11ErrorLogger.cpp @@ -267,22 +268,30 @@ install(TARGETS ksnip RUNTIME DESTINATION .) find_program(WINDEPLOYQT windeployqt HINTS $ENV{QTDIR} PATH_SUFFIXES bin) - install(CODE "execute_process(COMMAND ${WINDEPLOYQT} . WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX})") + SET(WINDEPLOYQT_PARAMETERS "--no-opengl-sw --no-system-d3d-compiler --no-compiler-runtime --release") + install(CODE "execute_process(COMMAND ${WINDEPLOYQT} ${WINDEPLOYQT_PARAMETERS} . WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX})") find_program(COPY cp) if (DEFINED ENV{OPENSSL_DIR}) file(TO_CMAKE_PATH "$ENV{OPENSSL_DIR}" OPENSSL_DIR) - install(CODE "execute_process(COMMAND ${COPY} ${OPENSSL_DIR}/libeay32.dll ${OPENSSL_DIR}/ssleay32.dll \${CMAKE_INSTALL_PREFIX})") + install(CODE "execute_process(COMMAND ${COPY} ${OPENSSL_DIR}/*.dll \${CMAKE_INSTALL_PREFIX})") else () - message("OPENSSL_DIR not set, not able to install openssl dependencies.") + message("OPENSSL_DIR not set, not able to install openssl dependencies, skipping.") + endif() + + if (DEFINED ENV{COMPILE_RUNTIME_DIR}) + file(TO_CMAKE_PATH "$ENV{COMPILE_RUNTIME_DIR}" COMPILE_RUNTIME_DIR) + install(CODE "execute_process(COMMAND ${COPY} ${COMPILE_RUNTIME_DIR}/*.dll \${CMAKE_INSTALL_PREFIX})") + else () + message("COMPILE_RUNTIME_DIR not set, not able to install compile runtime dependencies, skipping.") endif() if (DEFINED ENV{KIMAGEANNOTATOR_DIR}) file(TO_CMAKE_PATH "$ENV{KIMAGEANNOTATOR_DIR}" KIMAGEANNOTATOR_DIR) install(CODE "execute_process(COMMAND ${COPY} -r \"${KIMAGEANNOTATOR_DIR}/${KIMAGEANNOTATOR_LANG_INSTALL_DIR}\" \${CMAKE_INSTALL_PREFIX})") else () - message("KIMAGEANNOTATOR_DIR not set, not able to install kImageAnnotator translations.") + message("KIMAGEANNOTATOR_DIR not set, not able to install kImageAnnotator translations, skipping.") endif() set_property(INSTALL "ksnip.exe" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/backend/TranslationLoader.cpp new/ksnip-1.9.2/src/backend/TranslationLoader.cpp --- old/ksnip-1.9.1/src/backend/TranslationLoader.cpp 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/backend/TranslationLoader.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -39,11 +39,16 @@ translationSuccessfullyLoaded = loadTranslationFromRelativePath(translator, path, applicationName); } - // Fix for appimages as they need to use relative paths + // Translation loading for AppImage if (!translationSuccessfullyLoaded) { translationSuccessfullyLoaded = loadTranslationForAppImage(translator, path, applicationName); } + // Translation loading for Snap + if (!translationSuccessfullyLoaded) { + translationSuccessfullyLoaded = loadTranslationForSnap(translator, path, applicationName); + } + if (translationSuccessfullyLoaded) { app.installTranslator(translator); } else { @@ -68,6 +73,12 @@ return loadTranslation(translator, relativePathToAppDir + path, applicationName); } +bool TranslationLoader::loadTranslationForSnap(QTranslator *translator, const QString &path, const QString &applicationName) +{ + auto relativePathToSnapVersionDir = QCoreApplication::applicationDirPath() + QLatin1String("/.."); + return loadTranslation(translator, relativePathToSnapVersionDir + path, applicationName); +} + bool TranslationLoader::loadTranslation(QTranslator *translator, const QString &path, const QString &applicationName) { auto separator = QLatin1String("_"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/backend/TranslationLoader.h new/ksnip-1.9.2/src/backend/TranslationLoader.h --- old/ksnip-1.9.1/src/backend/TranslationLoader.h 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/backend/TranslationLoader.h 2021-11-22 22:47:53.000000000 +0100 @@ -37,6 +37,7 @@ static bool loadTranslationFromAbsolutePath(QTranslator *translator, const QString &path, const QString &applicationName); static bool loadTranslationFromRelativePath(QTranslator *translator, const QString &path, const QString &applicationName); static bool loadTranslationForAppImage(QTranslator *translator, const QString &path, const QString &applicationName); + static bool loadTranslationForSnap(QTranslator *translator, const QString &path, const QString &applicationName); static bool loadTranslation(QTranslator *translator, const QString &path, const QString &applicationName); static void loadTranslations(const QApplication &app, QTranslator *translator, QString &path, const QString &applicationName); }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/backend/imageGrabber/BaseX11ImageGrabber.cpp new/ksnip-1.9.2/src/backend/imageGrabber/BaseX11ImageGrabber.cpp --- old/ksnip-1.9.1/src/backend/imageGrabber/BaseX11ImageGrabber.cpp 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/backend/imageGrabber/BaseX11ImageGrabber.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -21,7 +21,7 @@ #include "BaseX11ImageGrabber.h" BaseX11ImageGrabber::BaseX11ImageGrabber(X11Wrapper *x11Wrapper) : - AbstractRectAreaImageGrabber(new LinuxSnippingArea), + AbstractRectAreaImageGrabber(new X11SnippingArea), mX11Wrapper(x11Wrapper) { addSupportedCaptureMode(CaptureModes::RectArea); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/backend/imageGrabber/BaseX11ImageGrabber.h new/ksnip-1.9.2/src/backend/imageGrabber/BaseX11ImageGrabber.h --- old/ksnip-1.9.1/src/backend/imageGrabber/BaseX11ImageGrabber.h 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/backend/imageGrabber/BaseX11ImageGrabber.h 2021-11-22 22:47:53.000000000 +0100 @@ -24,7 +24,7 @@ #include "AbstractRectAreaImageGrabber.h" #include "X11Wrapper.h" #include "src/common/platform/HdpiScaler.h" -#include "src/gui/snippingArea/LinuxSnippingArea.h" +#include "src/gui/snippingArea/X11SnippingArea.h" class BaseX11ImageGrabber : public AbstractRectAreaImageGrabber { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/backend/imageGrabber/GnomeWaylandImageGrabber.cpp new/ksnip-1.9.2/src/backend/imageGrabber/GnomeWaylandImageGrabber.cpp --- old/ksnip-1.9.1/src/backend/imageGrabber/GnomeWaylandImageGrabber.cpp 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/backend/imageGrabber/GnomeWaylandImageGrabber.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -19,7 +19,7 @@ #include "GnomeWaylandImageGrabber.h" -GnomeWaylandImageGrabber::GnomeWaylandImageGrabber() : AbstractRectAreaImageGrabber(new LinuxSnippingArea) +GnomeWaylandImageGrabber::GnomeWaylandImageGrabber() : AbstractRectAreaImageGrabber(new WaylandSnippingArea) { addSupportedCaptureMode(CaptureModes::RectArea); addSupportedCaptureMode(CaptureModes::LastRectArea); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/backend/imageGrabber/GnomeWaylandImageGrabber.h new/ksnip-1.9.2/src/backend/imageGrabber/GnomeWaylandImageGrabber.h --- old/ksnip-1.9.1/src/backend/imageGrabber/GnomeWaylandImageGrabber.h 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/backend/imageGrabber/GnomeWaylandImageGrabber.h 2021-11-22 22:47:53.000000000 +0100 @@ -26,7 +26,7 @@ #include "AbstractRectAreaImageGrabber.h" #include "src/common/helper/MathHelper.h" -#include "src/gui/snippingArea/LinuxSnippingArea.h" +#include "src/gui/snippingArea/WaylandSnippingArea.h" class GnomeWaylandImageGrabber : public AbstractRectAreaImageGrabber { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/backend/imageGrabber/ImageGrabberFactory.cpp new/ksnip-1.9.2/src/backend/imageGrabber/ImageGrabberFactory.cpp --- old/ksnip-1.9.1/src/backend/imageGrabber/ImageGrabberFactory.cpp 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/backend/imageGrabber/ImageGrabberFactory.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -34,7 +34,7 @@ } } else if (PlatformChecker::instance()->isWayland()) { auto config = KsnipConfigProvider::instance(); - if (config->forceGenericWaylandEnabled() || PlatformChecker::instance()->isSnap()) { + if (config->forceGenericWaylandEnabled() || PlatformChecker::instance()->isSnap() || PlatformChecker::instance()->gnomeVersion() >= 41) { return new WaylandImageGrabber(); } else if(PlatformChecker::instance()->isKde()) { return new KdeWaylandImageGrabber(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/backend/imageGrabber/KdeWaylandImageGrabber.h new/ksnip-1.9.2/src/backend/imageGrabber/KdeWaylandImageGrabber.h --- old/ksnip-1.9.1/src/backend/imageGrabber/KdeWaylandImageGrabber.h 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/backend/imageGrabber/KdeWaylandImageGrabber.h 2021-11-22 22:47:53.000000000 +0100 @@ -33,12 +33,12 @@ #include <errno.h> #include "AbstractImageGrabber.h" -#include "src/gui/snippingArea/LinuxSnippingArea.h" class KdeWaylandImageGrabber : public AbstractImageGrabber { public: explicit KdeWaylandImageGrabber(); + ~KdeWaylandImageGrabber() override = default; protected: void grab() override; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/backend/imageGrabber/WaylandImageGrabber.cpp new/ksnip-1.9.2/src/backend/imageGrabber/WaylandImageGrabber.cpp --- old/ksnip-1.9.1/src/backend/imageGrabber/WaylandImageGrabber.cpp 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/backend/imageGrabber/WaylandImageGrabber.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -20,8 +20,8 @@ #include "WaylandImageGrabber.h" WaylandImageGrabber::WaylandImageGrabber() : - AbstractImageGrabber(), - mRequestTokenCounter(1) + AbstractImageGrabber(), + mRequestTokenCounter(1) { addSupportedCaptureMode(CaptureModes::Portal); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/backend/imageGrabber/WaylandImageGrabber.h new/ksnip-1.9.2/src/backend/imageGrabber/WaylandImageGrabber.h --- old/ksnip-1.9.1/src/backend/imageGrabber/WaylandImageGrabber.h 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/backend/imageGrabber/WaylandImageGrabber.h 2021-11-22 22:47:53.000000000 +0100 @@ -25,7 +25,6 @@ #include <QtDBus/QDBusReply> #include "AbstractImageGrabber.h" -#include "src/gui/snippingArea/LinuxSnippingArea.h" #include "src/common/dtos/CaptureFromFileDto.h" #include "src/common/platform/HdpiScaler.h" @@ -34,6 +33,7 @@ Q_OBJECT public: explicit WaylandImageGrabber(); + ~WaylandImageGrabber() override = default; public slots: void gotScreenshotResponse(uint response, const QVariantMap& results); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/common/platform/CommandRunner.h new/ksnip-1.9.2/src/common/platform/CommandRunner.h --- old/ksnip-1.9.1/src/common/platform/CommandRunner.h 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/common/platform/CommandRunner.h 2021-11-22 22:47:53.000000000 +0100 @@ -28,9 +28,6 @@ public: QString getEnvironmentVariable(const QString &variable) const; bool isEnvironmentVariableSet(const QString &variable) const; - -private: - const int mMaxBuffer = 256; }; #endif // COMMANDRUNNER_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/common/platform/PlatformChecker.cpp new/ksnip-1.9.2/src/common/platform/PlatformChecker.cpp --- old/ksnip-1.9.1/src/common/platform/PlatformChecker.cpp 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/common/platform/PlatformChecker.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -50,6 +50,11 @@ return mPackageManager == PackageManager::Snap; } +int PlatformChecker::gnomeVersion() const +{ + return mGnomeVersion; +} + void PlatformChecker::checkPlatform() { CommandRunner runner; @@ -94,9 +99,27 @@ PlatformChecker::PlatformChecker() : mEnvironment(Environment::Unknown), mPlatform(Platform::Unknown), - mPackageManager(PackageManager::Unknown) + mPackageManager(PackageManager::Unknown), + mGnomeVersion(-1) { checkPlatform(); checkEnvironment(); checkCheckPackageManager(); + checkVersion(); +} + +void PlatformChecker::checkVersion() +{ + if(isGnome()) { + QFile gnomeVersionFile("/usr/share/gnome/gnome-version.xml"); + if (gnomeVersionFile.open(QFile::ReadOnly | QFile::Text)) { + QTextStream inputStream(&gnomeVersionFile); + QRegularExpression regex("<platform>(.+?)</platform>"); + bool isParseSuccessful; + auto value = regex.match(inputStream.readAll()).captured(1).toInt(&isParseSuccessful); + if(isParseSuccessful) { + mGnomeVersion = value; + } + } + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/common/platform/PlatformChecker.h new/ksnip-1.9.2/src/common/platform/PlatformChecker.h --- old/ksnip-1.9.1/src/common/platform/PlatformChecker.h 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/common/platform/PlatformChecker.h 2021-11-22 22:47:53.000000000 +0100 @@ -21,6 +21,9 @@ #define KSNIP_PLATFORMCHECKER_H #include <QString> +#include "QFile" +#include "QTextStream" +#include "QRegularExpression" #include "CommandRunner.h" #include "src/common/enum/Platform.h" @@ -37,16 +40,19 @@ bool isKde() const; bool isGnome() const; bool isSnap() const; + int gnomeVersion() const; private: Platform mPlatform; Environment mEnvironment; PackageManager mPackageManager; + int mGnomeVersion; void checkPlatform(); void checkEnvironment(); void checkCheckPackageManager(); bool outputContainsValue(const QString& output, const QString& value) const; + void checkVersion(); PlatformChecker(); }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/MainWindow.cpp new/ksnip-1.9.2/src/gui/MainWindow.cpp --- old/ksnip-1.9.1/src/gui/MainWindow.cpp 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/gui/MainWindow.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -526,7 +526,7 @@ mModifyCanvasAction->setText(tr("Modify Canvas")); connect(mModifyCanvasAction, &QAction::triggered, mImageAnnotator, &IImageAnnotator::showCanvasModifier); - mActionsMenu->setTitle("Actions"); + mActionsMenu->setTitle(tr("Actions")); mActionsMenu->setIcon(IconLoader::loadForTheme(QLatin1String("action"))); connect(mActionsMenu, &ActionsMenu::triggered, this, &MainWindow::actionTriggered); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/aboutDialog/ContactTab.cpp new/ksnip-1.9.2/src/gui/aboutDialog/ContactTab.cpp --- old/ksnip-1.9.1/src/gui/aboutDialog/ContactTab.cpp 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/gui/aboutDialog/ContactTab.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -26,8 +26,9 @@ mContent->setText( QLatin1String("<b>") + tr("Community") + QLatin1String("</b><br>") + tr("If you have general questions, ideas or just want to talk about ksnip,") + QLatin1String("<br/>") + - tr("please join our ") + QLatin1String("<a href=\"http://discord.ksnip.org\">Discord</a>") + - tr(" server.") + QLatin1String("<br/><br/>") + + tr("please join our") + QLatin1String(" <a href=\"http://discord.ksnip.org\">Discord</a> ") + + tr("or our") + QLatin1String(" <a href=\"https://web.libera.chat/?channels=#ksnip\">IRC</a> ") + + tr("server") + QLatin1String(".<br/><br/>") + QLatin1String("<b>") + tr("Bug Reports") + QLatin1String("</b><br>") + tr("Please use ") + QLatin1String("<a href=\"https://github.com/ksnip/ksnip/issues/\">GitHub</a>") + tr(" to report bugs.")); mContent->setTextFormat(Qt::RichText); @@ -35,6 +36,8 @@ mContent->setOpenExternalLinks(true); mLayout->addWidget(mContent); setLayout(mLayout); + + } ContactTab::~ContactTab() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/aboutDialog/DonateTab.cpp new/ksnip-1.9.2/src/gui/aboutDialog/DonateTab.cpp --- old/ksnip-1.9.1/src/gui/aboutDialog/DonateTab.cpp 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/gui/aboutDialog/DonateTab.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -27,8 +27,7 @@ tr("ksnip is a non-profitable copylefted libre software project, and<br/>" "still has some costs that need to be covered,<br/>" "like domain costs or hardware costs for cross-platform support.") + QLatin1String("<br/>") + - tr("If you want to help or just<br/>" - "want to appreciate the work being done<br/>" + tr("If you want to help or just want to appreciate the work being done<br/>" "by treating developers to a beer or coffee, you can do that") + QLatin1String(" <a href=\"https://www.paypal.me/damirporobic\">") + tr("here") + QLatin1String("</a>.<br/><br/>") + tr("Donations are always welcome") + QLatin1String(" :)") + QLatin1String("<br/><br/>") + QLatin1String("<b>") + tr("Become a GitHub Sponsor") + QLatin1String("?</b>") + QLatin1String("<br/>") + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/settingsDialog/ImageGrabberSettings.cpp new/ksnip-1.9.2/src/gui/settingsDialog/ImageGrabberSettings.cpp --- old/ksnip-1.9.1/src/gui/settingsDialog/ImageGrabberSettings.cpp 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/gui/settingsDialog/ImageGrabberSettings.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -63,14 +63,14 @@ mShowMainWindowAfterTakingScreenshotCheckbox->setToolTip(tr("Show Main Window after capturing a new screenshot\n" "when the Main Window was hidden or minimize.")); - mForceGenericWaylandCheckbox->setText(tr("Force Generic Wayland Screenshot")); + mForceGenericWaylandCheckbox->setText(tr("Force Generic Wayland (xdg-desktop-portal) Screenshot")); mForceGenericWaylandCheckbox->setToolTip(tr("GNOME and KDE Plasma support their own Wayland\n" "and the Generic XDG-DESKTOP-PORTAL screenshots.\n" "Enabling this option will force KDE Plasma and\n" "GNOME to use the XDG-DESKTOP-PORTAL screenshots.\n" "Change in this option require a ksnip restart.")); - mScaleGenericWaylandScreenshotsCheckbox->setText(tr("Scale Generic Wayland Screenshots")); + mScaleGenericWaylandScreenshotsCheckbox->setText(tr("Scale Generic Wayland (xdg-desktop-portal) Screenshots")); mScaleGenericWaylandScreenshotsCheckbox->setToolTip(tr("Generic Wayland implementations that use\n" "XDG-DESKTOP-PORTAL handle screen scaling\n" "differently. Enabling this option will\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/snippingArea/AbstractSnippingArea.cpp new/ksnip-1.9.2/src/gui/snippingArea/AbstractSnippingArea.cpp --- old/ksnip-1.9.1/src/gui/snippingArea/AbstractSnippingArea.cpp 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/gui/snippingArea/AbstractSnippingArea.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -71,14 +71,12 @@ startTimeout(); mIsSwitchPressed = false; setFullScreen(); - QApplication::setActiveWindow(this); - mSelector->activate(getSnippingAreaGeometry(), QCursor::pos()); + mSelector->activate(getSnippingAreaGeometry(), getLocalCursorPosition()); mUnselectedRegionAlpha = mConfig->snippingAreaTransparency(); if(mConfig->showSnippingAreaInfoText()) { mSelectorInfoText->activate(getSnippingAreaGeometry(), mConfig->allowResizingRectSelection()); } - setFocus(); - grabKeyboard(); // Issue #57 + grabKeyboardFocus(); } void AbstractSnippingArea::setBackgroundImage(const QPixmap &background) @@ -194,10 +192,15 @@ return mBackground == nullptr; } +QPoint AbstractSnippingArea::getLocalCursorPosition() const +{ + return QCursor::pos(); +} + void AbstractSnippingArea::keyPressEvent(QKeyEvent *event) { if (event->key() == Qt::Key_Escape) { - cancelSelection(); + cancelSelection(); } else if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) { finishSelection(); } else if (event->key() == Qt::Key_Control){ @@ -242,6 +245,14 @@ emit finished(); } +void AbstractSnippingArea::grabKeyboardFocus() +{ + QApplication::setActiveWindow(this); + activateWindow(); + setFocus(); + grabKeyboard(); +} + void AbstractSnippingArea::updateCursor(const QCursor &cursor) { setCursor(cursor); @@ -255,4 +266,4 @@ void AbstractSnippingArea::startTimeout() { mTimer->start(60000); -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/snippingArea/AbstractSnippingArea.h new/ksnip-1.9.2/src/gui/snippingArea/AbstractSnippingArea.h --- old/ksnip-1.9.1/src/gui/snippingArea/AbstractSnippingArea.h 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/gui/snippingArea/AbstractSnippingArea.h 2021-11-22 22:47:53.000000000 +0100 @@ -63,6 +63,8 @@ virtual bool isBackgroundTransparent() const; virtual void setFullScreen() = 0; virtual QRect getSnippingAreaGeometry() const = 0; + virtual QPoint getLocalCursorPosition() const; + virtual void grabKeyboardFocus(); private: KsnipConfig *mConfig; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/snippingArea/LinuxSnippingArea.cpp new/ksnip-1.9.2/src/gui/snippingArea/LinuxSnippingArea.cpp --- old/ksnip-1.9.1/src/gui/snippingArea/LinuxSnippingArea.cpp 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/gui/snippingArea/LinuxSnippingArea.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2018 Damir Porobic <https://github.com/damirporobic> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "LinuxSnippingArea.h" - -LinuxSnippingArea::LinuxSnippingArea() : AbstractSnippingArea() -{ - setWindowFlags(windowFlags() | Qt::Tool | Qt::X11BypassWindowManagerHint); -} - -QRect LinuxSnippingArea::selectedRectArea() const -{ - if(isBackgroundTransparent()) { - return mCaptureArea; - } else { - return mHdpiScaler.scale(mCaptureArea); - } -} - -void LinuxSnippingArea::setFullScreen() -{ - setFixedSize(QDesktopWidget().size()); - QWidget::showFullScreen(); -} - -QRect LinuxSnippingArea::getSnippingAreaGeometry() const -{ - return geometry(); -} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/snippingArea/LinuxSnippingArea.h new/ksnip-1.9.2/src/gui/snippingArea/LinuxSnippingArea.h --- old/ksnip-1.9.1/src/gui/snippingArea/LinuxSnippingArea.h 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/gui/snippingArea/LinuxSnippingArea.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2018 Damir Porobic <https://github.com/damirporobic> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef KSNIP_LINUXSNIPPINGAREA_H -#define KSNIP_LINUXSNIPPINGAREA_H - -#include "AbstractSnippingArea.h" -#include "src/common/platform/HdpiScaler.h" - -class LinuxSnippingArea : public AbstractSnippingArea -{ -public: - explicit LinuxSnippingArea(); - ~LinuxSnippingArea() override = default; - QRect selectedRectArea() const override; - -protected: - void setFullScreen() override; - QRect getSnippingAreaGeometry() const override; - -private: - HdpiScaler mHdpiScaler; -}; - -#endif //KSNIP_LINUXSNIPPINGAREA_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/snippingArea/SnippingAreaAdorner.cpp new/ksnip-1.9.2/src/gui/snippingArea/SnippingAreaAdorner.cpp --- old/ksnip-1.9.1/src/gui/snippingArea/SnippingAreaAdorner.cpp 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/gui/snippingArea/SnippingAreaAdorner.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -19,10 +19,12 @@ #include "SnippingAreaAdorner.h" -SnippingAreaAdorner::SnippingAreaAdorner() +SnippingAreaAdorner::SnippingAreaAdorner() : + mMouseIsDown(false), + mRulerEnabled(false), + mPositionAndSizeInfoEnabled(false), + mMagnifyingGlassEnabled(false) { - setRulersEnabled(false); - setPositionAndSizeInfoEnabled(false); } void SnippingAreaAdorner::setRulersEnabled(bool enabled) @@ -72,7 +74,7 @@ void SnippingAreaAdorner::paint(QPainter *painter, const QColor &adornerColor, const QColor &cursorColor) { if (mRulerEnabled && !mMouseIsDown) { - mRulers.paint(painter, adornerColor); + mRulers.paint(painter, adornerColor); } if (mPositionAndSizeInfoEnabled) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/snippingArea/WaylandSnippingArea.cpp new/ksnip-1.9.2/src/gui/snippingArea/WaylandSnippingArea.cpp --- old/ksnip-1.9.1/src/gui/snippingArea/WaylandSnippingArea.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/ksnip-1.9.2/src/gui/snippingArea/WaylandSnippingArea.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2021 Damir Porobic <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "WaylandSnippingArea.h" + +WaylandSnippingArea::WaylandSnippingArea() : X11SnippingArea() +{ + +} + +QRect WaylandSnippingArea::selectedRectArea() const +{ + return mHdpiScaler.scale(mCaptureArea); +} + +void WaylandSnippingArea::grabKeyboardFocus() +{ + QApplication::setActiveWindow(this); + setFocus(); + grabKeyboard(); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/snippingArea/WaylandSnippingArea.h new/ksnip-1.9.2/src/gui/snippingArea/WaylandSnippingArea.h --- old/ksnip-1.9.1/src/gui/snippingArea/WaylandSnippingArea.h 1970-01-01 01:00:00.000000000 +0100 +++ new/ksnip-1.9.2/src/gui/snippingArea/WaylandSnippingArea.h 2021-11-22 22:47:53.000000000 +0100 @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 Damir Porobic <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef KSNIP_WAYLANDSNIPPINGAREA_H +#define KSNIP_WAYLANDSNIPPINGAREA_H + +#include "X11SnippingArea.h" + +class WaylandSnippingArea : public X11SnippingArea +{ +public: + explicit WaylandSnippingArea(); + ~WaylandSnippingArea() override = default; + QRect selectedRectArea() const override; + +protected: + void grabKeyboardFocus() override; + +private: + HdpiScaler mHdpiScaler; +}; + +#endif //KSNIP_WAYLANDSNIPPINGAREA_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/snippingArea/WinSnippingArea.cpp new/ksnip-1.9.2/src/gui/snippingArea/WinSnippingArea.cpp --- old/ksnip-1.9.1/src/gui/snippingArea/WinSnippingArea.cpp 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/gui/snippingArea/WinSnippingArea.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -26,7 +26,10 @@ { setWindowFlags(windowFlags() | Qt::Tool); - checkMultipleScaledScreens(); + connect(qGuiApp, &QGuiApplication::screenRemoved, this, &WinSnippingArea::init); + connect(qGuiApp, &QGuiApplication::screenAdded, this, &WinSnippingArea::init); + + init(); } QRect WinSnippingArea::selectedRectArea() const @@ -35,6 +38,10 @@ auto topLeft = mapToGlobal(mCaptureArea.topLeft()); auto bottomRight = mapToGlobal(mCaptureArea.bottomRight()); return {topLeft, bottomRight}; + } else if (mIsMultipleScaledScreens) { + auto xWithOffset = mCaptureArea.x() - mScaleOffset.x(); + auto yWithOffset = mCaptureArea.y() - mScaleOffset.y(); + return mHdpiScaler.scale({xWithOffset, yWithOffset, mCaptureArea.width(), mCaptureArea.height()}); } else { return mHdpiScaler.scale(mCaptureArea); } @@ -42,20 +49,23 @@ void WinSnippingArea::setFullScreen() { - // Workaround for Qt HiDPI issue, setting geometry more then once - // enlarges the widget outside the size of the visible desktop. See #668. - // Qt behaves differently in case of one or multiple scaled screens so - // we utilise here different 'hacks' to fix the different use cases. - // This part just be checked after upgrading to newer Qt version if it - // can be simplified again in case the issue was fixed from Qt side. - if(mIsMultipleScaledScreens) { + /* + * Workaround for Qt HiDPI issue, setting geometry more then once + * enlarges the widget outside the size of the visible desktop. See #668. + * Qt behaves differently in case of one or multiple scaled screens so + * we utilise here different 'hacks' to fix the different use cases. + * This part just be checked after upgrading to newer Qt version if it + * can be simplified again in case the issue was fixed from Qt side. + * See bug https://bugreports.qt.io/browse/QTBUG-94638 + */ + + if (mIsMultipleScaledScreens) { setGeometry(QApplication::desktop()->geometry()); QWidget::show(); setGeometry(QApplication::desktop()->geometry()); - } else if(!mIsFullScreenSizeSet) { - auto rect = mWinWrapper.getFullScreenRect(); - setGeometry(rect); - mIsFullScreenSizeSet = true; + } else if (!mIsFullScreenSizeSet) { + setGeometry(mFullScreenRect); + mIsFullScreenSizeSet = true; } QWidget::show(); @@ -64,22 +74,47 @@ QRect WinSnippingArea::getSnippingAreaGeometry() const { if(mIsMultipleScaledScreens) { - auto rect = mWinWrapper.getFullScreenRect(); - return {0, 0, rect.width() / 2, rect.height() / 2 }; + return {mScaleOffset.x(), mScaleOffset.y(), mFullScreenRect.width() / 2, mFullScreenRect.height() / 2 }; } else { return {0, 0, geometry().width(), geometry().height() }; } } -void WinSnippingArea::checkMultipleScaledScreens() { +QPoint WinSnippingArea::getLocalCursorPosition() const +{ + return mapFromGlobal(QCursor::pos()); +} + +void WinSnippingArea::setupScalingVariables() +{ auto scaledScreens = 0; auto screens = QApplication::screens(); for(auto screen : screens) { + auto screenGeometry = screen->geometry(); + if(screen->devicePixelRatio() > 1) { - scaledScreens++; } + + if (screenGeometry.x() != 0) { + mScaleOffset.setX(screenGeometry.x()); + } + + if (screenGeometry.y() != 0) { + mScaleOffset.setY(screenGeometry.y()); + } } + mScaleOffset.setX((mScaleOffset.x() - mFullScreenRect.x()) / mHdpiScaler.scaleFactor()); + mScaleOffset.setY((mScaleOffset.y() - mFullScreenRect.y()) / mHdpiScaler.scaleFactor()); + mIsMultipleScaledScreens = scaledScreens > 1; } + +void WinSnippingArea::init() +{ + mIsFullScreenSizeSet = false; + + mFullScreenRect = mWinWrapper.getFullScreenRect(); + setupScalingVariables(); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/snippingArea/WinSnippingArea.h new/ksnip-1.9.2/src/gui/snippingArea/WinSnippingArea.h --- old/ksnip-1.9.1/src/gui/snippingArea/WinSnippingArea.h 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/gui/snippingArea/WinSnippingArea.h 2021-11-22 22:47:53.000000000 +0100 @@ -34,14 +34,20 @@ protected: void setFullScreen() override; QRect getSnippingAreaGeometry() const override; + QPoint getLocalCursorPosition() const override; private: + QPoint mScaleOffset; + QRect mFullScreenRect; HdpiScaler mHdpiScaler; WinWrapper mWinWrapper; bool mIsFullScreenSizeSet; bool mIsMultipleScaledScreens; - void checkMultipleScaledScreens(); + void setupScalingVariables(); + +private slots: + void init(); }; #endif //KSNIP_WINSNIPPINGAREA_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/snippingArea/X11SnippingArea.cpp new/ksnip-1.9.2/src/gui/snippingArea/X11SnippingArea.cpp --- old/ksnip-1.9.1/src/gui/snippingArea/X11SnippingArea.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/ksnip-1.9.2/src/gui/snippingArea/X11SnippingArea.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2018 Damir Porobic <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "X11SnippingArea.h" + +X11SnippingArea::X11SnippingArea() : AbstractSnippingArea() +{ + setWindowFlags(windowFlags() | Qt::Tool | Qt::X11BypassWindowManagerHint); + + calculateDesktopGeometry(); +} + +QRect X11SnippingArea::selectedRectArea() const +{ + if(isBackgroundTransparent()) { + return mCaptureArea; + } else { + return mHdpiScaler.scale(mCaptureArea); + } +} + +void X11SnippingArea::setFullScreen() +{ + setFixedSize(QDesktopWidget().size()); + QWidget::showFullScreen(); +} + +QRect X11SnippingArea::getSnippingAreaGeometry() const +{ + return mDesktopGeometry; +} + +void X11SnippingArea::calculateDesktopGeometry() +{ + auto screens = QApplication::screens(); + for(auto screen : screens) { + auto scaleFactor = screen->devicePixelRatio(); + auto screenGeometry = screen->geometry(); + int x = screenGeometry.x() / scaleFactor; + int y = screenGeometry.y() / scaleFactor; + auto width = screenGeometry.width(); + auto height = screenGeometry.height(); + + mDesktopGeometry = mDesktopGeometry.united({x, y, width, height}); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/snippingArea/X11SnippingArea.h new/ksnip-1.9.2/src/gui/snippingArea/X11SnippingArea.h --- old/ksnip-1.9.1/src/gui/snippingArea/X11SnippingArea.h 1970-01-01 01:00:00.000000000 +0100 +++ new/ksnip-1.9.2/src/gui/snippingArea/X11SnippingArea.h 2021-11-22 22:47:53.000000000 +0100 @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2018 Damir Porobic <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef KSNIP_X11SNIPPINGAREA_H +#define KSNIP_X11SNIPPINGAREA_H + +#include "AbstractSnippingArea.h" +#include "src/common/platform/HdpiScaler.h" + +class X11SnippingArea : public AbstractSnippingArea +{ +public: + explicit X11SnippingArea(); + ~X11SnippingArea() override = default; + QRect selectedRectArea() const override; + +protected: + void setFullScreen() override; + QRect getSnippingAreaGeometry() const override; + +private: + QRect mDesktopGeometry; + HdpiScaler mHdpiScaler; + void calculateDesktopGeometry(); +}; + +#endif //KSNIP_X11SNIPPINGAREA_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/widgetVisibilityHandler/GnomeWaylandWidgetVisibilityHandler.cpp new/ksnip-1.9.2/src/gui/widgetVisibilityHandler/GnomeWaylandWidgetVisibilityHandler.cpp --- old/ksnip-1.9.1/src/gui/widgetVisibilityHandler/GnomeWaylandWidgetVisibilityHandler.cpp 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/gui/widgetVisibilityHandler/GnomeWaylandWidgetVisibilityHandler.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -29,3 +29,10 @@ { mWidget->setVisible(isVisible); } + +void GnomeWaylandWidgetVisibilityHandler::showWidget() +{ + mWidget->setWindowState(getSelectedWindowState()); + mWidget->raise(); + mWidget->show(); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/widgetVisibilityHandler/GnomeWaylandWidgetVisibilityHandler.h new/ksnip-1.9.2/src/gui/widgetVisibilityHandler/GnomeWaylandWidgetVisibilityHandler.h --- old/ksnip-1.9.1/src/gui/widgetVisibilityHandler/GnomeWaylandWidgetVisibilityHandler.h 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/gui/widgetVisibilityHandler/GnomeWaylandWidgetVisibilityHandler.h 2021-11-22 22:47:53.000000000 +0100 @@ -28,6 +28,7 @@ explicit GnomeWaylandWidgetVisibilityHandler(QWidget *widget); ~GnomeWaylandWidgetVisibilityHandler() = default; void setVisible(bool isVisible) override; + void showWidget() override; }; #endif //KSNIP_GNOMEWAYLANDWIDGETVISIBILITYHANDLER_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/widgetVisibilityHandler/WidgetVisibilityHandler.cpp new/ksnip-1.9.2/src/gui/widgetVisibilityHandler/WidgetVisibilityHandler.cpp --- old/ksnip-1.9.1/src/gui/widgetVisibilityHandler/WidgetVisibilityHandler.cpp 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/gui/widgetVisibilityHandler/WidgetVisibilityHandler.cpp 2021-11-22 22:47:53.000000000 +0100 @@ -111,8 +111,13 @@ void WidgetVisibilityHandler::showWidget() { - mWidget->setWindowState(mSelectedWindowState); + mWidget->setWindowState(getSelectedWindowState()); mWidget->activateWindow(); mWidget->raise(); mWidget->show(); } + +Qt::WindowState WidgetVisibilityHandler::getSelectedWindowState() const +{ + return mSelectedWindowState; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ksnip-1.9.1/src/gui/widgetVisibilityHandler/WidgetVisibilityHandler.h new/ksnip-1.9.2/src/gui/widgetVisibilityHandler/WidgetVisibilityHandler.h --- old/ksnip-1.9.1/src/gui/widgetVisibilityHandler/WidgetVisibilityHandler.h 2021-09-13 19:03:08.000000000 +0200 +++ new/ksnip-1.9.2/src/gui/widgetVisibilityHandler/WidgetVisibilityHandler.h 2021-11-22 22:47:53.000000000 +0100 @@ -42,14 +42,14 @@ QWidget *mWidget; virtual void setVisible(bool isVisible); + virtual void showWidget(); + Qt::WindowState getSelectedWindowState() const; private: bool mWindowStateChangeLock; bool mIsMinimized; bool mIsHidden; Qt::WindowState mSelectedWindowState; - - void showWidget(); }; #endif //KSNIP_WIDGETVISIBILITYHANDLER_H
