From 9ece62de399e389d74a8856ed6f33fb9d9b9dbee Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 3 Nov 2011 16:03:23 +0000 Subject: [PATCH] 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 --- src/modules/notification/e_mod_config.c | 5 +++++ src/modules/notification/e_mod_main.c | 2 ++ src/modules/notification/e_mod_main.h | 3 ++- src/modules/notification/e_mod_popup.c | 25 ++++++++++++++++--------- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/modules/notification/e_mod_config.c b/src/modules/notification/e_mod_config.c index 1288db4f7..3c83cb7d9 100644 --- a/src/modules/notification/e_mod_config.c +++ b/src/modules/notification/e_mod_config.c @@ -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; diff --git a/src/modules/notification/e_mod_main.c b/src/modules/notification/e_mod_main.c index 762cdb3fe..17a99fe2c 100644 --- a/src/modules/notification/e_mod_main.c +++ b/src/modules/notification/e_mod_main.c @@ -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; diff --git a/src/modules/notification/e_mod_main.h b/src/modules/notification/e_mod_main.h index 8340127d8..46d3063a4 100644 --- a/src/modules/notification/e_mod_main.h +++ b/src/modules/notification/e_mod_main.h @@ -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; diff --git a/src/modules/notification/e_mod_popup.c b/src/modules/notification/e_mod_popup.c index 35bcd56d7..e55be0617 100644 --- a/src/modules/notification/e_mod_popup.c +++ b/src/modules/notification/e_mod_popup.c @@ -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;