Add check in 'valid borders get' for quickpanel so it is not included in

that return.
Add function to return all quickpanel borders.
Add function to return count of quickpanel borders.
No need to retrieve mode from event window when we get a client message. The
mode is actually returned to us already in the event data.
Add trap for quickpanel state in client message handler.



SVN revision: 44738
This commit is contained in:
Christopher Michael 2009-12-28 02:11:55 +00:00
parent b6d17d8ce5
commit 0576446c11
4 changed files with 54 additions and 24 deletions

View File

@ -240,6 +240,7 @@ e_mod_border_valid_borders_get(E_Zone *zone)
if (e_mod_border_is_bottom_panel(bd)) continue;
if (e_mod_border_is_keyboard(bd)) continue;
if (e_mod_border_is_dialog(bd)) continue;
if (e_mod_border_is_quickpanel(bd)) continue;
ret = eina_list_append(ret, bd);
}
return ret;
@ -260,6 +261,7 @@ e_mod_border_valid_border_get(E_Zone *zone)
if (e_mod_border_is_bottom_panel(bd)) continue;
if (e_mod_border_is_keyboard(bd)) continue;
if (e_mod_border_is_dialog(bd)) continue;
if (e_mod_border_is_quickpanel(bd)) continue;
ret = bd;
break;
}
@ -278,6 +280,35 @@ e_mod_border_valid_count_get(E_Zone *zone)
return count;
}
Eina_List *
e_mod_border_quickpanel_borders_get(E_Zone *zone)
{
Eina_List *bds, *l, *ret = NULL;
E_Border *bd;
bds = e_border_client_list();
EINA_LIST_FOREACH(bds, l, bd)
{
if (!bd) continue;
if (bd->zone != zone) continue;
if (!e_mod_border_is_quickpanel(bd)) continue;
ret = eina_list_append(ret, bd);
}
return ret;
}
int
e_mod_border_quickpanel_count_get(E_Zone *zone)
{
Eina_List *l;
int count;
l = e_mod_border_quickpanel_borders_get(zone);
count = eina_list_count(l);
eina_list_free(l);
return count;
}
E_Border *
e_mod_border_at_xy_get(E_Zone *zone, int x, int y)
{

View File

@ -30,6 +30,8 @@ Eina_Bool e_mod_border_is_quickpanel(E_Border *bd);
Eina_List *e_mod_border_valid_borders_get(E_Zone *zone);
E_Border *e_mod_border_valid_border_get(E_Zone *zone);
int e_mod_border_valid_count_get(E_Zone *zone);
Eina_List *e_mod_border_quickpanel_borders_get(E_Zone *zone);
int e_mod_border_quickpanel_count_get(E_Zone *zone);
E_Border *e_mod_border_at_xy_get(E_Zone *zone, int x, int y);
E_Border *e_mod_border_in_region_get(E_Zone *zone, int x, int y, int w, int h);
E_Border *e_mod_border_keyboard_get(E_Zone *zone);

View File

@ -321,21 +321,19 @@ _cb_event_client_message(void *data, int type, void *event)
}
else if (ev->message_type == ECORE_X_ATOM_E_ILLUME_MODE)
{
Ecore_X_Illume_Mode mode;
E_Border *bd;
E_Zone *zone;
int lock = 1;
mode = ecore_x_e_illume_mode_get(ev->win);
if (mode == ECORE_X_ILLUME_MODE_SINGLE)
if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_MODE_SINGLE)
il_cfg->policy.mode.dual = 0;
else if (mode == ECORE_X_ILLUME_MODE_DUAL)
else if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_MODE_DUAL)
il_cfg->policy.mode.dual = 1;
else /* unknown */
il_cfg->policy.mode.dual = 0;
e_config_save_queue();
if (mode == ECORE_X_ILLUME_MODE_DUAL)
if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_MODE_DUAL)
{
if (il_cfg->policy.mode.side == 0) lock = 0;
}
@ -401,5 +399,16 @@ _cb_event_client_message(void *data, int type, void *event)
if ((mode) && (mode->funcs.drag_end))
mode->funcs.drag_end(bd);
}
else if (ev->message_type == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE)
{
if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF)
{
printf("Quickpanel Off\n");
}
else if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ON)
{
printf("Quickpanel On\n");
}
}
return 1;
}

View File

@ -147,16 +147,6 @@ _border_add(E_Border *bd)
if ((bd->client.icccm.accepts_focus) && (bd->client.icccm.take_focus)
&& (!bd->lock_focus_out))
e_border_focus_set(bd, 1, 1);
if (bd == e_mod_border_top_shelf_get(bd->zone))
{
Ecore_X_Window xwin;
Ecore_X_Illume_Mode mode;
xwin = ecore_x_window_root_first_get();
mode = ecore_x_e_illume_mode_get(xwin);
ecore_x_e_illume_mode_send(xwin, mode);
}
}
static void
@ -304,12 +294,10 @@ _zone_layout(E_Zone *z)
}
else if (e_mod_border_is_bottom_panel(bd))
{
/* make sure we are not dragging the shelf */
/* make sure we are not dragging the bottom panel */
if (!ecore_x_e_illume_drag_get(bd->client.win))
{
_border_resize_fx(bd, z->x, (z->y + z->h - panelsize),
z->w, panelsize);
}
_border_resize_fx(bd, z->x, (z->y + z->h - panelsize),
z->w, panelsize);
e_border_stick(bd);
if (bd->layer != IL_BOTTOM_PANEL_LAYER)
e_border_layer_set(bd, IL_BOTTOM_PANEL_LAYER);
@ -339,15 +327,14 @@ _zone_layout(E_Zone *z)
}
else if (e_mod_border_is_quickpanel(bd))
{
int mw, mh;
int mh;
printf("Found Quickpanel Window: %s\n", bd->client.icccm.class);
e_mod_border_min_get(bd, &mw, &mh);
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);
e_border_lower(bd);
}
else
{
@ -440,6 +427,7 @@ _zone_layout_dual_top(E_Border *bd)
by = (ky + ss);
bw = kw;
bh = (kh - ss - ps);
/* grab the border at this location */
b = e_mod_border_at_xy_get(bd->zone, kx, shelfsize);