BY YOUR POWERS COMBINED, I AM CAPTAIN FEATURES!

add option (disabled by default) to simulate previous notification module behavior of placing notification based on full multiple monitor geometry
when not checked, uses primary display geometry only


SVN revision: 64706
This commit is contained in:
Mike Blumenkrantz 2011-11-03 16:03:23 +00:00
parent 26d555de4d
commit 9ece62de39
4 changed files with 25 additions and 10 deletions

View File

@ -7,6 +7,7 @@ struct _E_Config_Dialog_Data
int show_critical;
int force_timeout;
int ignore_replacement;
int dual_screen;
double timeout;
int corner;
};
@ -76,6 +77,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->corner = notification_cfg->corner;
cfdata->force_timeout = notification_cfg->force_timeout;
cfdata->ignore_replacement = notification_cfg->ignore_replacement;
cfdata->dual_screen = notification_cfg->dual_screen;
}
static Evas_Object *
@ -139,6 +141,8 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__,
of = e_widget_framelist_add(evas, _("Miscellaneous"), 0);
ow = e_widget_check_add(evas, _("Ignore replace ID"), &(cfdata->ignore_replacement));
e_widget_framelist_object_append(of, ow);
ow = e_widget_check_add(evas, _("Use multiple monitor geometry"), &(cfdata->dual_screen));
e_widget_framelist_object_append(of, ow);
e_widget_list_object_append(o, of, 1, 1, 0.5);
@ -156,6 +160,7 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__,
notification_cfg->corner = cfdata->corner;
notification_cfg->force_timeout = cfdata->force_timeout;
notification_cfg->ignore_replacement = cfdata->ignore_replacement;
notification_cfg->dual_screen = cfdata->dual_screen;
e_modapi_save(notification_mod);
return 1;

View File

@ -328,6 +328,7 @@ e_modapi_init(E_Module *m)
E_CONFIG_VAL(D, T, timeout, FLOAT);
E_CONFIG_VAL(D, T, force_timeout, INT);
E_CONFIG_VAL(D, T, ignore_replacement, INT);
E_CONFIG_VAL(D, T, dual_screen, INT);
E_CONFIG_LIST(D, T, items, conf_item_edd);
notification_cfg = e_config_domain_load("module.notification", conf_edd);
@ -461,6 +462,7 @@ _notification_cfg_new(void)
cfg->timeout = 5.0;
cfg->force_timeout = 0;
cfg->ignore_replacement = 0;
cfg->dual_screen = 0;
cfg->corner = CORNER_TR;
return cfg;

View File

@ -7,7 +7,7 @@
#include "config.h"
#define MOD_CFG_FILE_EPOCH 0x0002
#define MOD_CFG_FILE_GENERATION 0x0005
#define MOD_CFG_FILE_GENERATION 0x0006
#define MOD_CFG_FILE_VERSION \
((MOD_CFG_FILE_EPOCH << 16) | MOD_CFG_FILE_GENERATION)
@ -41,6 +41,7 @@ struct _Config
int show_critical;
int force_timeout;
int ignore_replacement;
int dual_screen;
float timeout;
Popup_Corner corner;

View File

@ -297,13 +297,20 @@ static int
_notification_popup_place(Popup_Data *popup,
int pos)
{
int w, h;
E_Container *con;
con = e_container_current_get(e_manager_current_get());
evas_object_geometry_get(popup->theme, NULL, NULL, &w, &h);
int w, h, sw, sh;
int gap = 10;
int to_edge = 15;
E_Container *con;
if (notification_cfg->dual_screen)
{
con = e_container_current_get(e_manager_current_get());
sw = con->w;
sh = con->h;
}
else
ecore_x_randr_screen_current_size_get(e_manager_current_get()->root, &sw, &sh, NULL, NULL);
evas_object_geometry_get(popup->theme, NULL, NULL, &w, &h);
/* XXX for now ignore placement requests */
@ -315,18 +322,18 @@ _notification_popup_place(Popup_Data *popup,
break;
case CORNER_TR:
e_popup_move(popup->win,
con->w - (w + to_edge),
sw - (w + to_edge),
to_edge + pos);
break;
case CORNER_BL:
e_popup_move(popup->win,
to_edge,
(con->h - h) - (to_edge + pos));
(sh - h) - (to_edge + pos));
break;
case CORNER_BR:
e_popup_move(popup->win,
con->w - (w + to_edge),
(con->h - h) - (to_edge + pos));
sw - (w + to_edge),
(sh - h) - (to_edge + pos));
break;
default:
break;