From 5e13c9ca36fec9c96356c301eed59178ce65cd7f Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Tue, 19 Sep 2006 16:55:16 +0000 Subject: [PATCH] Set mask alpha threshold, if possible. SVN revision: 25977 --- configure.in | 4 ++++ src/E.h | 1 + src/eimage.c | 4 ++++ src/main.c | 2 ++ src/mod-misc.c | 1 + src/setup.c | 4 ---- 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 8714b310..8b211620 100644 --- a/configure.in +++ b/configure.in @@ -144,6 +144,10 @@ AC_SUBST(IMLIB_CFLAGS) AC_CHECK_LIB(Imlib2, imlib_create_image, dummy=1, AC_MSG_ERROR([Cannot find Imlib2: Is imlib2-config in path?]), $IMLIB_LIBS) +AC_CHECK_LIB(Imlib2, imlib_context_set_mask_alpha_threshold, + AC_DEFINE(HAVE_IMLIB_CONTEXT_SET_MASK_ALPHA_THRESHOLD, 1, + [Imlib2 has imlib_context_set_mask_alpha_threshold]),, + $IMLIB_LIBS) if test "x$enable_ecore" = "xyes"; then AC_CHECK_LIB(ecore_x, ecore_x_init, diff --git a/src/E.h b/src/E.h index a304ec58..720c368e 100644 --- a/src/E.h +++ b/src/E.h @@ -411,6 +411,7 @@ typedef struct char argb_clients; char argb_clients_inherit_attr; char use_sync; + int mask_alpha_threshold; } testing; char autosave; diff --git a/src/eimage.c b/src/eimage.c index 09fde269..29733801 100644 --- a/src/eimage.c +++ b/src/eimage.c @@ -45,6 +45,10 @@ EImageInit(Display * dpy) imlib_context_set_visual(_default_vis); imlib_context_set_colormap(_default_cmap); +#ifdef HAVE_IMLIB_CONTEXT_SET_MASK_ALPHA_THRESHOLD + imlib_context_set_mask_alpha_threshold(Conf.testing.mask_alpha_threshold); +#endif + imlib_context_set_dither(1); } diff --git a/src/main.c b/src/main.c index 9b42cbd9..3896e7e6 100644 --- a/src/main.c +++ b/src/main.c @@ -24,6 +24,7 @@ #include "E.h" #include "desktops.h" #include "dialog.h" +#include "eimage.h" #include "emodule.h" #include "file.h" #include "hints.h" @@ -244,6 +245,7 @@ main(int argc, char **argv) MapUnmap(0); /* Move elsewhere? */ + EImageInit(disp); HintsInit(); CommsInit(); SessionInit(); diff --git a/src/mod-misc.c b/src/mod-misc.c index 47b79e9f..30c479b5 100644 --- a/src/mod-misc.c +++ b/src/mod-misc.c @@ -162,6 +162,7 @@ static const CfgItem MiscCfgItems[] = { CFG_ITEM_BOOL(Conf, testing.argb_clients, 0), CFG_ITEM_BOOL(Conf, testing.argb_clients_inherit_attr, 0), CFG_ITEM_BOOL(Conf, testing.use_sync, 0), + CFG_ITEM_INT(Conf, testing.mask_alpha_threshold, 8), CFG_ITEM_BOOL(Conf, autosave, 1), CFG_ITEM_BOOL(Conf, memory_paranoia, 1), diff --git a/src/setup.c b/src/setup.c index d41de65b..06d9c99e 100644 --- a/src/setup.c +++ b/src/setup.c @@ -22,7 +22,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "E.h" -#include "eimage.h" #include "ewins.h" #include "screen.h" #include "xwin.h" @@ -230,9 +229,6 @@ SetupX(const char *dstr) VRoot.h = RRoot.h; } - /* Initialise image handling */ - EImageInit(disp); - /* Initialise event handling */ EventsInit();