forked from enlightenment/enlightenment
parent
5c5ae983d7
commit
9d1a7da7e9
|
@ -516,7 +516,7 @@ e_app_change_callback_del(void (*func) (void *data, E_App *a, E_App_Change ch),
|
||||||
}
|
}
|
||||||
|
|
||||||
E_App *
|
E_App *
|
||||||
e_app_window_name_class_title_find(char *name, char *class, char *title)
|
e_app_window_name_class_title_role_find(char *name, char *class, char *title, char *role)
|
||||||
{
|
{
|
||||||
Evas_List *l;
|
Evas_List *l;
|
||||||
|
|
||||||
|
@ -530,19 +530,22 @@ e_app_window_name_class_title_find(char *name, char *class, char *title)
|
||||||
|
|
||||||
a = l->data;
|
a = l->data;
|
||||||
ok = 0;
|
ok = 0;
|
||||||
if ((a->win_name) || (a->win_class) || (a->win_title))
|
if ((a->win_name) || (a->win_class) || (a->win_title) || (a->win_role))
|
||||||
{
|
{
|
||||||
if ((!a->win_name) ||
|
if ((!a->win_name) ||
|
||||||
((a->win_name) && (name) && (!strcmp(a->win_name, name))))
|
((a->win_name) && (name) && (e_util_glob_match(name, a->win_name))))
|
||||||
ok++;
|
ok++;
|
||||||
if ((!a->win_class) ||
|
if ((!a->win_class) ||
|
||||||
((a->win_class) && (class) && (!strcmp(a->win_class, class))))
|
((a->win_class) && (class) && (e_util_glob_match(class, a->win_class))))
|
||||||
ok++;
|
ok++;
|
||||||
if ((!a->win_title) ||
|
if ((!a->win_title) ||
|
||||||
((a->win_title) && (title) && (e_util_glob_match(title, a->win_title))))
|
((a->win_title) && (title) && (e_util_glob_match(title, a->win_title))))
|
||||||
ok++;
|
ok++;
|
||||||
|
if ((!a->win_role) ||
|
||||||
|
((a->win_role) && (role) && (e_util_glob_match(role, a->win_role))))
|
||||||
|
ok++;
|
||||||
}
|
}
|
||||||
if (ok >= 3)
|
if (ok >= 4)
|
||||||
{
|
{
|
||||||
_e_apps_list = evas_list_remove_list(_e_apps_list, l);
|
_e_apps_list = evas_list_remove_list(_e_apps_list, l);
|
||||||
_e_apps_list = evas_list_prepend(_e_apps_list, a);
|
_e_apps_list = evas_list_prepend(_e_apps_list, a);
|
||||||
|
@ -831,6 +834,15 @@ _e_app_fields_fill(E_App *a, const char *path)
|
||||||
a->win_title = str;
|
a->win_title = str;
|
||||||
free(v);
|
free(v);
|
||||||
}
|
}
|
||||||
|
v = eet_read(ef, "app/window/role", &size);
|
||||||
|
if (v)
|
||||||
|
{
|
||||||
|
str = malloc(size + 1);
|
||||||
|
memcpy(str, v, size);
|
||||||
|
str[size] = 0;
|
||||||
|
a->win_role = str;
|
||||||
|
free(v);
|
||||||
|
}
|
||||||
v = eet_read(ef, "app/info/startup_notify", &size);
|
v = eet_read(ef, "app/info/startup_notify", &size);
|
||||||
if (v)
|
if (v)
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,6 +38,7 @@ struct _E_App
|
||||||
char *win_name; /* window name */
|
char *win_name; /* window name */
|
||||||
char *win_class; /* window class */
|
char *win_class; /* window class */
|
||||||
char *win_title; /* window title */
|
char *win_title; /* window title */
|
||||||
|
char *win_role; /* window role */
|
||||||
|
|
||||||
Evas_List *subapps; /* if this a directory, a list of more E_App's */
|
Evas_List *subapps; /* if this a directory, a list of more E_App's */
|
||||||
|
|
||||||
|
@ -75,7 +76,7 @@ EAPI void e_app_remove(E_App *remove);
|
||||||
EAPI void e_app_change_callback_add(void (*func) (void *data, E_App *a, E_App_Change ch), void *data);
|
EAPI void e_app_change_callback_add(void (*func) (void *data, E_App *a, E_App_Change ch), void *data);
|
||||||
EAPI void e_app_change_callback_del(void (*func) (void *data, E_App *a, E_App_Change ch), void *data);
|
EAPI void e_app_change_callback_del(void (*func) (void *data, E_App *a, E_App_Change ch), void *data);
|
||||||
|
|
||||||
EAPI E_App *e_app_window_name_class_title_find(char *name, char *class, char *title);
|
EAPI E_App *e_app_window_name_class_title_role_find(char *name, char *class, char *title, char *role);
|
||||||
EAPI E_App *e_app_file_find(char *file);
|
EAPI E_App *e_app_file_find(char *file);
|
||||||
EAPI E_App *e_app_name_find(char *name);
|
EAPI E_App *e_app_name_find(char *name);
|
||||||
EAPI E_App *e_app_generic_find(char *generic);
|
EAPI E_App *e_app_generic_find(char *generic);
|
||||||
|
|
|
@ -1723,9 +1723,10 @@ e_border_icon_add(E_Border *bd, Evas *evas)
|
||||||
|
|
||||||
if (bd->client.netwm.name) title = bd->client.netwm.name;
|
if (bd->client.netwm.name) title = bd->client.netwm.name;
|
||||||
else title = bd->client.icccm.title;
|
else title = bd->client.icccm.title;
|
||||||
a = e_app_window_name_class_title_find(bd->client.icccm.name,
|
a = e_app_window_name_class_title_role_find(bd->client.icccm.name,
|
||||||
bd->client.icccm.class,
|
bd->client.icccm.class,
|
||||||
title);
|
title,
|
||||||
|
bd->client.icccm.window_role);
|
||||||
if (a)
|
if (a)
|
||||||
{
|
{
|
||||||
o = edje_object_add(evas);
|
o = edje_object_add(evas);
|
||||||
|
@ -4901,9 +4902,10 @@ _e_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key)
|
||||||
else title = bd->client.icccm.title;
|
else title = bd->client.icccm.title;
|
||||||
mi = e_menu_item_new(m);
|
mi = e_menu_item_new(m);
|
||||||
e_menu_item_separator_set(mi, 1);
|
e_menu_item_separator_set(mi, 1);
|
||||||
a = e_app_window_name_class_title_find(bd->client.icccm.name,
|
a = e_app_window_name_class_title_role_find(bd->client.icccm.name,
|
||||||
bd->client.icccm.class,
|
bd->client.icccm.class,
|
||||||
title);
|
title,
|
||||||
|
bd->client.icccm.window_role);
|
||||||
if (a)
|
if (a)
|
||||||
{
|
{
|
||||||
mi = e_menu_item_new(m);
|
mi = e_menu_item_new(m);
|
||||||
|
|
|
@ -24,6 +24,7 @@ main(int argc, char **argv)
|
||||||
int del_win_name = 0;
|
int del_win_name = 0;
|
||||||
int del_win_class = 0;
|
int del_win_class = 0;
|
||||||
int del_win_title = 0;
|
int del_win_title = 0;
|
||||||
|
int del_win_role = 0;
|
||||||
int del_startup_notify = 0;
|
int del_startup_notify = 0;
|
||||||
int del_wait_exit = 0;
|
int del_wait_exit = 0;
|
||||||
char *file = NULL;
|
char *file = NULL;
|
||||||
|
@ -34,6 +35,7 @@ main(int argc, char **argv)
|
||||||
char *set_win_name = NULL;
|
char *set_win_name = NULL;
|
||||||
char *set_win_class = NULL;
|
char *set_win_class = NULL;
|
||||||
char *set_win_title = NULL;
|
char *set_win_title = NULL;
|
||||||
|
char *set_win_role = NULL;
|
||||||
int set_startup_notify = -1;
|
int set_startup_notify = -1;
|
||||||
int set_wait_exit = -1;
|
int set_wait_exit = -1;
|
||||||
|
|
||||||
|
@ -88,6 +90,12 @@ main(int argc, char **argv)
|
||||||
set_win_title = argv[i];
|
set_win_title = argv[i];
|
||||||
valid_args++;
|
valid_args++;
|
||||||
}
|
}
|
||||||
|
else if ((!strcmp(argv[i], "-set-win-role")) && (i < (argc - 1)))
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
set_win_role = argv[i];
|
||||||
|
valid_args++;
|
||||||
|
}
|
||||||
else if ((!strcmp(argv[i], "-set-startup-notify")) && (i < (argc - 1)))
|
else if ((!strcmp(argv[i], "-set-startup-notify")) && (i < (argc - 1)))
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
|
@ -109,6 +117,7 @@ main(int argc, char **argv)
|
||||||
del_win_name = 1;
|
del_win_name = 1;
|
||||||
del_win_class = 1;
|
del_win_class = 1;
|
||||||
del_win_title = 1;
|
del_win_title = 1;
|
||||||
|
del_win_role = 1;
|
||||||
del_startup_notify = 1;
|
del_startup_notify = 1;
|
||||||
del_wait_exit = 1;
|
del_wait_exit = 1;
|
||||||
valid_args++;
|
valid_args++;
|
||||||
|
@ -148,6 +157,11 @@ main(int argc, char **argv)
|
||||||
del_win_title = 1;
|
del_win_title = 1;
|
||||||
valid_args++;
|
valid_args++;
|
||||||
}
|
}
|
||||||
|
else if ((!strcmp(argv[i], "-del-win-role")))
|
||||||
|
{
|
||||||
|
del_win_role = 1;
|
||||||
|
valid_args++;
|
||||||
|
}
|
||||||
else if ((!strcmp(argv[i], "-del-startup-notify")))
|
else if ((!strcmp(argv[i], "-del-startup-notify")))
|
||||||
{
|
{
|
||||||
del_startup_notify = 1;
|
del_startup_notify = 1;
|
||||||
|
@ -215,6 +229,8 @@ main(int argc, char **argv)
|
||||||
eet_write(ef, "app/window/class", set_win_class, strlen(set_win_class), 0);
|
eet_write(ef, "app/window/class", set_win_class, strlen(set_win_class), 0);
|
||||||
if (set_win_title)
|
if (set_win_title)
|
||||||
eet_write(ef, "app/window/title", set_win_title, strlen(set_win_title), 0);
|
eet_write(ef, "app/window/title", set_win_title, strlen(set_win_title), 0);
|
||||||
|
if (set_win_role)
|
||||||
|
eet_write(ef, "app/window/role", set_win_role, strlen(set_win_role), 0);
|
||||||
if (set_startup_notify >= 0)
|
if (set_startup_notify >= 0)
|
||||||
{
|
{
|
||||||
unsigned char tmp[1];
|
unsigned char tmp[1];
|
||||||
|
@ -279,6 +295,8 @@ main(int argc, char **argv)
|
||||||
eet_delete(ef, "app/window/class");
|
eet_delete(ef, "app/window/class");
|
||||||
if (del_win_title)
|
if (del_win_title)
|
||||||
eet_delete(ef, "app/window/title");
|
eet_delete(ef, "app/window/title");
|
||||||
|
if (del_win_role)
|
||||||
|
eet_delete(ef, "app/window/role");
|
||||||
if (del_startup_notify)
|
if (del_startup_notify)
|
||||||
eet_delete(ef, "app/info/startup_notify");
|
eet_delete(ef, "app/info/startup_notify");
|
||||||
if (del_wait_exit)
|
if (del_wait_exit)
|
||||||
|
@ -299,9 +317,10 @@ _e_help(void)
|
||||||
" -set-generic GENERIC Set the application generic name\n"
|
" -set-generic GENERIC Set the application generic name\n"
|
||||||
" -set-comment COMMENT Set the application comment\n"
|
" -set-comment COMMENT Set the application comment\n"
|
||||||
" -set-exe EXE Set the application execute line\n"
|
" -set-exe EXE Set the application execute line\n"
|
||||||
" -set-win-name WIN_NAME Set the application window name\n"
|
" -set-win-name WIN_NAME Set the application window name glob\n"
|
||||||
" -set-win-class WIN_CLASS Set the application window class\n"
|
" -set-win-class WIN_CLASS Set the application window class glob\n"
|
||||||
" -set-win-title WIN_TITLE Set the application window title glob\n"
|
" -set-win-title WIN_TITLE Set the application window title glob\n"
|
||||||
|
" -set-win-role WIN_ROLE Set the application window role glob\n"
|
||||||
" -set-startup-notify [1/0] Set the application startup notify flag\n"
|
" -set-startup-notify [1/0] Set the application startup notify flag\n"
|
||||||
" -set-wait-exit [1/0] Set the application wait exit flag\n"
|
" -set-wait-exit [1/0] Set the application wait exit flag\n"
|
||||||
" -del-name Delete the application name\n"
|
" -del-name Delete the application name\n"
|
||||||
|
@ -311,6 +330,7 @@ _e_help(void)
|
||||||
" -del-win-name Delete the application window name\n"
|
" -del-win-name Delete the application window name\n"
|
||||||
" -del-win-class Delete the application window class\n"
|
" -del-win-class Delete the application window class\n"
|
||||||
" -del-win-title Delete the application window title glob\n"
|
" -del-win-title Delete the application window title glob\n"
|
||||||
|
" -del-win-role Delete the application window role glob\n"
|
||||||
" -del-startup-notify Delete the application startup notify flag\n"
|
" -del-startup-notify Delete the application startup notify flag\n"
|
||||||
" -del-wait-exit Delete the application wait exit flag\n"
|
" -del-wait-exit Delete the application wait exit flag\n"
|
||||||
);
|
);
|
||||||
|
|
|
@ -570,9 +570,10 @@ _e_int_menus_clients_pre_cb(void *data, E_Menu *m)
|
||||||
e_object_breadcrumb_add(E_OBJECT(bd), "clients_menu");
|
e_object_breadcrumb_add(E_OBJECT(bd), "clients_menu");
|
||||||
e_menu_item_callback_set(mi, _e_int_menus_clients_item_cb, bd);
|
e_menu_item_callback_set(mi, _e_int_menus_clients_item_cb, bd);
|
||||||
if (!bd->iconic) e_menu_item_toggle_set(mi, 1);
|
if (!bd->iconic) e_menu_item_toggle_set(mi, 1);
|
||||||
a = e_app_window_name_class_title_find(bd->client.icccm.name,
|
a = e_app_window_name_class_title_role_find(bd->client.icccm.name,
|
||||||
bd->client.icccm.class,
|
bd->client.icccm.class,
|
||||||
title);
|
title,
|
||||||
|
bd->client.icccm.window_role);
|
||||||
if (a) e_menu_item_icon_edje_set(mi, a->path, "icon");
|
if (a) e_menu_item_icon_edje_set(mi, a->path, "icon");
|
||||||
}
|
}
|
||||||
mi = e_menu_item_new(m);
|
mi = e_menu_item_new(m);
|
||||||
|
@ -826,9 +827,10 @@ _e_int_menus_lost_clients_pre_cb(void *data, E_Menu *m)
|
||||||
e_object_ref(E_OBJECT(bd));
|
e_object_ref(E_OBJECT(bd));
|
||||||
e_object_breadcrumb_add(E_OBJECT(bd), "lost_clients_menu");
|
e_object_breadcrumb_add(E_OBJECT(bd), "lost_clients_menu");
|
||||||
e_menu_item_callback_set(mi, _e_int_menus_lost_clients_item_cb, bd);
|
e_menu_item_callback_set(mi, _e_int_menus_lost_clients_item_cb, bd);
|
||||||
a = e_app_window_name_class_title_find(bd->client.icccm.name,
|
a = e_app_window_name_class_title_role_find(bd->client.icccm.name,
|
||||||
bd->client.icccm.class,
|
bd->client.icccm.class,
|
||||||
title);
|
title,
|
||||||
|
bd->client.icccm.window_role);
|
||||||
if (a) e_menu_item_icon_edje_set(mi, a->path, "icon");
|
if (a) e_menu_item_icon_edje_set(mi, a->path, "icon");
|
||||||
}
|
}
|
||||||
e_object_free_attach_func_set(E_OBJECT(m), _e_int_menus_lost_clients_free_hook);
|
e_object_free_attach_func_set(E_OBJECT(m), _e_int_menus_lost_clients_free_hook);
|
||||||
|
|
Loading…
Reference in New Issue