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" #include "e.h"
/* intercept elm_win operations so we talk directly to e_client */ /* intercept elm_win operations so we talk directly to e_client */
#undef elm_win_add
#include <Elementary.h>
typedef struct _Elm_Win_Trap_Ctx 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) if (ctx->client)
ctx->client->internal_no_reopen = !!no_reopen; 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"); return type && !strcmp(type, "elm_win");
} }
#define E_WIN_START \ EAPI Evas_Object *e_elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type);
char *eng__ = eina_strdup(getenv("ELM_ACCEL")); \
e_util_env_set("ELM_ACCEL", "none")
#define E_WIN_END \ #define elm_win_add(X, Y, Z) \
e_util_env_set("ELM_ACCEL", eng__); \ e_elm_win_add((X), (Y), (Z))
free(eng__)
#endif #endif
#endif #endif