mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-14 03:23:29 +00:00
Merge pull request #64 from dnk/xshape
add support for x11 shape extension
This commit is contained in:
commit
a2b5c3f3cf
@ -108,12 +108,14 @@ if(BUILD_X11)
|
||||
option(BUILD_XDBE "Build Xdbe (double-buffer) support" false)
|
||||
option(BUILD_XFT "Build Xft (freetype fonts) support" true)
|
||||
option(BUILD_IMLIB2 "Enable Imlib2 support" false)
|
||||
option(BUILD_XSHAPE "Enable Xshape support" false)
|
||||
else(BUILD_X11)
|
||||
set(OWN_WINDOW false CACHE BOOL "Enable own_window support" FORCE)
|
||||
set(BUILD_XDAMAGE false CACHE BOOL "Build Xdamage support" FORCE)
|
||||
set(BUILD_XDBE false CACHE BOOL "Build Xdbe (double-buffer) support" FORCE)
|
||||
set(BUILD_XFT false CACHE BOOL "Build Xft (freetype fonts) support" FORCE)
|
||||
set(BUILD_IMLIB2 false CACHE BOOL "Enable Imlib2 support" FORCE)
|
||||
set(BUILD_XSHAPE false CACHE BOOL "Enable Xshape support" FORCE)
|
||||
endif(BUILD_X11)
|
||||
|
||||
if(OWN_WINDOW)
|
||||
|
@ -203,6 +203,13 @@ if(BUILD_X11)
|
||||
set(conky_libs ${conky_libs} ${X11_Xdamage_LIB} ${X11_Xfixes_LIB})
|
||||
endif(BUILD_XDAMAGE)
|
||||
|
||||
if(BUILD_XSHAPE)
|
||||
if(NOT X11_Xshape_FOUND)
|
||||
message(FATAL_ERROR "Unable to find Xshape library")
|
||||
endif(NOT X11_Xshape_FOUND)
|
||||
set(conky_libs ${conky_libs} ${X11_Xshape_LIB} )
|
||||
endif(BUILD_XSHAPE)
|
||||
|
||||
# check for Xft
|
||||
if(BUILD_XFT)
|
||||
find_path(freetype_INCLUDE_PATH freetype/config/ftconfig.h ${INCLUDE_SEARCH_PATH}
|
||||
|
@ -44,6 +44,8 @@
|
||||
|
||||
#cmakedefine BUILD_XFT 1
|
||||
|
||||
#cmakedefine BUILD_XSHAPE 1
|
||||
|
||||
#cmakedefine BUILD_ARGB 1
|
||||
|
||||
#cmakedefine BUILD_XDBE 1
|
||||
|
22
src/x11.cc
22
src/x11.cc
@ -47,6 +47,10 @@
|
||||
#ifdef BUILD_XFT
|
||||
#include <X11/Xft/Xft.h>
|
||||
#endif
|
||||
#ifdef BUILD_XSHAPE
|
||||
#include <X11/extensions/shape.h>
|
||||
#include <X11/extensions/shapeconst.h>
|
||||
#endif
|
||||
|
||||
#ifdef BUILD_ARGB
|
||||
bool have_argb_visual;
|
||||
@ -714,6 +718,24 @@ static void init_window(lua::state &l __attribute__((unused)), bool own)
|
||||
/* allow decorated windows to be given input focus by WM */
|
||||
wmHint.input =
|
||||
TEST_HINT(hints, HINT_UNDECORATED) ? False : True;
|
||||
#ifdef BUILD_XSHAPE
|
||||
if (!wmHint.input) {
|
||||
int event_base, error_base;
|
||||
if (XShapeQueryExtension(display, &event_base, &error_base)) {
|
||||
int major_version = 0, minor_version = 0;
|
||||
XShapeQueryVersion(display, &major_version, &minor_version);
|
||||
if ((major_version > 1) || ((major_version == 1) && (minor_version >=1))) {
|
||||
Region empty_region = XCreateRegion();
|
||||
XShapeCombineRegion(display, window.window, ShapeInput, 0, 0, empty_region, ShapeSet);
|
||||
XDestroyRegion(empty_region);
|
||||
} else {
|
||||
NORM_ERR("Input shapes are not supported");
|
||||
}
|
||||
} else {
|
||||
NORM_ERR("No shape extension found");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (own_window_type.get(l) == TYPE_DOCK || own_window_type.get(l) == TYPE_PANEL) {
|
||||
wmHint.initial_state = WithdrawnState;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user