Use PATH_MAX in e_utils.
Add function in e_utils to get a zone by Ecore_X_Window (black_win). No need to check for locked in illume-indicator. Add client message handler for quickpanel to handle zone request changes on quickpanel borders. Remove some printfs. Minor formatting in illume2 e_kbd. Easier check for focused_vkbd_state. SVN revision: 45233
This commit is contained in:
parent
0eb90d3c04
commit
1bc2b829f2
|
@ -424,7 +424,7 @@ static int
|
|||
_e_util_icon_theme_set(Evas_Object *obj, const char *icon)
|
||||
{
|
||||
const char *file;
|
||||
char buf[4096];
|
||||
char buf[PATH_MAX];
|
||||
|
||||
if ((!icon) || (!icon[0])) return 0;
|
||||
snprintf(buf, sizeof(buf), "e/icons/%s", icon);
|
||||
|
@ -560,6 +560,22 @@ e_util_container_window_find(Ecore_X_Window win)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
EAPI E_Zone *
|
||||
e_util_zone_window_find(Ecore_X_Window win)
|
||||
{
|
||||
Eina_List *l, *ll, *lll;
|
||||
E_Manager *man;
|
||||
E_Container *con;
|
||||
E_Zone *zone;
|
||||
|
||||
EINA_LIST_FOREACH(e_manager_list(), l, man)
|
||||
EINA_LIST_FOREACH(man->containers, ll, con)
|
||||
EINA_LIST_FOREACH(con->zones, lll, zone)
|
||||
if (zone->black_win == win) return zone;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI E_Border *
|
||||
e_util_desk_border_above(E_Border *bd)
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef struct _E_Util_Image_Import_Handle E_Util_Image_Import_Handle;
|
||||
typedef struct _E_Util_Image_Import_Handle E_Util_Image_Import_Handle;
|
||||
|
||||
typedef enum _E_Image_Import_Mode E_Image_Import_Mode;
|
||||
enum _E_Image_Import_Mode
|
||||
|
@ -15,7 +15,6 @@ enum _E_Image_Import_Mode
|
|||
E_IMAGE_IMPORT_SCALE_ASPECT_OUT = 4
|
||||
};
|
||||
|
||||
|
||||
#else
|
||||
#ifndef E_UTILS_H
|
||||
#define E_UTILS_H
|
||||
|
@ -24,13 +23,12 @@ enum _E_Image_Import_Mode
|
|||
|
||||
#define e_util_dialog_show(title, args...) \
|
||||
{ \
|
||||
char __tmpbuf[4096]; \
|
||||
char __tmpbuf[PATH_MAX]; \
|
||||
\
|
||||
snprintf(__tmpbuf, sizeof(__tmpbuf), ##args); \
|
||||
e_util_dialog_internal(title, __tmpbuf); \
|
||||
}
|
||||
|
||||
|
||||
EAPI void e_util_wakeup(void);
|
||||
EAPI void e_util_env_set(const char *var, const char *val);
|
||||
EAPI E_Zone *e_util_zone_current_get(E_Manager *man);
|
||||
|
@ -53,6 +51,7 @@ EAPI int e_util_menu_item_edje_icon_set(E_Menu_Item *mi, const char *na
|
|||
EAPI unsigned int e_util_icon_size_normalize(unsigned int desired);
|
||||
EAPI int e_util_menu_item_theme_icon_set(E_Menu_Item *mi, const char *icon);
|
||||
EAPI E_Container *e_util_container_window_find(Ecore_X_Window win);
|
||||
EAPI E_Zone *e_util_zone_window_find(Ecore_X_Window win);
|
||||
EAPI E_Border *e_util_desk_border_above(E_Border *bd);
|
||||
EAPI E_Border *e_util_desk_border_below(E_Border *bd);
|
||||
EAPI int e_util_edje_collection_exists(const char *file, const char *coll);
|
||||
|
|
|
@ -192,12 +192,12 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
|||
inst->gcc = e_gadcon_client_new(gc, name, id, style, inst->o_btn);
|
||||
inst->gcc->data = inst;
|
||||
|
||||
_il_home_win_new(inst);
|
||||
// _il_home_win_new(inst);
|
||||
|
||||
xwin = inst->gcc->gadcon->zone->black_win;
|
||||
mode = ecore_x_e_illume_mode_get(xwin);
|
||||
if (mode > ECORE_X_ILLUME_MODE_SINGLE)
|
||||
_il_home_win_new(inst);
|
||||
// if (mode > ECORE_X_ILLUME_MODE_SINGLE)
|
||||
// _il_home_win_new(inst);
|
||||
|
||||
inst->hdl = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
|
||||
_il_home_cb_client_message, inst);
|
||||
|
|
|
@ -278,7 +278,6 @@ _e_mod_win_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event)
|
|||
if (!(iwin = data)) return;
|
||||
if (!iwin->dragging) return;
|
||||
bd = iwin->win->border;
|
||||
// if (bd->client.illume.drag.locked) return;
|
||||
ecore_x_e_illume_drag_end_send(bd->client.win);
|
||||
iwin->dragging = 0;
|
||||
my = 0;
|
||||
|
@ -297,7 +296,6 @@ _e_mod_win_cb_mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event)
|
|||
|
||||
ev = event;
|
||||
bd = iwin->win->border;
|
||||
// if (bd->client.illume.drag.locked) return;
|
||||
if ((bd->y + bd->h + ev->cur.output.y) >= (bd->zone->h)) return;
|
||||
|
||||
ecore_x_pointer_last_xy_get(NULL, &py);
|
||||
|
@ -332,7 +330,6 @@ _e_mod_win_cb_mouse_wheel(void *data, Evas *evas, Evas_Object *obj, void *event)
|
|||
Evas_Event_Mouse_Wheel *ev;
|
||||
Ecore_X_Illume_Quickpanel_State state;
|
||||
|
||||
if (!data) return;
|
||||
ev = event;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
|
||||
if (ev->direction != 0) return;
|
||||
|
@ -340,5 +337,6 @@ _e_mod_win_cb_mouse_wheel(void *data, Evas *evas, Evas_Object *obj, void *event)
|
|||
state = ECORE_X_ILLUME_QUICKPANEL_STATE_ON;
|
||||
else if (ev->z < 0)
|
||||
state = ECORE_X_ILLUME_QUICKPANEL_STATE_OFF;
|
||||
ecore_x_e_illume_quickpanel_state_send(ecore_x_window_root_first_get(), state);
|
||||
ecore_x_e_illume_quickpanel_state_send(ecore_x_window_root_first_get(),
|
||||
state);
|
||||
}
|
||||
|
|
|
@ -543,10 +543,7 @@ _e_kbd_cb_border_focus_in(void *data, int type, void *event)
|
|||
focused_vkbd_state = ev->border->client.vkbd.state;
|
||||
if (focused_vkbd_state == 0) return 1;
|
||||
if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
|
||||
{
|
||||
_e_kbd_all_hide();
|
||||
return 1;
|
||||
}
|
||||
_e_kbd_all_hide();
|
||||
else
|
||||
{
|
||||
if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_ALPHA)
|
||||
|
@ -603,7 +600,7 @@ _e_kbd_cb_border_property(void *data, int type, void *event)
|
|||
e_kbd_fullscreen_set(ev->border->zone, 0);
|
||||
|
||||
/* app wants kbd off - then kbd off it is */
|
||||
if (focused_vkbd_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
|
||||
if (focused_vkbd_state <= ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
|
||||
_e_kbd_all_hide();
|
||||
/* app wants something other than off... */
|
||||
else
|
||||
|
|
|
@ -80,6 +80,7 @@ e_quickpanel_show(E_Quickpanel *qp)
|
|||
if (qp->visible) return;
|
||||
if (!qp->borders) return;
|
||||
qp->borders = eina_list_sort(qp->borders, 0, _e_quickpanel_cb_sort);
|
||||
|
||||
if (!input_win)
|
||||
{
|
||||
input_win =
|
||||
|
@ -101,10 +102,10 @@ e_quickpanel_show(E_Quickpanel *qp)
|
|||
int ny = 0;
|
||||
|
||||
e_illume_border_top_shelf_size_get(qp->zone, NULL, &ny);
|
||||
EINA_LIST_REVERSE_FOREACH(qp->borders, l, bd)
|
||||
EINA_LIST_FOREACH(qp->borders, l, bd)
|
||||
ny += bd->h;
|
||||
|
||||
EINA_LIST_REVERSE_FOREACH(qp->borders, l, bd)
|
||||
EINA_LIST_FOREACH(qp->borders, l, bd)
|
||||
{
|
||||
e_border_lower(bd);
|
||||
e_border_fx_offset(bd, 0, ny);
|
||||
|
@ -149,8 +150,8 @@ e_quickpanel_position_update(E_Quickpanel *qp)
|
|||
{
|
||||
bd->x = qp->zone->x;
|
||||
bd->y = (ty - qp->h);
|
||||
bd->changed = 1;
|
||||
bd->changes.pos = 1;
|
||||
bd->changed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -173,18 +174,38 @@ static int
|
|||
_e_quickpanel_cb_client_message(void *data, int type, void *event)
|
||||
{
|
||||
Ecore_X_Event_Client_Message *ev;
|
||||
E_Zone *zone;
|
||||
E_Quickpanel *qp;
|
||||
|
||||
ev = event;
|
||||
if (ev->win != ecore_x_window_root_first_get()) return 1;
|
||||
if (ev->message_type != ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE) return 1;
|
||||
zone = e_zone_current_get(e_container_current_get(e_manager_current_get()));
|
||||
if (!(qp = e_quickpanel_by_zone_get(zone))) return 1;
|
||||
if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF)
|
||||
e_quickpanel_hide(qp);
|
||||
else if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ON)
|
||||
e_quickpanel_show(qp);
|
||||
if (ev->message_type == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE)
|
||||
{
|
||||
E_Zone *zone;
|
||||
E_Quickpanel *qp;
|
||||
|
||||
zone = e_zone_current_get(e_container_current_get(e_manager_current_get()));
|
||||
if (!(qp = e_quickpanel_by_zone_get(zone))) return 1;
|
||||
if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF)
|
||||
e_quickpanel_hide(qp);
|
||||
else if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ON)
|
||||
e_quickpanel_show(qp);
|
||||
}
|
||||
else if (ev->message_type == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE_REQUEST)
|
||||
{
|
||||
E_Border *bd;
|
||||
E_Zone *zone;
|
||||
E_Quickpanel *qp;
|
||||
Ecore_X_Window z, qpw;
|
||||
|
||||
qpw = ev->data.l[1];
|
||||
if (!(bd = e_border_find_by_client_window(qpw))) return 1;
|
||||
z = ecore_x_e_illume_quickpanel_zone_get(bd->client.win);
|
||||
if (!(zone = e_util_zone_window_find(z))) return 1;
|
||||
if (bd->zone != zone)
|
||||
{
|
||||
if (!(qp = e_quickpanel_by_zone_get(bd->zone))) return 1;
|
||||
qp->borders = eina_list_remove(qp->borders, bd);
|
||||
e_border_zone_set(bd, zone);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -201,9 +222,7 @@ _e_quickpanel_cb_border_pre_post_fetch(void *data, void *data2)
|
|||
if (_e_quickpanel_by_border_get(bd)) return;
|
||||
if (!(qp = e_quickpanel_by_zone_get(bd->zone))) return;
|
||||
|
||||
printf("Appending: %s\n", bd->client.icccm.name);
|
||||
qp->borders = eina_list_append(qp->borders, bd);
|
||||
// qp->borders = eina_list_sorted_insert(qp->borders, _e_quickpanel_cb_sort, bd);
|
||||
|
||||
e_illume_border_top_shelf_pos_get(qp->zone, NULL, &ty);
|
||||
bd->stolen = 1;
|
||||
|
@ -213,7 +232,6 @@ _e_quickpanel_cb_border_pre_post_fetch(void *data, void *data2)
|
|||
{
|
||||
eina_stringshare_del(bd->bordername);
|
||||
bd->bordername = NULL;
|
||||
bd->client.border.changed = 1;
|
||||
}
|
||||
e_remember_unuse(bd->remember);
|
||||
bd->remember = NULL;
|
||||
|
@ -222,15 +240,6 @@ _e_quickpanel_cb_border_pre_post_fetch(void *data, void *data2)
|
|||
bd->client.border.changed = 1;
|
||||
qp->h += bd->h;
|
||||
e_border_move(bd, qp->zone->x, (ty - qp->h));
|
||||
/*
|
||||
if (qp->visible)
|
||||
{
|
||||
int th;
|
||||
|
||||
e_illume_border_top_shelf_size_get(qp->zone, NULL, &th);
|
||||
e_border_fx_offset(bd, 0, (bd->h - th));
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
static E_Quickpanel *
|
||||
|
@ -350,7 +359,7 @@ _e_quickpanel_hide(E_Quickpanel *qp)
|
|||
Eina_List *l;
|
||||
E_Border *bd;
|
||||
|
||||
EINA_LIST_FOREACH(qp->borders, l, bd)
|
||||
EINA_LIST_REVERSE_FOREACH(qp->borders, l, bd)
|
||||
{
|
||||
e_border_lower(bd);
|
||||
e_border_fx_offset(bd, 0, 0);
|
||||
|
@ -370,7 +379,6 @@ _e_quickpanel_cb_sort(const void *b1, const void *b2)
|
|||
|
||||
if (!(bd1 = b1)) return -1;
|
||||
if (!(bd2 = b2)) return 1;
|
||||
printf("Checking: %s against %s\n", bd2->client.icccm.name, bd1->client.icccm.name);
|
||||
major1 = bd1->client.illume.quickpanel.priority.major;
|
||||
major2 = bd2->client.illume.quickpanel.priority.major;
|
||||
if (major1 < major2) ret = -1;
|
||||
|
@ -380,14 +388,11 @@ _e_quickpanel_cb_sort(const void *b1, const void *b2)
|
|||
int minor1, minor2;
|
||||
|
||||
minor1 = bd1->client.illume.quickpanel.priority.minor;
|
||||
// ecore_x_e_illume_quickpanel_priority_minor_get(bd1->client.win);
|
||||
minor2 = bd2->client.illume.quickpanel.priority.minor;
|
||||
// ecore_x_e_illume_quickpanel_priority_minor_get(bd2->client.win);
|
||||
if (minor1 < minor2) ret = -1;
|
||||
else if (minor1 > minor2) ret = 1;
|
||||
if (minor2 < minor1) ret = -1;
|
||||
else if (minor2 > minor1) ret = 1;
|
||||
else ret = 0;
|
||||
}
|
||||
printf("Return: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ _layout_zone_layout(E_Zone *zone)
|
|||
(bd->y != (zone->y + zone->h - kbdsize)))
|
||||
_zone_layout_border_move(bd, zone->x,
|
||||
(zone->y + zone->h - kbdsize));
|
||||
e_border_stick(bd);
|
||||
// e_border_stick(bd);
|
||||
if (bd->layer != IL_KEYBOARD_LAYER)
|
||||
e_border_layer_set(bd, IL_KEYBOARD_LAYER);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue