Skip to content

Commit

Permalink
Fixed bug that caused window-only screenshots to have an incorrect X …
Browse files Browse the repository at this point in the history
…and Y positioning.
  • Loading branch information
naelstrof committed Nov 28, 2014
1 parent 8706bc4 commit b2aaaff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required( VERSION 2.8 )
project( "maim" )
set( maim_VERSION_MAJOR 2 )
set( maim_VERSION_MINOR 3 )
set( maim_VERSION_PATCH 37 )
set( maim_VERSION_PATCH 38 )

set( BIN_TARGET "${PROJECT_NAME}" )
set( CMAKE_INSTALL_PREFIX "/usr/bin" )
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -84,7 +84,7 @@ help
----
Join us on irc at freenode in *#maim*.
```text
maim v2.3.37
maim v2.3.38
Copyright (C) 2014 Dalton Nell, Maim Contributors
(https://github.com/naelstrof/maim/graphs/contributors)
Expand Down
4 changes: 3 additions & 1 deletion src/im.cpp
Expand Up @@ -72,7 +72,9 @@ int maim::IMEngine::screenshot( Window id ) {
// prevents blending issues in the future.
imlib_image_set_has_alpha( 1 );
imlib_context_set_drawable( id );
imlib_copy_drawable_to_image( 0, x, y, w, h, 0, 0, 0 );
int destinationx = x < 0 ? -x : 0;
int destinationy = y < 0 ? -y : 0;
imlib_copy_drawable_to_image( 0, destinationx, destinationy, w, h, 0, 0, 0 );
// Screenshot image is now in the imlib context!
return EXIT_SUCCESS;
}
Expand Down

0 comments on commit b2aaaff

Please sign in to comment.