> Here is a little patch for the pager module,
> that basically able the user to show the pager popup on window urgent
> state change.
I did some changes on my patch, the new one is attached.
Details of the patch :
new from last patch :
* if the urgent window gets focused, close the
popup
* new from last patch : show popup if the urgent window is on the
current desk too, but is not focused
old patch things :
* fix: show the urgent state of a window even if the urgent state was
set before the pager start
* show the urgent state of windows in the pager popup
* the pager pops its popup on window urgent state change (configurable)
* a desktop can be selected in the pager popup, but all other actions
actions are still forbidden inside the popup
It adds 3 options in the pager configuration panel :
1. "show popup on urgent window"
2. "urgent popup sticks on the screen"
3. "urgent popup timer"
laurent 'kiwi_'
? pager_e_mod_main.patch
? patch_e_mod_pager_urgentstate
Index: e_mod_config.c
===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/pager/e_mod_config.c,v
retrieving revision 1.27
diff -u -r1.27 e_mod_config.c
--- e_mod_config.c 3 Feb 2007 02:02:49 -0000 1.27
+++ e_mod_config.c 23 Mar 2007 11:41:25 -0000
@@ -12,6 +12,9 @@
{
int show_popup;
double popup_speed;
+ int show_popup_urgent;
+ int popup_urgent_stick;
+ double popup_urgent_speed;
int drag_resist;
unsigned char btn_drag;
unsigned char btn_noplace;
@@ -25,6 +28,8 @@
} grab;
struct {
+ Evas_Object *o_urgent_stick;
+ Evas_Object *o_urgent_speed;
Evas_Object *o_btn1;
Evas_Object *o_btn2;
} gui;
@@ -42,6 +47,7 @@
static void _grab_wnd_hide(E_Config_Dialog_Data *cfdata);
static int _grab_mouse_down_cb(void *data, int type, void *event);
static int _grab_key_down_cb(void *data, int type, void *event);
+static void _check_urgent_stick_cb_change(void *data, Evas_Object *obj);
void
_config_pager_module(Config_Item *ci)
@@ -73,6 +79,9 @@
/* FIXME: configure zone config item */
cfdata->show_popup = pager_config->popup;
cfdata->popup_speed = pager_config->popup_speed;
+ cfdata->show_popup_urgent = pager_config->popup_urgent;
+ cfdata->popup_urgent_stick = pager_config->popup_urgent_stick;
+ cfdata->popup_urgent_speed = pager_config->popup_urgent_speed;
cfdata->drag_resist = pager_config->drag_resist;
cfdata->btn_drag = pager_config->btn_drag;
cfdata->btn_noplace = pager_config->btn_noplace;
@@ -105,7 +114,7 @@
o = e_widget_list_add(evas, 0, 0);
of = e_widget_framelist_add(evas, _("General Settings"), 0);
- ob = e_widget_check_add(evas, _("Show Popup"), &(cfdata->show_popup));
+ ob = e_widget_check_add(evas, _("Show Popup on desktop change"), &(cfdata->show_popup));
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
@@ -124,7 +133,7 @@
static Evas_Object *
_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
{
- Evas_Object *o, *of, *ob;
+ Evas_Object *o, *of, *of2, *ob;
o = e_widget_list_add(evas, 0, 0);
of = e_widget_framelist_add(evas, _("Resistance to Dragging Windows:"), 0);
@@ -133,13 +142,29 @@
e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_framelist_add(evas, _("Popup Settings"), 0);
- ob = e_widget_check_add(evas, _("Show Popup"), &(cfdata->show_popup));
+ ob = e_widget_check_add(evas, _("Show Popup on desktop change"), &(cfdata->show_popup));
e_widget_framelist_object_append(of, ob);
ob = e_widget_label_add(evas, _("Popup Speed"));
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.1f seconds"), 0.1, 10.0, 0.1, 0, &(cfdata->popup_speed), NULL, 200);
e_widget_framelist_object_append(of, ob);
- e_widget_list_object_append(o, of, 1, 1, 0.5);
+
+ of2 = e_widget_framelist_add(evas, _("Urgent window"), 0);
+ ob = e_widget_check_add(evas, _("Show Popup on urgent window"), &(cfdata->show_popup_urgent));
+ e_widget_framelist_object_append(of2, ob);
+ ob = e_widget_check_add(evas, _("Popup on urgent window sticks on the screen"), &(cfdata->popup_urgent_stick));
+ cfdata->gui.o_urgent_stick = ob;
+ e_widget_on_change_hook_set(ob, _check_urgent_stick_cb_change, cfdata);
+ e_widget_framelist_object_append(of2, ob);
+ ob = e_widget_label_add(evas, _("Popup Speed"));
+ e_widget_framelist_object_append(of2, ob);
+ ob = e_widget_slider_add(evas, 1, 0, _("%1.1f seconds"), 0.1, 10.0, 0.1, 0, &(cfdata->popup_urgent_speed), NULL, 200);
+ cfdata->gui.o_urgent_speed = ob;
+ _check_urgent_stick_cb_change(cfdata, cfdata->gui.o_urgent_stick);
+ e_widget_framelist_object_append(of2, ob);
+
+ e_widget_framelist_object_append(of, of2);
+ e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_frametable_add(evas, _("Buttons Settings"), 0);
ob = e_widget_label_add(evas, _("Drag and select button"));
@@ -168,6 +193,9 @@
{
pager_config->popup = cfdata->show_popup;
pager_config->popup_speed = cfdata->popup_speed;
+ pager_config->popup_urgent = cfdata->show_popup_urgent;
+ pager_config->popup_urgent_stick = cfdata->popup_urgent_stick;
+ pager_config->popup_urgent_speed = cfdata->popup_urgent_speed;
pager_config->drag_resist = cfdata->drag_resist;
pager_config->btn_drag = cfdata->btn_drag;
pager_config->btn_noplace = cfdata->btn_noplace;
@@ -300,4 +328,17 @@
_grab_wnd_hide(cfdata);
}
return 1;
+}
+
+static void
+_check_urgent_stick_cb_change(void *data, Evas_Object *obj)
+{
+ E_Config_Dialog_Data *cfdata;
+
+ cfdata = data;
+
+ if (e_widget_check_checked_get(cfdata->gui.o_urgent_stick))
+ e_widget_disabled_set(cfdata->gui.o_urgent_speed, 1);
+ else
+ e_widget_disabled_set(cfdata->gui.o_urgent_speed, 0);
}
Index: e_mod_main.c
===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/pager/e_mod_main.c,v
retrieving revision 1.207
diff -u -r1.207 e_mod_main.c
--- e_mod_main.c 3 Feb 2007 02:44:59 -0000 1.207
+++ e_mod_main.c 23 Mar 2007 11:41:25 -0000
@@ -47,6 +47,7 @@
struct _Pager
{
Instance *inst;
+ unsigned char is_popup : 1;
Evas_Object *o_table;
E_Zone *zone;
int xnum, ynum;
@@ -88,10 +89,11 @@
struct _Pager_Popup
{
- E_Popup *popup;
- Pager *pager, *src_pager;
- Evas_Object *o_bg;
- Ecore_Timer *timer;
+ E_Popup *popup;
+ Pager *pager, *src_pager;
+ Evas_Object *o_bg;
+ Ecore_Timer *timer;
+ unsigned char urgent : 1;
};
static void _pager_cb_obj_moveresize(void *data, Evas *e, Evas_Object *obj, void *event_info);
@@ -148,7 +150,7 @@
static void _pager_window_move(Pager_Win *pw);
static Pager_Win *_pager_window_find(Pager *p, E_Border *border);
static Pager_Win *_pager_desk_window_find(Pager_Desk *pd, E_Border *border);
-static Pager_Popup *_pager_popup_new(Pager *p);
+static Pager_Popup *_pager_popup_new(Pager *p, int urgent);
static void _pager_popup_free(Pager_Popup *pp);
static E_Config_DD *conf_edd = NULL;
@@ -289,11 +291,8 @@
static void
_pager_empty(Pager *p)
{
- if (p->popup)
- {
- _pager_popup_free(p->popup);
- p->popup = NULL;
- }
+ if (p->popup) _pager_popup_free(p->popup);
+
while (p->desks)
{
_pager_desk_free(p->desks->data);
@@ -464,6 +463,15 @@
evas_object_show(o);
edje_object_part_swallow(pw->o_window, "icon", o);
}
+
+ if (border->client.icccm.urgent)
+ {
+ if (!(border->iconic))
+ edje_object_signal_emit(pd->o_desk,
+ "e,state,urgent", "e");
+ edje_object_signal_emit(pw->o_window,
+ "e,state,urgent", "e");
+ }
evas_object_show(o);
@@ -524,7 +532,7 @@
}
static Pager_Popup *
-_pager_popup_new(Pager *p)
+_pager_popup_new(Pager *p, int urgent)
{
Pager_Popup *pp;
Evas_Coord w, h;
@@ -548,6 +556,8 @@
evas_object_geometry_get(p->o_table, NULL, NULL, &w, &h);
pp->pager = _pager_new(pp->popup->evas, p->zone);
+ pp->pager->inst = p->inst;
+ pp->pager->is_popup = 1;
evas_object_move(pp->pager->o_table, 0, 0);
evas_object_resize(pp->pager->o_table, w, h);
@@ -566,15 +576,26 @@
evas_object_move(pp->o_bg, 0, 0);
evas_object_resize(pp->o_bg, w, h);
e_popup_edje_bg_object_set(pp->popup, pp->o_bg);
- e_popup_ignore_events_set(pp->popup, 1);
+ //e_popup_ignore_events_set(pp->popup, 1);
e_popup_move_resize(pp->popup, ((p->zone->w - w) / 2),
((p->zone->h - h) / 2), w, h);
e_bindings_mouse_grab(E_BINDING_CONTEXT_POPUP, pp->popup->evas_win);
e_bindings_wheel_grab(E_BINDING_CONTEXT_POPUP, pp->popup->evas_win);
e_popup_show(pp->popup);
- pp->timer = ecore_timer_add(pager_config->popup_speed,
- _pager_popup_cb_timeout, pp);
+ if (!urgent)
+ {
+ pp->timer = ecore_timer_add(pager_config->popup_speed,
+ _pager_popup_cb_timeout, pp);
+ }
+ else
+ {
+ if (!pager_config->popup_urgent_stick)
+ pp->timer = ecore_timer_add(pager_config->popup_urgent_speed,
+ _pager_popup_cb_timeout, pp);
+ }
+ pp->urgent = urgent;
+
return pp;
}
@@ -1152,8 +1173,8 @@
static int
_pager_cb_event_border_urgent_change(void *data, int type, void *event)
{
- E_Event_Border_Urgent_Change *ev;
- Evas_List *l, *l2;
+ E_Event_Border_Urgent_Change *ev;
+ Evas_List *l, *l2;
ev = event;
for (l = pager_config->instances; l; l = l->next)
@@ -1174,10 +1195,16 @@
if (ev->border->client.icccm.urgent)
{
if (!(ev->border->iconic))
- edje_object_signal_emit(pd->o_desk,
- "e,state,urgent", "e");
+ edje_object_signal_emit(pd->o_desk,
+ "e,state,urgent", "e");
edje_object_signal_emit(pw->o_window,
"e,state,urgent", "e");
+
+ if (pager_config->popup_urgent &&
+ !inst->pager->popup)
+ {
+ _pager_popup_new(inst->pager, 1);
+ }
}
else
{
@@ -1186,10 +1213,17 @@
"e,state,not_urgent", "e");
edje_object_signal_emit(pw->o_window,
"e,state,not_urgent", "e");
+
+ if (inst->pager->popup &&
+ inst->pager->popup->urgent)
+ {
+ _pager_popup_free(inst->pager->popup);
+ }
}
}
}
}
+
return 1;
}
@@ -1233,7 +1267,7 @@
{
Pager_Popup *pp;
- pp = _pager_popup_new(pd->pager);
+ pp = _pager_popup_new(pd->pager, 0);
}
}
}
@@ -1318,6 +1352,7 @@
ev = event_info;
pw = data;
if (!pw) return;
+ if (pw->desk->pager->is_popup) return;
if (pw->border->lock_user_location) return;
if ((ev->button == pager_config->btn_drag) ||
(ev->button == pager_config->btn_noplace))
@@ -1347,6 +1382,7 @@
ev = event_info;
pw = data;
if (!pw) return;
+ if (pw->desk->pager->is_popup) return;
if ((ev->button == pager_config->btn_drag) ||
(ev->button == pager_config->btn_noplace))
{
@@ -1370,6 +1406,7 @@
pw = data;
if (!pw) return;
+ if (pw->desk->pager->is_popup) return;
/* prevent drag for a few pixels */
if (pw->drag.start)
{
@@ -1687,9 +1724,19 @@
{
Evas_Event_Mouse_Up *ev;
Pager_Desk *pd;
+ Pager *p;
ev = event_info;
pd = data;
+ p = pd->pager;
+
+ if ( p->is_popup &&
+ (pd->desk == e_desk_current_get(pd->pager->zone)) )
+ {
+ if (p->inst->pager->popup)
+ _pager_popup_free(p->inst->pager->popup);
+ }
+
/* FIXME: pd->pager->dragging is 0 when finishing a drag from desk to desk */
if ((ev->button == 1) && (!pd->pager->dragging) &&
(!pd->pager->just_dragged))
@@ -1718,6 +1765,8 @@
ev = event_info;
pd = data;
+ if (pd->pager->is_popup) return;
+
if (pager_config->flip_desk)
e_zone_desk_linear_flip_by(pd->desk->zone, ev->z);
}
@@ -1749,8 +1798,11 @@
#undef D
#define T Config
#define D conf_edd
- E_CONFIG_VAL(D, T, popup_speed, DOUBLE);
E_CONFIG_VAL(D, T, popup, UINT);
+ E_CONFIG_VAL(D, T, popup_speed, DOUBLE);
+ E_CONFIG_VAL(D, T, popup_urgent, UINT);
+ E_CONFIG_VAL(D, T, popup_urgent_stick, UINT);
+ E_CONFIG_VAL(D, T, popup_urgent_speed, DOUBLE);
E_CONFIG_VAL(D, T, drag_resist, UINT);
E_CONFIG_VAL(D, T, scale, UCHAR);
E_CONFIG_VAL(D, T, resize, UCHAR);
@@ -1763,8 +1815,11 @@
if (!pager_config)
{
pager_config = E_NEW(Config, 1);
- pager_config->popup_speed = 1.0;
pager_config->popup = 1;
+ pager_config->popup_speed = 1.0;
+ pager_config->popup_urgent = 0;
+ pager_config->popup_urgent_stick = 0;
+ pager_config->popup_urgent_speed = 1.5;
pager_config->drag_resist = 3;
pager_config->scale = 1;
pager_config->resize = PAGER_RESIZE_BOTH;
@@ -1772,8 +1827,11 @@
pager_config->btn_noplace = 2;
pager_config->flip_desk = 0;
}
- E_CONFIG_LIMIT(pager_config->popup_speed, 0.1, 10.0);
E_CONFIG_LIMIT(pager_config->popup, 0, 1);
+ E_CONFIG_LIMIT(pager_config->popup_speed, 0.1, 10.0);
+ E_CONFIG_LIMIT(pager_config->popup_urgent, 0, 1);
+ E_CONFIG_LIMIT(pager_config->popup_urgent_stick, 0, 1);
+ E_CONFIG_LIMIT(pager_config->popup_urgent_speed, 0.1, 10.0);
E_CONFIG_LIMIT(pager_config->drag_resist, 0, 50);
E_CONFIG_LIMIT(pager_config->resize, PAGER_RESIZE_HORZ, PAGER_RESIZE_BOTH);
E_CONFIG_LIMIT(pager_config->flip_desk, 0, 1);
Index: e_mod_main.h
===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/pager/e_mod_main.h,v
retrieving revision 1.49
diff -u -r1.49 e_mod_main.h
--- e_mod_main.h 19 Nov 2006 08:58:05 -0000 1.49
+++ e_mod_main.h 23 Mar 2007 11:41:25 -0000
@@ -21,8 +21,11 @@
struct _Config
{
/* saved * loaded config values */
- double popup_speed;
unsigned int popup;
+ double popup_speed;
+ unsigned int popup_urgent;
+ unsigned int popup_urgent_stick;
+ double popup_urgent_speed;
unsigned int drag_resist;
unsigned char scale;
unsigned char resize;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel