Hello community, here is the log from the commit of package maim for openSUSE:Factory checked in at 2019-12-21 12:34:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/maim (Old) and /work/SRC/openSUSE:Factory/.maim.new.6675 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "maim" Sat Dec 21 12:34:39 2019 rev:4 rq:758654 version:5.5.3 Changes: -------- --- /work/SRC/openSUSE:Factory/maim/maim.changes 2018-11-09 07:55:18.735649830 +0100 +++ /work/SRC/openSUSE:Factory/.maim.new.6675/maim.changes 2019-12-21 12:34:58.571465805 +0100 @@ -1,0 +2,7 @@ +Fri Dec 20 00:04:48 UTC 2019 - Jan Engelhardt <jeng...@inai.de> + +- Update to release 5.5.3 + * Avoid printing image output to a TTY + * Add flag to capture background for transparent windows + +------------------------------------------------------------------- Old: ---- maim-5.5.2.tar.gz New: ---- maim-5.5.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ maim.spec ++++++ --- /var/tmp/diff_new_pack.VcBSxC/_old 2019-12-21 12:34:59.243466125 +0100 +++ /var/tmp/diff_new_pack.VcBSxC/_new 2019-12-21 12:34:59.243466125 +0100 @@ -1,7 +1,7 @@ # # spec file for package maim # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ # See also http://en.opensuse.org/openSUSE:Specfile_guidelines Name: maim -Version: 5.5.2 +Version: 5.5.3 Release: 0 Summary: Flexible screenshotting utility License: GPL-3.0-or-later ++++++ maim-5.5.2.tar.gz -> maim-5.5.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maim-5.5.2/.gitignore new/maim-5.5.3/.gitignore --- old/maim-5.5.2/.gitignore 2018-06-13 03:32:35.000000000 +0200 +++ new/maim-5.5.3/.gitignore 2019-04-22 20:20:31.000000000 +0200 @@ -1,2 +1,11 @@ # These files are ignored since cmake generates them from cmdline.in src/cmdline.h + +# Ignore Cmake generated files +CMakeFiles/* +Makefile +cmake_install.cmake +CMakeCache.txt + +# Ignore output artifacts +bin/maim diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maim-5.5.2/CMakeLists.txt new/maim-5.5.3/CMakeLists.txt --- old/maim-5.5.2/CMakeLists.txt 2018-06-13 03:32:35.000000000 +0200 +++ new/maim-5.5.3/CMakeLists.txt 2019-04-22 20:20:31.000000000 +0200 @@ -1,6 +1,6 @@ cmake_minimum_required( VERSION 3.1.3 ) -project(maim VERSION 5.5 LANGUAGES CXX) +project(maim VERSION 5.5.3 LANGUAGES CXX) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Debug") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maim-5.5.2/README.md new/maim-5.5.3/README.md --- old/maim-5.5.2/README.md 2018-06-13 03:32:35.000000000 +0200 +++ new/maim-5.5.3/README.md 2019-04-22 20:20:31.000000000 +0200 @@ -25,14 +25,17 @@ * [Debian: maim](https://tracker.debian.org/pkg/maim) * [Void Linux: maim](https://github.com/voidlinux/void-packages/blob/24ac22af44018e2598047e5ef7fd3522efa79db5/srcpkgs/maim/template) * [FreeBSD: graphics/maim](http://www.freshports.org/graphics/maim/) +* [NetBSD: x11/maim](http://pkgsrc.se/x11/maim) * [OpenBSD: graphics/maim](http://openports.se/graphics/maim) * [CRUX: 6c37/maim](https://github.com/6c37/crux-ports/tree/3.3/maim) * [Gentoo: media-gfx/maim](https://packages.gentoo.org/packages/media-gfx/maim) * [NixOS: maim](https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/graphics/maim/default.nix) * [GNU Guix: maim](https://www.gnu.org/software/guix/packages/#maim) +* [Ravenports: maim](http://www.ravenports.com/catalog/bucket_B4/maim/standard/) +* [Fedora: maim-copr](https://copr.fedorainfracloud.org/coprs/shymega/maim-copr/) * Please make a package for maim on your favorite system, and make a pull request to add it to this list. -### Install using CMake (Requires CMake, git, libXrander, libXfixes, libGLM) +### Install using CMake (Requires CMake, git, libXrender, libXfixes, libGLM, libxcomposite, libxrandr) ```bash git clone https://github.com/naelstrof/slop.git cd slop diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maim-5.5.2/maim.1 new/maim-5.5.3/maim.1 --- old/maim-5.5.2/maim.1 2018-06-13 03:32:35.000000000 +0200 +++ new/maim-5.5.3/maim.1 2019-04-22 20:20:31.000000000 +0200 @@ -25,11 +25,14 @@ Sets the desired window to capture, defaults to the root window. Allows for an integer, hex, or `root` for input. .TP .BR \-g ", " \-\-geometry=\fIGEOMETRY\fR -Sets the region to capture, uses local coordinates from the given window. So -g10x30-5+0 would represent the rectangle wxh+x+y where w=10, h=30, x=-5, and y=0. x and y are the upper left location of this rectangle. +Sets the region to capture, uses local coordinates from the given window. So -g 10x30-5+0 would represent the rectangle wxh+x+y where w=10, h=30, x=-5, and y=0. x and y are the upper left location of this rectangle. .TP .BR \-w ", " \-\-parent=\fIWINDOW\fR By default, maim assumes the --geometry values are in respect to the provided --window (or root if not provided). This parameter overrides this behavior by making the geometry be in respect to whatever window you provide to --parent. Allows for an integer, hex, or `root` for input. .TP +.BR \-B ", " \-\-capturebackground +By default, when capturing a window, maim will ignore anything beneath the specified window. This parameter overrides this and also captures elements underneath the window. +.TP .BR \-d ", " \-\-delay=\fIFLOAT\fR Sets the time in seconds to wait before taking a screenshot. Prints a simple message to show how many seconds are left before a screenshot is taken. See \-\-quiet for muting this message. .TP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maim-5.5.2/modules/FindSLOP.cmake new/maim-5.5.3/modules/FindSLOP.cmake --- old/maim-5.5.2/modules/FindSLOP.cmake 2018-06-13 03:32:35.000000000 +0200 +++ new/maim-5.5.3/modules/FindSLOP.cmake 2019-04-22 20:20:31.000000000 +0200 @@ -8,7 +8,7 @@ # -find_path( SLOP_INCLUDE_DIRS +find_path( SLOP_INCLUDE_DIR NAMES slop.hpp PATH_SUFFIXES /usr/include /include DOC "The SLOP include directory" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maim-5.5.2/src/image.cpp new/maim-5.5.3/src/image.cpp --- old/maim-5.5.2/src/image.cpp 2018-06-13 03:32:35.000000000 +0200 +++ new/maim-5.5.3/src/image.cpp 2019-04-22 20:20:31.000000000 +0200 @@ -187,8 +187,8 @@ jpeg_set_defaults(&cinfo); // Convert quality from scale 1-10 to 0-100 - jpeg_set_quality (&cinfo, (int)((float)quality-1.f)*(100.f/9.f), true); - jpeg_start_compress(&cinfo, true); + jpeg_set_quality (&cinfo, (int)((float)quality-1.f)*(100.f/9.f), TRUE); + jpeg_start_compress(&cinfo, TRUE); JSAMPROW row_pointer; unsigned char* buffer = (unsigned char*)data; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maim-5.5.2/src/main.cpp new/maim-5.5.3/src/main.cpp --- old/maim-5.5.2/src/main.cpp 2018-06-13 03:32:35.000000000 +0200 +++ new/maim-5.5.3/src/main.cpp 2019-04-22 20:20:31.000000000 +0200 @@ -1,3 +1,5 @@ +#include <cstdio> +#include <unistd.h> #include <iostream> #include <slop.hpp> #include <glm/glm.hpp> @@ -30,6 +32,7 @@ bool version; bool help; bool savepathGiven; + bool captureBackground; }; MaimOptions::MaimOptions() { @@ -47,6 +50,7 @@ savepathGiven = false; windowGiven = false; formatGiven = false; + captureBackground = false; } Window parseWindow( std::string win, X11* x11 ) { @@ -191,6 +195,9 @@ throw new std::invalid_argument("Quality argument must be between 1 and 10"); } } + if ( options.count( "capturebackground" ) > 0 ) { + foo->captureBackground = options["capturebackground"].as<bool>(); + } auto& positional = options["positional"].as<std::vector<std::string>>(); foo->savepathGiven = positional.size() > 0; //std::cerr << positional[0] << "\n"; @@ -318,6 +325,11 @@ whatever window you provide to --parent. Allows for an integer, hex, or `root` for input. + -B, --capturebackground + By default, when capturing a window, maim will ignore anything + beneath the specified window. This parameter overrides this and + also captures elements underneath the window. + SLOP OPTIONS -b, --bordersize=FLOAT Sets the selection rectangle's thickness. @@ -393,6 +405,7 @@ ("i,window", "Sets the desired window to capture, defaults to the root window. Allows for an integer, hex, or `root` for input.", cxxopts::value<std::string>()) ("g,geometry", "Sets the region to capture, uses local coordinates from the given window. So -g10x30-5+0 would represent the rectangle wxh+x+y where w=10, h=30, x=-5, and y=0. x and y are the upper left location of this rectangle.", cxxopts::value<std::string>()) ("w,parent", "By default, maim assumes the --geometry values are in respect to the provided --window (or root if not provided). This parameter overrides this behavior by making the geometry be in respect to whatever window you provide to --parent. Allows for an integer, hex, or `root` for input.", cxxopts::value<std::string>()) + ("B,capturebackground", "By default, when capturing a window, maim will ignore anything beneath the specified window. This parameter overrides this and also captures elements underneath the window.") ("d,delay", "Sets the time in seconds to wait before taking a screenshot. Prints a simple message to show how many seconds are left before a screenshot is taken. See --quiet for muting this message.", cxxopts::value<float>()->implicit_value("5")) ("u,hidecursor", "By default maim super-imposes the cursor onto the image, you can disable that behavior with this flag.") ("m,quality", "An integer from 1 to 10 that determines the compression quality. 1 is the highest (and lossiest) compression available for the provided format. For example a setting of `1` with png (a loss‐ less format) would increase filesize and decrease decoding time. While a setting of `1` on a jpeg would create a pixel mush.", cxxopts::value<int>()) @@ -430,6 +443,12 @@ MaimOptions* maimOptions = getMaimOptions( options, x11 ); slop::SlopSelection selection(0,0,0,0,0,true); + // Check if output is a tty before dumping binary data to it + if ( isatty( fileno( stdout ) ) && !maimOptions->savepathGiven ) { + std::cout << HELP_MESSAGE << std::endl; + return 0; + } + if ( maimOptions->select ) { if ( maimOptions->windowGiven || maimOptions->parentGiven || maimOptions->geometryGiven ) { throw new std::invalid_argument( "Interactive mode (--select) doesn't support the following parameters: --window, --parent, --geometry." ); @@ -485,6 +504,11 @@ selection.h = maimOptions->geometry.w; selection.id = maimOptions->window; } + + if ( maimOptions->captureBackground ) { + selection.id = x11->root; + } + std::ostream* out; if ( maimOptions->savepathGiven ) { std::ofstream* file = new std::ofstream(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/maim-5.5.2/src/x.cpp new/maim-5.5.3/src/x.cpp --- old/maim-5.5.2/src/x.cpp 2018-06-13 03:32:35.000000000 +0200 +++ new/maim-5.5.3/src/x.cpp 2019-04-22 20:20:31.000000000 +0200 @@ -22,7 +22,7 @@ int format_return; bool window_frame = false; Window actualWindow = win; - if ( num_children > 0 && XGetWindowProperty( x11->display, children[num_children-1], + if ( win != x11->root && num_children > 0 && XGetWindowProperty( x11->display, children[num_children-1], XInternAtom( x11->display, "_NET_FRAME_EXTENTS", False), 0, LONG_MAX, False, XA_CARDINAL, &type_return, &format_return, &nitems_return, &bytes_after_return,