add macro wrapper to force elm win accel disabling on internal windows

This commit is contained in:
Mike Blumenkrantz 2014-11-03 14:08:45 -05:00
parent 99589eb5af
commit ffa98586a4
2 changed files with 17 additions and 8 deletions

View File

@ -1,8 +1,7 @@
#include "e.h"
/* intercept elm_win operations so we talk directly to e_client */
#include <Elementary.h>
#undef elm_win_add
typedef struct _Elm_Win_Trap_Ctx
{
@ -406,3 +405,16 @@ e_win_no_reopen_set(Evas_Object *obj, Eina_Bool no_reopen)
if (ctx->client)
ctx->client->internal_no_reopen = !!no_reopen;
}
EAPI Evas_Object *
e_elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
{
char *eng = eina_strdup(getenv("ELM_ACCEL"));
Evas_Object *o;
e_util_env_set("ELM_ACCEL", "none");
o = elm_win_add(parent, name, type);
e_util_env_set("ELM_ACCEL", eng);
free(eng);
return o;
}

View File

@ -31,13 +31,10 @@ e_obj_is_win(const void *obj)
return type && !strcmp(type, "elm_win");
}
#define E_WIN_START \
char *eng__ = eina_strdup(getenv("ELM_ACCEL")); \
e_util_env_set("ELM_ACCEL", "none")
EAPI Evas_Object *e_elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type);
#define E_WIN_END \
e_util_env_set("ELM_ACCEL", eng__); \
free(eng__)
#define elm_win_add(X, Y, Z) \
e_elm_win_add((X), (Y), (Z))
#endif
#endif