Skip to content

Commit

Permalink
Made XShape clipping detection more stringent
Browse files Browse the repository at this point in the history
  • Loading branch information
naelstrof committed Aug 16, 2017
1 parent 714f725 commit ee3ebc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ else()
set( MANTARGET "maim.1" )
endif()

add_definitions(-DMAIM_VERSION="v5.4.67")
add_definitions(-DMAIM_VERSION="v5.4.68")

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/")

Expand Down
12 changes: 7 additions & 5 deletions src/x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,12 @@ XImage* X11::getImageUsingXRender( Window draw, int localx, int localy, int w, i
XRenderPictureAttributes pa;
pa.subwindow_mode = IncludeInferiors;
Picture picture = XRenderCreatePicture( display, draw, format, CPSubwindowMode, &pa );
XserverRegion region = findRegion( draw );
// Also we use XRender because of this neato function here.
XFixesSetPictureClipRegion( display, picture, 0, 0, region );
XFixesDestroyRegion( display, region );
if ( draw != root ) {
XserverRegion region = findRegion( draw );
// Also we use XRender because of this neato function here.
XFixesSetPictureClipRegion( display, picture, 0, 0, region );
XFixesDestroyRegion( display, region );
}

Pixmap pixmap = XCreatePixmap(display, root, w, h, 32);
XRenderPictureAttributes pa2;
Expand Down Expand Up @@ -216,7 +218,7 @@ bool X11::hasClipping( Window d ) {
int bShaped, xbs, ybs, cShaped, xcs, ycs;
unsigned int wbs, hbs, wcs, hcs;
XShapeQueryExtents ( display, d, &bShaped, &xbs, &ybs, &wbs, &hbs, &cShaped, &xcs, &ycs, &wcs, &hcs );
return bShaped || cShaped;
return bShaped;
}

XserverRegion X11::findRegion( Window d ) {
Expand Down

0 comments on commit ee3ebc3

Please sign in to comment.