From 79a1d4553477857a5ee71d9c76ac95e77cfbc0e7 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 10 Jan 2013 13:20:02 +0000 Subject: [PATCH] now that comp is mandatory, I require options to completely disable comp effects before I can use e without tearing my eyes from their sockets SVN revision: 82564 --- ChangeLog | 3 +- NEWS | 3 +- src/bin/e_comp.c | 211 ++++++++++++++------------- src/bin/e_comp_cfdata.c | 4 + src/bin/e_comp_cfdata.h | 4 + src/modules/conf_comp/e_mod_config.c | 59 +++++++- src/modules/conf_comp/e_mod_main.c | 8 + 7 files changed, 183 insertions(+), 109 deletions(-) diff --git a/ChangeLog b/ChangeLog index 908de43c5..ad6ff64d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,7 +11,8 @@ * e_menu_category_callback create callback parameter order has been changed * composite settings dialog is now accessible from Settings menu * modules no longer require shutdown or save functions - * comp module now uses the "e_comp" config domain + * comp settings now uses the "e_comp" config domain + * added options to disable comp effects on types of windows 2013-01-10 Deon Thomas diff --git a/NEWS b/NEWS index 662d009a1..24c7a9b2d 100644 --- a/NEWS +++ b/NEWS @@ -22,7 +22,8 @@ Additions: * Added option for disabling icons in menus * Added option for doing desklock, blanking or dimming even when showing fullscreen windows. * Added option for disabling pointer warping when performing directional focus changes using winlist - * comp module now uses the "e_comp" config domain + * comp settings now uses the "e_comp" config domain + * added options to disable comp effects on types of windows Changes: Modules: diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index 20df0a98c..4a7c5bb04 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -1614,7 +1614,7 @@ _e_comp_win_shadow_setup(E_Comp_Win *cw) char buf[4096]; Eina_List *list = NULL, *l; E_Comp_Match *m; - Eina_Bool focus = EINA_FALSE, urgent = EINA_FALSE; + Eina_Bool focus = EINA_FALSE, urgent = EINA_FALSE, skip = EINA_FALSE; const char *title = NULL, *name = NULL, *clas = NULL, *role = NULL; Ecore_X_Window_Type primary_type = ECORE_X_WINDOW_TYPE_UNKNOWN; @@ -1632,6 +1632,7 @@ _e_comp_win_shadow_setup(E_Comp_Win *cw) clas = cw->bd->client.icccm.class; role = cw->bd->client.icccm.window_role; primary_type = cw->bd->client.netwm.type; + skip = (conf->match.disable_borders); } else if (cw->pop) { @@ -1640,11 +1641,13 @@ _e_comp_win_shadow_setup(E_Comp_Win *cw) // etc. etc. list = conf->match.popups; name = cw->pop->name; + skip = (conf->match.disable_borders); } else if (cw->menu) { // FIXME: e has no way to tell e menus apart... need naming list = conf->match.menus; + skip = (conf->match.disable_borders); } else { @@ -1654,126 +1657,128 @@ _e_comp_win_shadow_setup(E_Comp_Win *cw) clas = cw->clas; role = cw->role; primary_type = cw->primary_type; + skip = (conf->match.disable_borders); } - EINA_LIST_FOREACH(list, l, m) + if (!skip) { - if (((m->title) && (!title)) || - ((title) && (m->title) && (!e_util_glob_match(title, m->title)))) - continue; - if (((m->name) && (!name)) || - ((name) && (m->name) && (!e_util_glob_match(name, m->name)))) - continue; - if (((m->clas) && (!clas)) || - ((clas) && (m->clas) && (!e_util_glob_match(clas, m->clas)))) - continue; - if (((m->role) && (!role)) || - ((role) && (m->role) && (!e_util_glob_match(role, m->role)))) - continue; - if ((primary_type != ECORE_X_WINDOW_TYPE_UNKNOWN) && - (m->primary_type != ECORE_X_WINDOW_TYPE_UNKNOWN) && - ((int)primary_type != m->primary_type)) - continue; - if (cw->bd) + EINA_LIST_FOREACH(list, l, m) { - if (m->borderless != 0) + if (((m->title) && (!title)) || + ((title) && (m->title) && (!e_util_glob_match(title, m->title)))) + continue; + if (((m->name) && (!name)) || + ((name) && (m->name) && (!e_util_glob_match(name, m->name)))) + continue; + if (((m->clas) && (!clas)) || + ((clas) && (m->clas) && (!e_util_glob_match(clas, m->clas)))) + continue; + if (((m->role) && (!role)) || + ((role) && (m->role) && (!e_util_glob_match(role, m->role)))) + continue; + if ((primary_type != ECORE_X_WINDOW_TYPE_UNKNOWN) && + (m->primary_type != ECORE_X_WINDOW_TYPE_UNKNOWN) && + ((int)primary_type != m->primary_type)) + continue; + if (cw->bd) { - int borderless = 0; + if (m->borderless != 0) + { + int borderless = 0; - if ((cw->bd->client.mwm.borderless) || (cw->bd->borderless)) - borderless = 1; - if (!(((m->borderless == -1) && (!borderless)) || - ((m->borderless == 1) && (borderless)))) - continue; - } - if (m->dialog != 0) - { - int dialog = 0; + if ((cw->bd->client.mwm.borderless) || (cw->bd->borderless)) + borderless = 1; + if (!(((m->borderless == -1) && (!borderless)) || + ((m->borderless == 1) && (borderless)))) + continue; + } + if (m->dialog != 0) + { + int dialog = 0; - if (((cw->bd->client.icccm.transient_for != 0) || - (cw->bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DIALOG))) - dialog = 1; - if (!(((m->dialog == -1) && (!dialog)) || - ((m->dialog == 1) && (dialog)))) - continue; - } - if (m->accepts_focus != 0) - { - int accepts_focus = 0; + if (((cw->bd->client.icccm.transient_for != 0) || + (cw->bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DIALOG))) + dialog = 1; + if (!(((m->dialog == -1) && (!dialog)) || + ((m->dialog == 1) && (dialog)))) + continue; + } + if (m->accepts_focus != 0) + { + int accepts_focus = 0; - if (cw->bd->client.icccm.accepts_focus) - accepts_focus = 1; - if (!(((m->accepts_focus == -1) && (!accepts_focus)) || - ((m->accepts_focus == 1) && (accepts_focus)))) - continue; - } - if (m->vkbd != 0) - { - int vkbd = 0; + if (cw->bd->client.icccm.accepts_focus) + accepts_focus = 1; + if (!(((m->accepts_focus == -1) && (!accepts_focus)) || + ((m->accepts_focus == 1) && (accepts_focus)))) + continue; + } + if (m->vkbd != 0) + { + int vkbd = 0; - if (cw->bd->client.vkbd.vkbd) - vkbd = 1; - if (!(((m->vkbd == -1) && (!vkbd)) || - ((m->vkbd == 1) && (vkbd)))) - continue; - } - if (m->quickpanel != 0) - { - int quickpanel = 0; + if (cw->bd->client.vkbd.vkbd) + vkbd = 1; + if (!(((m->vkbd == -1) && (!vkbd)) || + ((m->vkbd == 1) && (vkbd)))) + continue; + } + if (m->quickpanel != 0) + { + int quickpanel = 0; - if (cw->bd->client.illume.quickpanel.quickpanel) - quickpanel = 1; - if (!(((m->quickpanel == -1) && (!quickpanel)) || - ((m->quickpanel == 1) && (quickpanel)))) - continue; - } - if (m->argb != 0) - { - if (!(((m->argb == -1) && (!cw->argb)) || - ((m->argb == 1) && (cw->argb)))) - continue; - } - if (m->fullscreen != 0) - { - int fullscreen = 0; + if (cw->bd->client.illume.quickpanel.quickpanel) + quickpanel = 1; + if (!(((m->quickpanel == -1) && (!quickpanel)) || + ((m->quickpanel == 1) && (quickpanel)))) + continue; + } + if (m->argb != 0) + { + if (!(((m->argb == -1) && (!cw->argb)) || + ((m->argb == 1) && (cw->argb)))) + continue; + } + if (m->fullscreen != 0) + { + int fullscreen = 0; - if (cw->bd->client.netwm.state.fullscreen) - fullscreen = 1; - if (!(((m->fullscreen == -1) && (!fullscreen)) || - ((m->fullscreen == 1) && (fullscreen)))) - continue; - } - if (m->modal != 0) - { - int modal = 0; + if (cw->bd->client.netwm.state.fullscreen) + fullscreen = 1; + if (!(((m->fullscreen == -1) && (!fullscreen)) || + ((m->fullscreen == 1) && (fullscreen)))) + continue; + } + if (m->modal != 0) + { + int modal = 0; - if (cw->bd->client.netwm.state.modal) - modal = 1; - if (!(((m->modal == -1) && (!modal)) || - ((m->modal == 1) && (modal)))) - continue; + if (cw->bd->client.netwm.state.modal) + modal = 1; + if (!(((m->modal == -1) && (!modal)) || + ((m->modal == 1) && (modal)))) + continue; + } + } + focus = m->focus; + urgent = m->urgent; + if (m->shadow_style) + { + snprintf(buf, sizeof(buf), "e/comp/%s", + m->shadow_style); + ok = e_theme_edje_object_set(cw->shobj, "base/theme/borders", + buf); + if (ok) break; } - } - focus = m->focus; - urgent = m->urgent; - if (m->shadow_style) - { - snprintf(buf, sizeof(buf), "e/comp/%s", - m->shadow_style); - ok = e_theme_edje_object_set(cw->shobj, "base/theme/borders", - buf); - if (ok) break; } } - if (!ok) + while (!ok) { - if (cw->bd && cw->bd->client.e.state.video) + if (skip || (cw->bd && cw->bd->client.e.state.video)) ok = e_theme_edje_object_set(cw->shobj, "base/theme/borders", "e/comp/none"); - } - if (!ok) - { + if (ok) break; if (conf->shadow_style) { snprintf(buf, sizeof(buf), "e/comp/%s", @@ -1784,6 +1789,7 @@ _e_comp_win_shadow_setup(E_Comp_Win *cw) if (!ok) ok = e_theme_edje_object_set(cw->shobj, "base/theme/borders", "e/comp/default"); + break; } edje_object_part_swallow(cw->shobj, "e.swallow.content", cw->obj); if (cw->bd && cw->bd->client.e.state.video) @@ -1807,6 +1813,7 @@ _e_comp_win_shadow_setup(E_Comp_Win *cw) edje_object_signal_emit(cw->shobj, "e,state,visible,on", "e"); else edje_object_signal_emit(cw->shobj, "e,state,visible,off", "e"); + if (!cw->animating) { cw->c->animating++; diff --git a/src/bin/e_comp_cfdata.c b/src/bin/e_comp_cfdata.c index 8ff3f1fab..cd6e372b2 100644 --- a/src/bin/e_comp_cfdata.c +++ b/src/bin/e_comp_cfdata.c @@ -53,6 +53,10 @@ e_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD **match_edd) E_CONFIG_VAL(D, T, nocomp_fs, UCHAR); E_CONFIG_VAL(D, T, smooth_windows, UCHAR); E_CONFIG_VAL(D, T, first_draw_delay, DOUBLE); + E_CONFIG_VAL(D, T, match.disable_popups, UCHAR); + E_CONFIG_VAL(D, T, match.disable_borders, UCHAR); + E_CONFIG_VAL(D, T, match.disable_overrides, UCHAR); + E_CONFIG_VAL(D, T, match.disable_menus, UCHAR); E_CONFIG_LIST(D, T, match.popups, *match_edd); E_CONFIG_LIST(D, T, match.borders, *match_edd); E_CONFIG_LIST(D, T, match.overrides, *match_edd); diff --git a/src/bin/e_comp_cfdata.h b/src/bin/e_comp_cfdata.h index 749e1a6ee..91f939f61 100644 --- a/src/bin/e_comp_cfdata.h +++ b/src/bin/e_comp_cfdata.h @@ -31,9 +31,13 @@ struct _E_Comp_Config struct { + Eina_Bool disable_popups; Eina_List *popups; // used for e popups + Eina_Bool disable_borders; Eina_List *borders; // used for borders + Eina_Bool disable_overrides; Eina_List *overrides; // used for client menus, tooltips etc. + Eina_Bool disable_menus; Eina_List *menus; // used for e menus } match; }; diff --git a/src/modules/conf_comp/e_mod_config.c b/src/modules/conf_comp/e_mod_config.c index d668555d0..e0bb4c079 100644 --- a/src/modules/conf_comp/e_mod_config.c +++ b/src/modules/conf_comp/e_mod_config.c @@ -40,11 +40,17 @@ struct _E_Config_Dialog_Data struct { - Eina_List *popups; - Eina_List *borders; - Eina_List *overrides; - Eina_List *menus; + int disable_popups; + Eina_List *popups; // used for e popups + int disable_borders; + Eina_List *borders; // used for borders + int disable_overrides; + Eina_List *overrides; // used for client menus, tooltips etc. + int disable_menus; + Eina_List *menus; // used for e menus + int disable_all; int changed; + int toggle_changed : 1; } match; Evas_Object *popups_il; @@ -136,6 +142,12 @@ _create_data(E_Config_Dialog *cfd) if ((cfdata->engine != ENGINE_SW) && (cfdata->engine != ENGINE_GL)) cfdata->engine = ENGINE_SW; + cfdata->match.disable_popups = _comp_mod->conf->match.disable_popups; + cfdata->match.disable_borders = _comp_mod->conf->match.disable_borders; + cfdata->match.disable_overrides = _comp_mod->conf->match.disable_overrides; + cfdata->match.disable_menus = _comp_mod->conf->match.disable_menus; + cfdata->match.disable_all = + (cfdata->match.disable_menus && cfdata->match.disable_menus && cfdata->match.disable_borders && cfdata->match.disable_popups); cfdata->indirect = _comp_mod->conf->indirect; cfdata->texture_from_pixmap = _comp_mod->conf->texture_from_pixmap; cfdata->smooth_windows = _comp_mod->conf->smooth_windows; @@ -1161,6 +1173,16 @@ _advanced_create_widgets(E_Config_Dialog *cfd, ob = e_widget_check_add(evas, _("Smooth scaling"), &(cfdata->smooth_windows)); e_widget_list_object_append(ol, ob, 1, 0, 0.5); + + ob = e_widget_check_add(evas, _("Disable composite theming for windows"), &(cfdata->match.disable_borders)); + e_widget_list_object_append(ol, ob, 1, 0, 0.5); + ob = e_widget_check_add(evas, _("Disable composite theming for menus"), &(cfdata->match.disable_menus)); + e_widget_list_object_append(ol, ob, 1, 0, 0.5); + ob = e_widget_check_add(evas, _("Disable composite theming for popups"), &(cfdata->match.disable_popups)); + e_widget_list_object_append(ol, ob, 1, 0, 0.5); + ob = e_widget_check_add(evas, _("Disable composite theming for overrides"), &(cfdata->match.disable_overrides)); + e_widget_list_object_append(ol, ob, 1, 0, 0.5); + of = e_widget_frametable_add(evas, _("Styles"), 0); e_widget_frametable_content_align_set(of, 0.5, 0.5); oi = _create_styles_toolbook(cfd, evas, cfdata); @@ -1377,6 +1399,10 @@ static int _advanced_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) { + _comp_mod->conf->match.disable_popups = cfdata->match.disable_popups; + _comp_mod->conf->match.disable_borders = cfdata->match.disable_borders; + _comp_mod->conf->match.disable_overrides = cfdata->match.disable_overrides; + _comp_mod->conf->match.disable_menus = cfdata->match.disable_menus; if ((cfdata->lock_fps != _comp_mod->conf->lock_fps) || (cfdata->smooth_windows != _comp_mod->conf->smooth_windows) || (cfdata->grab != _comp_mod->conf->grab) || @@ -1487,6 +1513,16 @@ _advanced_apply_data(E_Config_Dialog *cfd __UNUSED__, return 1; } +static void +_basic_comp_style_toggle(void *oi, Evas_Object *o) +{ + E_Config_Dialog_Data *cfdata; + + e_widget_disabled_set(oi, e_widget_check_checked_get(o)); + cfdata = evas_object_data_get(o, "cfdata"); + cfdata->match.toggle_changed = 1; +} + static Evas_Object * _basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, @@ -1516,13 +1552,19 @@ _basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED, ob = e_widget_check_add(evas, _("Don't composite fullscreen windows"), &(cfdata->nocomp_fs)); e_widget_list_object_append(ol, ob, 1, 0, 0.5); - + + ob = e_widget_check_add(evas, _("Disable composite styling"), &(cfdata->match.disable_all)); + evas_object_data_set(ob, "cfdata", cfdata); + e_widget_list_object_append(ol, ob, 1, 0, 0.5); + of = e_widget_frametable_add(evas, _("Select default style"), 0); e_widget_frametable_content_align_set(of, 0.5, 0.5); oi = _style_selector(evas, &(cfdata->shadow_style)); e_widget_frametable_object_append(of, oi, 0, 0, 1, 1, 1, 1, 1, 1); e_widget_list_object_append(ol, of, 1, 1, 0.5); + e_widget_on_change_hook_set(ob, _basic_comp_style_toggle, oi); + e_widget_toolbook_page_append(otb, NULL, _("General"), ol, 1, 1, 1, 1, 0.5, 0.0); /////////////////////////////////////////// @@ -1556,6 +1598,13 @@ static int _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) { + if (cfdata->match.toggle_changed) + { + _comp_mod->conf->match.disable_popups = cfdata->match.disable_popups = cfdata->match.disable_all; + _comp_mod->conf->match.disable_borders = cfdata->match.disable_borders = cfdata->match.disable_all; + _comp_mod->conf->match.disable_overrides = cfdata->match.disable_overrides = cfdata->match.disable_all; + _comp_mod->conf->match.disable_menus = cfdata->match.disable_menus = cfdata->match.disable_all; + } if ((cfdata->lock_fps != _comp_mod->conf->lock_fps) || (cfdata->smooth_windows != _comp_mod->conf->smooth_windows) || (cfdata->grab != _comp_mod->conf->grab) || diff --git a/src/modules/conf_comp/e_mod_main.c b/src/modules/conf_comp/e_mod_main.c index 02fb45398..ab0244d78 100644 --- a/src/modules/conf_comp/e_mod_main.c +++ b/src/modules/conf_comp/e_mod_main.c @@ -118,6 +118,14 @@ e_modapi_init(E_Module *m) E_CONFIGURE_OPTION_ADD(co, BOOL, vsync, mod->conf, _("Tear-free compositing (VSYNC)"), _("composite"), _("border")); co->requires_restart = 1; cfg_opts = eina_inlist_append(cfg_opts, EINA_INLIST_GET(co)); + E_CONFIGURE_OPTION_ADD(co, BOOL, match.disable_borders, mod->conf, _("Disable composite theming for windows"), _("composite"), _("border"), _("theme")); + cfg_opts = eina_inlist_append(cfg_opts, EINA_INLIST_GET(co)); + E_CONFIGURE_OPTION_ADD(co, BOOL, match.disable_menus, mod->conf, _("Disable composite theming for menus"), _("composite"), _("menu"), _("theme")); + cfg_opts = eina_inlist_append(cfg_opts, EINA_INLIST_GET(co)); + E_CONFIGURE_OPTION_ADD(co, BOOL, match.disable_popups, mod->conf, _("Disable composite theming for popups"), _("composite"), _("popup"), _("theme")); + cfg_opts = eina_inlist_append(cfg_opts, EINA_INLIST_GET(co)); + E_CONFIGURE_OPTION_ADD(co, BOOL, match.disable_overrides, mod->conf, _("Disable composite theming for override-redirect windows (tooltips and such)"), _("composite"), _("theme")); + cfg_opts = eina_inlist_append(cfg_opts, EINA_INLIST_GET(co)); E_CONFIGURE_OPTION_ADD(co, BOOL, smooth_windows, mod->conf, _("Smooth scaling of composited window content"), _("composite"), _("border")); co->funcs[1].none = co->funcs[0].none = e_comp_shadow_set; cfg_opts = eina_inlist_append(cfg_opts, EINA_INLIST_GET(co));