- allow glob matching in window remember -> advanced dialog has now editable entries

- option added to remember desktop file for e window match. 
    means no more ugly openoffice provided icons (= even if i dont use it ..
- e_border: added fallback for transient windows to use .desktop from main window   
- fixed bug in e_remember to not delete all remembers when last item of the conf_remember list is deleted 


SVN revision: 42432
This commit is contained in:
Hannes Janetzek 2009-09-12 07:04:32 +00:00
parent 698aebad53
commit 81a9f94b4c
3 changed files with 146 additions and 81 deletions

View File

@ -7369,13 +7369,19 @@ _e_border_eval(E_Border *bd)
evas_object_del(bd->icon_object); evas_object_del(bd->icon_object);
bd->icon_object = NULL; bd->icon_object = NULL;
} }
if (bd->remember && bd->remember->prop.desktop_file)
{
const char *desktop = bd->remember->prop.desktop_file;
bd->desktop = efreet_desktop_new(desktop);
if (!bd->desktop)
bd->desktop = efreet_util_desktop_name_find(desktop);
}
if (!bd->desktop) if (!bd->desktop)
{ {
if ((bd->client.icccm.name) && (bd->client.icccm.class)) if ((bd->client.icccm.name) && (bd->client.icccm.class))
bd->desktop = efreet_util_desktop_wm_class_find(bd->client.icccm.name, bd->desktop = efreet_util_desktop_wm_class_find(bd->client.icccm.name,
bd->client.icccm.class); bd->client.icccm.class);
/* already refd by desktop_wm_class_find */
/* if (bd->desktop) efreet_desktop_ref(bd->desktop); */
} }
if (!bd->desktop) if (!bd->desktop)
{ {
@ -7389,7 +7395,15 @@ _e_border_eval(E_Border *bd)
run from a shell */ run from a shell */
bd->desktop = efreet_util_desktop_exec_find(bd->client.icccm.name); bd->desktop = efreet_util_desktop_exec_find(bd->client.icccm.name);
} }
if (!bd->desktop && bd->client.icccm.transient_for)
{
E_Border *bd2 = e_border_find_by_client_window(bd->client.icccm.transient_for);
if (bd2 && bd2->desktop)
{
efreet_desktop_ref(bd2->desktop);
bd->desktop = bd2->desktop;
}
}
if (bd->desktop) if (bd->desktop)
{ {
ecore_x_window_prop_string_set(bd->client.win, E_ATOM_DESKTOP_FILE, ecore_x_window_prop_string_set(bd->client.win, E_ATOM_DESKTOP_FILE,

View File

@ -29,6 +29,7 @@ struct _E_Config_Dialog_Data
char *title; char *title;
char *role; char *role;
char *command; char *command;
char *desktop;
struct { struct {
int match_name; int match_name;
int match_class; int match_class;
@ -52,6 +53,7 @@ struct _E_Config_Dialog_Data
int apply_skip_taskbar; int apply_skip_taskbar;
int apply_run; int apply_run;
int apply_icon_pref; int apply_icon_pref;
int apply_desktop_file;
int set_focus_on_start; int set_focus_on_start;
int keep_settings; int keep_settings;
} remember; } remember;
@ -113,16 +115,35 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->mode = MODE_LOCKS; cfdata->mode = MODE_LOCKS;
else cfdata->mode = MODE_NOTHING; else cfdata->mode = MODE_NOTHING;
if (bd->client.icccm.name && bd->client.icccm.name[0]) if (bd->remember)
{
if (bd->remember->name)
cfdata->name = strdup(bd->remember->name);
if (bd->remember->class)
cfdata->class = strdup(bd->remember->class);
if (bd->remember->title)
cfdata->title = strdup(bd->remember->title);
if (bd->remember->prop.desktop_file)
cfdata->desktop = strdup(bd->remember->prop.desktop_file);
if (cfdata->desktop)
cfdata->remember.apply_desktop_file = 1;
}
if (!cfdata->name && bd->client.icccm.name && bd->client.icccm.name[0])
cfdata->name = strdup(bd->client.icccm.name); cfdata->name = strdup(bd->client.icccm.name);
if (bd->client.icccm.class && bd->client.icccm.class[0]) if (!cfdata->class && bd->client.icccm.class && bd->client.icccm.class[0])
cfdata->class = strdup(bd->client.icccm.class); cfdata->class = strdup(bd->client.icccm.class);
if (bd->client.netwm.name && bd->client.netwm.name[0])
cfdata->title = strdup(bd->client.netwm.name);
else if (bd->client.icccm.title && bd->client.icccm.title[0])
cfdata->title = strdup(bd->client.icccm.title);
if (bd->client.icccm.window_role && bd->client.icccm.window_role[0]) if (bd->client.icccm.window_role && bd->client.icccm.window_role[0])
cfdata->role = strdup(bd->client.icccm.window_role); cfdata->role = strdup(bd->client.icccm.window_role);
if (!cfdata->title)
{
if(bd->client.netwm.name && bd->client.netwm.name[0])
cfdata->title = strdup(bd->client.netwm.name);
else if (bd->client.icccm.title && bd->client.icccm.title[0])
cfdata->title = strdup(bd->client.icccm.title);
}
if (!cfdata->desktop && bd->desktop)
cfdata->desktop = strdup(bd->desktop->name);
if ((bd->client.icccm.command.argc > 0) && if ((bd->client.icccm.command.argc > 0) &&
(bd->client.icccm.command.argv)) (bd->client.icccm.command.argv))
@ -220,60 +241,89 @@ _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
if (cfdata->title) free(cfdata->title); if (cfdata->title) free(cfdata->title);
if (cfdata->role) free(cfdata->role); if (cfdata->role) free(cfdata->role);
if (cfdata->command) free(cfdata->command); if (cfdata->command) free(cfdata->command);
if (cfdata->border) if (cfdata->desktop) free(cfdata->desktop);
cfdata->border->border_remember_dialog = NULL;
cfdata->border->border_remember_dialog = NULL;
free(cfdata); free(cfdata);
} }
/**--APPLY--**/ /**--APPLY--**/
static int static int
_check_matches(E_Border *bd, int matchflags) _check_matches(E_Config_Dialog_Data *cfdata, int update)
{ {
Eina_List *l; Eina_List *l;
E_Border *bd2; E_Border *bd;
int n = 0;
const char *title; const char *title;
int matchflags = 0;
int required_matches = 0;
int n = 0;
title = e_border_name_get(bd); if (cfdata->remember.match_name)
EINA_LIST_FOREACH(e_border_client_list(), l, bd2)
{ {
int required_matches; matchflags |= E_REMEMBER_MATCH_NAME;
int matches; required_matches++;
const char *title2; }
if (cfdata->remember.match_class)
{
matchflags |= E_REMEMBER_MATCH_CLASS;
required_matches++;
}
if (cfdata->remember.match_title)
{
matchflags |= E_REMEMBER_MATCH_TITLE;
required_matches++;
}
if (cfdata->remember.match_role)
{
matchflags |= E_REMEMBER_MATCH_ROLE;
required_matches++;
}
if (cfdata->remember.match_type)
{
matchflags |= E_REMEMBER_MATCH_TYPE;
required_matches++;
}
matches = 0; if (cfdata->remember.match_transient)
required_matches = 0; {
if (matchflags & E_REMEMBER_MATCH_NAME) required_matches++; matchflags |= E_REMEMBER_MATCH_TRANSIENT;
if (matchflags & E_REMEMBER_MATCH_CLASS) required_matches++; required_matches++;
if (matchflags & E_REMEMBER_MATCH_TITLE) required_matches++; }
if (matchflags & E_REMEMBER_MATCH_ROLE) required_matches++;
if (matchflags & E_REMEMBER_MATCH_TYPE) required_matches++; EINA_LIST_FOREACH(e_border_client_list(), l, bd)
if (matchflags & E_REMEMBER_MATCH_TRANSIENT) required_matches++; {
title2 = e_border_name_get(bd2); int matches = 0;
title = e_border_name_get(bd);
if ((matchflags & E_REMEMBER_MATCH_NAME) && if ((matchflags & E_REMEMBER_MATCH_NAME) &&
((!e_util_strcmp(bd->client.icccm.name, bd2->client.icccm.name)) || (e_util_glob_match(bd->client.icccm.name, cfdata->name)))
(e_util_both_str_empty(bd->client.icccm.name, bd2->client.icccm.name))))
matches++; matches++;
if ((matchflags & E_REMEMBER_MATCH_CLASS) && if ((matchflags & E_REMEMBER_MATCH_CLASS) &&
((!e_util_strcmp(bd->client.icccm.class, bd2->client.icccm.class)) || (e_util_glob_match(bd->client.icccm.class, cfdata->class)))
(e_util_both_str_empty(bd->client.icccm.class, bd2->client.icccm.class))))
matches++; matches++;
if ((matchflags & E_REMEMBER_MATCH_TITLE) && if ((matchflags & E_REMEMBER_MATCH_TITLE) &&
((!e_util_strcmp(title, title2)) || (e_util_glob_match(title, cfdata->title)))
(e_util_both_str_empty(title, title2)))) matches++;
matches++;
if ((matchflags & E_REMEMBER_MATCH_ROLE) && if ((matchflags & E_REMEMBER_MATCH_ROLE) &&
((!e_util_strcmp(bd->client.icccm.window_role, bd2->client.icccm.window_role)) || ((!e_util_strcmp(cfdata->role, bd->client.icccm.window_role)) ||
(e_util_both_str_empty(bd->client.icccm.window_role, bd2->client.icccm.window_role)))) (e_util_both_str_empty(cfdata->role, bd->client.icccm.window_role))))
matches++; matches++;
if ((matchflags & E_REMEMBER_MATCH_TYPE) && if ((matchflags & E_REMEMBER_MATCH_TYPE) &&
(bd->client.netwm.type == bd2->client.netwm.type)) (cfdata->border->client.netwm.type == bd->client.netwm.type))
matches++; matches++;
if ((matchflags & E_REMEMBER_MATCH_TRANSIENT) && if ((matchflags & E_REMEMBER_MATCH_TRANSIENT) &&
(((bd->client.icccm.transient_for) && (bd2->client.icccm.transient_for != 0)) || ((cfdata->remember.match_transient && bd->client.icccm.transient_for != 0) ||
((!bd->client.icccm.transient_for) && (bd2->client.icccm.transient_for == 0)))) (!cfdata->remember.match_transient && (bd->client.icccm.transient_for == 0))))
matches++; matches++;
if (matches >= required_matches) n++; if (matches >= required_matches) n++;
if (update)
{
bd->changed = 1;
bd->changes.icon = 1;
}
else if (n > 1) break;
} }
return n; return n;
} }
@ -286,11 +336,13 @@ _remember_update(E_Remember *rem, E_Config_Dialog_Data *cfdata)
if (rem->title) eina_stringshare_del(rem->title); if (rem->title) eina_stringshare_del(rem->title);
if (rem->role) eina_stringshare_del(rem->role); if (rem->role) eina_stringshare_del(rem->role);
if (rem->prop.command) eina_stringshare_del(rem->prop.command); if (rem->prop.command) eina_stringshare_del(rem->prop.command);
if (rem->prop.desktop_file) eina_stringshare_del(rem->prop.desktop_file);
rem->name = NULL; rem->name = NULL;
rem->class = NULL; rem->class = NULL;
rem->title = NULL; rem->title = NULL;
rem->role = NULL; rem->role = NULL;
rem->prop.command = NULL; rem->prop.command = NULL;
rem->prop.desktop_file = NULL;
if (cfdata->name && cfdata->name[0]) if (cfdata->name && cfdata->name[0])
rem->name = eina_stringshare_add(cfdata->name); rem->name = eina_stringshare_add(cfdata->name);
if (cfdata->class && cfdata->class[0]) if (cfdata->class && cfdata->class[0])
@ -301,6 +353,10 @@ _remember_update(E_Remember *rem, E_Config_Dialog_Data *cfdata)
rem->role = eina_stringshare_add(cfdata->role); rem->role = eina_stringshare_add(cfdata->role);
if (cfdata->command && cfdata->command[0]) if (cfdata->command && cfdata->command[0])
rem->prop.command = eina_stringshare_add(cfdata->command); rem->prop.command = eina_stringshare_add(cfdata->command);
if (cfdata->remember.apply_desktop_file && cfdata->desktop)
rem->prop.desktop_file = eina_stringshare_add(cfdata->desktop);
} }
static int static int
@ -324,14 +380,20 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
if (!cfdata->warned) if (!cfdata->warned)
{ {
int matches = 0; int matches = 0;
cfdata->remember.match_role = 1;
cfdata->remember.match_type = 1;
cfdata->remember.match_transient = 1;
if ((cfdata->border->client.icccm.name) && if ((cfdata->name) && (cfdata->class))
(cfdata->border->client.icccm.class) && {
(cfdata->border->client.icccm.name[0] != 0) && cfdata->remember.match_name = 1;
(cfdata->border->client.icccm.class[0] != 0)) cfdata->remember.match_class = 1;
matches = _check_matches(cfdata->border, E_REMEMBER_MATCH_NAME | E_REMEMBER_MATCH_CLASS | E_REMEMBER_MATCH_ROLE | E_REMEMBER_MATCH_TYPE | E_REMEMBER_MATCH_TRANSIENT); }
else else
matches = _check_matches(cfdata->border, E_REMEMBER_MATCH_TITLE | E_REMEMBER_MATCH_ROLE | E_REMEMBER_MATCH_TYPE | E_REMEMBER_MATCH_TRANSIENT); cfdata->remember.match_title = 1;
matches = _check_matches(cfdata, 0);
if (matches > 1) if (matches > 1)
{ {
E_Dialog *dia; E_Dialog *dia;
@ -388,9 +450,9 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
E_REMEMBER_APPLY_SKIP_WINLIST | E_REMEMBER_APPLY_SKIP_PAGER | E_REMEMBER_APPLY_SKIP_TASKBAR | E_REMEMBER_APPLY_SKIP_WINLIST | E_REMEMBER_APPLY_SKIP_PAGER | E_REMEMBER_APPLY_SKIP_TASKBAR |
E_REMEMBER_APPLY_FULLSCREEN | E_REMEMBER_APPLY_ICON_PREF; E_REMEMBER_APPLY_FULLSCREEN | E_REMEMBER_APPLY_ICON_PREF;
rem->apply_first_only = 0; rem->apply_first_only = 0;
cfdata->remember.apply_desktop_file = 0;
_remember_update(rem, cfdata); _remember_update(rem, cfdata);
_check_matches(cfdata, 1);
e_remember_update(rem, cfdata->border); e_remember_update(rem, cfdata->border);
} }
@ -414,7 +476,8 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
(cfdata->remember.apply_zone) || (cfdata->remember.apply_skip_winlist) || (cfdata->remember.apply_zone) || (cfdata->remember.apply_skip_winlist) ||
(cfdata->remember.apply_skip_pager) || (cfdata->remember.apply_skip_taskbar) || (cfdata->remember.apply_skip_pager) || (cfdata->remember.apply_skip_taskbar) ||
(cfdata->remember.apply_run) || (cfdata->remember.apply_icon_pref) || (cfdata->remember.apply_run) || (cfdata->remember.apply_icon_pref) ||
(cfdata->remember.set_focus_on_start) || (cfdata->remember.apply_fullscreen))) (cfdata->remember.set_focus_on_start) || (cfdata->remember.apply_fullscreen) ||
(cfdata->remember.apply_desktop_file)))
{ {
if (rem) if (rem)
{ {
@ -426,9 +489,6 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
return 1; return 1;
} }
if (cfdata->remember.match_name) cfdata->remember.match_class = 1;
else cfdata->remember.match_class = 0;
if (!((cfdata->remember.match_name) || (cfdata->remember.match_class) || if (!((cfdata->remember.match_name) || (cfdata->remember.match_class) ||
(cfdata->remember.match_title) || (cfdata->remember.match_role) || (cfdata->remember.match_title) || (cfdata->remember.match_role) ||
(cfdata->remember.match_type) || (cfdata->remember.match_transient))) (cfdata->remember.match_type) || (cfdata->remember.match_transient)))
@ -452,16 +512,8 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
} }
if (!cfdata->warned) if (!cfdata->warned)
{ {
int matchflags = 0;
if (cfdata->remember.match_name) matchflags |= E_REMEMBER_MATCH_NAME;
if (cfdata->remember.match_class) matchflags |= E_REMEMBER_MATCH_CLASS;
if (cfdata->remember.match_title) matchflags |= E_REMEMBER_MATCH_TITLE;
if (cfdata->remember.match_role) matchflags |= E_REMEMBER_MATCH_ROLE;
if (cfdata->remember.match_type) matchflags |= E_REMEMBER_MATCH_TYPE;
if (cfdata->remember.match_transient) matchflags |= E_REMEMBER_MATCH_TRANSIENT;
if ((!cfdata->remember.apply_first_only) && if ((!cfdata->remember.apply_first_only) &&
(_check_matches(cfdata->border, matchflags) > 1)) (_check_matches(cfdata, 0) > 1))
{ {
E_Dialog *dia; E_Dialog *dia;
@ -503,7 +555,7 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
} }
if (rem) if (rem)
{ {
rem->apply = 0; rem->apply = 0;
rem->match = 0; rem->match = 0;
rem->apply_first_only = cfdata->remember.apply_first_only; rem->apply_first_only = cfdata->remember.apply_first_only;
@ -532,7 +584,7 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
_remember_update(rem, cfdata); _remember_update(rem, cfdata);
cfdata->border->remember = rem; cfdata->border->remember = rem;
_check_matches(cfdata, 1);
rem->keep_settings = 0; rem->keep_settings = 0;
e_remember_update(rem, cfdata->border); e_remember_update(rem, cfdata->border);
rem->keep_settings = cfdata->remember.keep_settings; rem->keep_settings = cfdata->remember.keep_settings;
@ -579,7 +631,6 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
ob = e_widget_check_add(evas, _("Window name"), &(cfdata->remember.match_name)); ob = e_widget_check_add(evas, _("Window name"), &(cfdata->remember.match_name));
e_widget_framelist_object_append(of, ob); e_widget_framelist_object_append(of, ob);
ob = e_widget_entry_add(evas, &cfdata->name, NULL, NULL, NULL); ob = e_widget_entry_add(evas, &cfdata->name, NULL, NULL, NULL);
e_widget_entry_readonly_set(ob, 1);
e_widget_framelist_object_append(of, ob); e_widget_framelist_object_append(of, ob);
} }
else else
@ -591,7 +642,6 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
ob = e_widget_check_add(evas, _("Window class"), &(cfdata->remember.match_class)); ob = e_widget_check_add(evas, _("Window class"), &(cfdata->remember.match_class));
e_widget_framelist_object_append(of, ob); e_widget_framelist_object_append(of, ob);
ob = e_widget_entry_add(evas, &cfdata->class, NULL, NULL, NULL); ob = e_widget_entry_add(evas, &cfdata->class, NULL, NULL, NULL);
e_widget_entry_readonly_set(ob, 1);
e_widget_framelist_object_append(of, ob); e_widget_framelist_object_append(of, ob);
} }
else else
@ -603,7 +653,6 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
ob = e_widget_check_add(evas, _("Title"), &(cfdata->remember.match_title)); ob = e_widget_check_add(evas, _("Title"), &(cfdata->remember.match_title));
e_widget_framelist_object_append(of, ob); e_widget_framelist_object_append(of, ob);
ob = e_widget_entry_add(evas, &cfdata->title, NULL, NULL, NULL); ob = e_widget_entry_add(evas, &cfdata->title, NULL, NULL, NULL);
e_widget_entry_readonly_set(ob, 1);
e_widget_framelist_object_append(of, ob); e_widget_framelist_object_append(of, ob);
} }
else else
@ -615,7 +664,6 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
ob = e_widget_check_add(evas, _("Window Role"), &(cfdata->remember.match_role)); ob = e_widget_check_add(evas, _("Window Role"), &(cfdata->remember.match_role));
e_widget_framelist_object_append(of, ob); e_widget_framelist_object_append(of, ob);
ob = e_widget_entry_add(evas, &cfdata->role, NULL, NULL, NULL); ob = e_widget_entry_add(evas, &cfdata->role, NULL, NULL, NULL);
e_widget_entry_readonly_set(ob, 1);
e_widget_framelist_object_append(of, ob); e_widget_framelist_object_append(of, ob);
} }
else else
@ -664,22 +712,28 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
e_widget_frametable_object_append(of, ob, 1, 5, 1, 1, 1, 1, 1, 1); e_widget_frametable_object_append(of, ob, 1, 5, 1, 1, 1, 1, 1, 1);
ob = e_widget_check_add(evas, _("Skip Taskbar"), &(cfdata->remember.apply_skip_taskbar)); ob = e_widget_check_add(evas, _("Skip Taskbar"), &(cfdata->remember.apply_skip_taskbar));
e_widget_frametable_object_append(of, ob, 1, 6, 1, 1, 1, 1, 1, 1); e_widget_frametable_object_append(of, ob, 1, 6, 1, 1, 1, 1, 1, 1);
e_widget_table_object_append(o, of, 1, 0, 1, 1, 1, 1, 1, 1); ob = e_widget_check_add(evas, _("Application file or name (.desktop)"), &(cfdata->remember.apply_desktop_file));
e_widget_frametable_object_append(of, ob, 0, 7, 2, 1, 1, 1, 1, 1);
ob = e_widget_entry_add(evas, &cfdata->desktop, NULL, NULL, NULL);
e_widget_frametable_object_append(of, ob, 0, 8, 2, 1, 1, 1, 1, 1);
e_widget_table_object_append(o, of, 1, 0, 1, 2, 1, 1, 1, 1);
of = e_widget_frametable_add(evas, _("Options"), 0);
ob = e_widget_check_add(evas, _("Match only one window"), &(cfdata->remember.apply_first_only)); ob = e_widget_check_add(evas, _("Match only one window"), &(cfdata->remember.apply_first_only));
e_widget_table_object_append(o, ob, 0, 1, 1, 1, 1, 1, 1, 1); e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 1, 1);
ob = e_widget_check_add(evas, _("Always focus on start"), &(cfdata->remember.set_focus_on_start)); ob = e_widget_check_add(evas, _("Always focus on start"), &(cfdata->remember.set_focus_on_start));
e_widget_table_object_append(o, ob, 1, 1, 1, 1, 1, 1, 1, 1); e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 1, 1, 1);
ob = e_widget_check_add(evas, _("Keep current properties"), &(cfdata->remember.keep_settings)); ob = e_widget_check_add(evas, _("Keep current properties"), &(cfdata->remember.keep_settings));
e_widget_table_object_append(o, ob, 1, 2, 1, 1, 1, 1, 1, 1); e_widget_frametable_object_append(of, ob, 0, 2, 1, 1, 1, 1, 1, 1);
if (cfdata->command) if (cfdata->command)
{ {
ob = e_widget_check_add(evas, _("Start this program on login"), &(cfdata->remember.apply_run)); ob = e_widget_check_add(evas, _("Start this program on login"), &(cfdata->remember.apply_run));
e_widget_table_object_append(o, ob, 1, 3, 1, 1, 1, 1, 1, 1); e_widget_frametable_object_append(of, ob, 0, 3, 1, 1, 1, 1, 1, 1);
} }
e_widget_table_object_append(o, of, 0, 1, 1, 1, 1, 1, 1, 1);
return o; return o;
} }

