forked from enlightenment/enlightenment
Do not need to pass module when doing e_kbd_init.
Do not need to pass module when doing e_mod_layout_init. Use global config->mod_dir in e_kbd_dbus. Handle layer set & lower of quickpanel(s) in _border_add function. Actually show/hide quickpanels when asked (temporary..this will change soon) No need to handle setting conformant app layer in layout code. Done in border_add. SVN revision: 44741
This commit is contained in:
parent
4a4d04fa81
commit
fa7997bb19
|
@ -38,14 +38,11 @@ static void _e_kbd_cb_border_eval_end(void *data, void *data2);
|
|||
static Eina_List *kbds = NULL, *handlers = NULL, *hooks = NULL;
|
||||
static E_Border *focused_border = NULL;
|
||||
static Ecore_X_Atom focused_vkbd_state = 0;
|
||||
const char *mod_dir = NULL;
|
||||
|
||||
/* public functions */
|
||||
int
|
||||
e_kbd_init(E_Module *m)
|
||||
e_kbd_init(void)
|
||||
{
|
||||
mod_dir = eina_stringshare_add(m->dir);
|
||||
|
||||
handlers =
|
||||
eina_list_append(handlers,
|
||||
ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
|
||||
|
@ -95,9 +92,6 @@ e_kbd_shutdown(void)
|
|||
EINA_LIST_FREE(kbds, kbd)
|
||||
e_object_del(E_OBJECT(kbd));
|
||||
|
||||
if (mod_dir) eina_stringshare_del(mod_dir);
|
||||
mod_dir = NULL;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ struct _E_Kbd
|
|||
unsigned char fullscreen : 1;
|
||||
};
|
||||
|
||||
int e_kbd_init(E_Module *m);
|
||||
int e_kbd_init(void);
|
||||
int e_kbd_shutdown(void);
|
||||
|
||||
E_Kbd *e_kbd_new(void);
|
||||
|
@ -54,6 +54,4 @@ void e_kbd_layout_set(E_Kbd *kbd, E_Kbd_Layout layout);
|
|||
void e_kbd_fullscreen_set(E_Zone *zone, int fullscreen);
|
||||
void e_kbd_safe_app_region_get(E_Zone *zone, int *x, int *y, int *w, int *h);
|
||||
|
||||
extern const char *mod_dir;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "e.h"
|
||||
#include "e_kbd.h"
|
||||
#include "e_kbd_dbus.h"
|
||||
#include "e_mod_config.h"
|
||||
|
||||
/* local variables */
|
||||
static int have_real_kbd = 0;
|
||||
|
@ -134,7 +135,7 @@ _e_kbd_dbus_ignore_kbds_load(void)
|
|||
|
||||
/* load the 'ignore' file from the system/module dir */
|
||||
snprintf(buff, sizeof(buff),
|
||||
"%s/keyboards/ignore_built_in_keyboards", mod_dir);
|
||||
"%s/keyboards/ignore_built_in_keyboards", il_cfg->mod_dir);
|
||||
_e_kbd_dbus_ignore_kbds_file_load(buff);
|
||||
}
|
||||
|
||||
|
|
|
@ -191,6 +191,7 @@ il_config_shutdown(void)
|
|||
eina_stringshare_del(il_cfg->policy.indicator.title);
|
||||
|
||||
if (il_cfg->mod_dir) eina_stringshare_del(il_cfg->mod_dir);
|
||||
il_cfg->mod_dir = NULL;
|
||||
|
||||
E_FREE(il_cfg);
|
||||
il_cfg = NULL;
|
||||
|
|
|
@ -26,7 +26,7 @@ static Eina_List *handlers = NULL;
|
|||
|
||||
/* public functions */
|
||||
void
|
||||
e_mod_layout_init(E_Module *m)
|
||||
e_mod_layout_init(void)
|
||||
{
|
||||
Eina_List *l;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ struct _Illume_Layout_Mode
|
|||
} funcs;
|
||||
};
|
||||
|
||||
void e_mod_layout_init(E_Module *m);
|
||||
void e_mod_layout_init(void);
|
||||
void e_mod_layout_shutdown(void);
|
||||
|
||||
void illume_layout_mode_register(const Illume_Layout_Mode *laymode);
|
||||
|
|
|
@ -146,6 +146,17 @@ _border_add(E_Border *bd)
|
|||
* under the window (if it's needed) */
|
||||
if (conform) bd->lock_user_stacking = 1;
|
||||
|
||||
/* handle setting quickpanel layer and lowering.
|
||||
* This is handled here due to the delay with e_border_lower.
|
||||
* If we try to handle this in zone_layout then things bog down a lot */
|
||||
if (e_mod_border_is_quickpanel(bd))
|
||||
{
|
||||
if (bd->layer != IL_QUICK_PANEL_LAYER)
|
||||
e_border_layer_set(bd, IL_QUICK_PANEL_LAYER);
|
||||
bd->lock_user_stacking = 1;
|
||||
e_border_lower(bd);
|
||||
}
|
||||
|
||||
/* only set focus if border accepts it and it's not locked out */
|
||||
if ((bd->client.icccm.accepts_focus) && (bd->client.icccm.take_focus)
|
||||
&& (!bd->lock_focus_out))
|
||||
|
@ -236,13 +247,43 @@ _drag_end(E_Border *bd)
|
|||
static void
|
||||
_quickpanel_on(E_Zone *zone)
|
||||
{
|
||||
Eina_List *qps, *l;
|
||||
E_Border *bd;
|
||||
int th, ty, ny = 0;
|
||||
|
||||
printf("Illume quickpanel on\n");
|
||||
if (!(qps = e_mod_border_quickpanel_borders_get(zone))) return;
|
||||
e_mod_border_top_shelf_pos_get(zone, NULL, &ty);
|
||||
e_mod_border_top_shelf_size_get(zone, NULL, &th);
|
||||
ny = (ty + th);
|
||||
EINA_LIST_FOREACH(qps, l, bd)
|
||||
{
|
||||
int mh;
|
||||
|
||||
e_mod_border_min_get(bd, NULL, &mh);
|
||||
// if ((bd->w != zone->w) || (bd->h != mh))
|
||||
// e_border_resize(bd, zone->w, mh);
|
||||
if ((bd->x != zone->x) || (bd->y != ny) || (bd->fx.y != ny))
|
||||
e_border_fx_offset(bd, 0, ny);
|
||||
ny += mh;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_quickpanel_off(E_Zone *zone)
|
||||
{
|
||||
Eina_List *qps, *l;
|
||||
E_Border *bd;
|
||||
int ty;
|
||||
|
||||
printf("Illume quickpanel off\n");
|
||||
if (!(qps = e_mod_border_quickpanel_borders_get(zone))) return;
|
||||
e_mod_border_top_shelf_pos_get(zone, NULL, &ty);
|
||||
EINA_LIST_FOREACH(qps, l, bd)
|
||||
{
|
||||
if ((bd->x != zone->x) || (bd->y != ty) || (bd->fx.y != ty))
|
||||
e_border_fx_offset(bd, 0, ty);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -347,19 +388,9 @@ _zone_layout(E_Zone *z)
|
|||
e_mod_border_min_get(bd, NULL, &mh);
|
||||
if ((bd->w != bd->zone->w) || (bd->h != mh))
|
||||
e_border_resize(bd, bd->zone->w, mh);
|
||||
if (bd->layer != IL_QUICK_PANEL_LAYER)
|
||||
e_border_layer_set(bd, IL_QUICK_PANEL_LAYER);
|
||||
e_border_lower(bd);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (e_mod_border_is_conformant(bd))
|
||||
{
|
||||
/* make conformant windows under the indicator bar */
|
||||
if (bd->layer != IL_CONFORM_LAYER)
|
||||
e_border_layer_set(bd, IL_CONFORM_LAYER);
|
||||
}
|
||||
|
||||
/* normal border, handle layout based on policy mode */
|
||||
if (il_cfg->policy.mode.dual) _zone_layout_dual(bd);
|
||||
else _zone_layout_single(bd);
|
||||
|
|
|
@ -21,10 +21,10 @@ e_modapi_init(E_Module *m)
|
|||
if (!il_config_init(m)) return NULL;
|
||||
|
||||
/* set up the virtual keyboard */
|
||||
e_kbd_init(m);
|
||||
e_kbd_init();
|
||||
|
||||
/* init the layout subsystem */
|
||||
e_mod_layout_init(m);
|
||||
e_mod_layout_init();
|
||||
|
||||
/* create a new keyboard */
|
||||
kbd = e_kbd_new();
|
||||
|
|
Loading…
Reference in New Issue