View File

@ -93,7 +93,8 @@ e_remember_use(E_Remember *rem)
EAPI void EAPI void
e_remember_unuse(E_Remember *rem) e_remember_unuse(E_Remember *rem)
{ {
rem->used_count--; if (rem->used_count > 0)
rem->used_count--;
if ((rem->used_count == 0) && (rem->delete_me)) if ((rem->used_count == 0) && (rem->delete_me))
_e_remember_free(rem); _e_remember_free(rem);
} }
@ -118,7 +119,6 @@ e_remember_del(E_Remember *rem)
} }
return; return;
} }
_e_remember_free(rem);
} }
EAPI E_Remember * EAPI E_Remember *
@ -366,16 +366,13 @@ _e_remember_find(E_Border *bd, int check_usable)
* required, and if it is, check whether there's a match. If * required, and if it is, check whether there's a match. If
* it fails, then go to the next remember */ * it fails, then go to the next remember */
if (rem->match & E_REMEMBER_MATCH_NAME && if (rem->match & E_REMEMBER_MATCH_NAME &&
e_util_strcmp(rem->name, bd->client.icccm.name) && !e_util_glob_match(bd->client.icccm.name, rem->name))
!e_util_both_str_empty(rem->name, bd->client.icccm.name))
continue; continue;
if (rem->match & E_REMEMBER_MATCH_CLASS && if (rem->match & E_REMEMBER_MATCH_CLASS &&
e_util_strcmp(rem->class, bd->client.icccm.class) && !e_util_glob_match(bd->client.icccm.class, rem->class))
!e_util_both_str_empty(rem->class, bd->client.icccm.class))
continue; continue;
if (rem->match & E_REMEMBER_MATCH_TITLE && if (rem->match & E_REMEMBER_MATCH_TITLE &&
e_util_strcmp(rem->title, title) && !e_util_glob_match(title, rem->title))
!e_util_both_str_empty(rem->title, title))
continue; continue;
if (rem->match & E_REMEMBER_MATCH_ROLE && if (rem->match & E_REMEMBER_MATCH_ROLE &&
e_util_strcmp(rem->role, bd->client.icccm.window_role) && e_util_strcmp(rem->role, bd->client.icccm.window_role) &&