Compare commits

...

48 Commits

Author SHA1 Message Date
Carsten Haitzler 27dcd2d755 release 0.24.2 2 years ago
Carsten Haitzler 59dba6192a exit codes - clean up and handle consistently 2 years ago
Marcel Hollerbach caaff77b42 e_shelf: only reset autohide timer if we are not hidden 2 years ago
Marcel Hollerbach d42adad715 tiling: prevent potential recursive apply calls 2 years ago
Marcel Hollerbach 6a3648a5fd Revert "tiling - avoid infinite loop of not fit - toggle float, not fit, toggle" 2 years ago
Carsten Haitzler d311403947 e polkit - fix password to de-escape to utf8 2 years ago
Carsten Haitzler b45d7b9ba3 e askpass - convert text to plain utf8 proeprly for passwd output 2 years ago
Carsten Haitzler 5242f90ea1 e system - isolate stdio of commands we run so they dont pollute 2 years ago
Carsten Haitzler 5d69d2be2e e start - handle exit code for restart AND exit choices because of lib 2 years ago
Alastair Poole 1e3fcd263e cpufreq: FreeBSD et al. 2 years ago
Alastair Poole 782c09bf7f battery: OpenBSD use proper constants. 2 years ago
Carsten Haitzler 3068e261e0 shot - dont allow image in virtual cnavs to resize 2 years ago
Carsten Haitzler 74ba5e1604 e exec - if an invalid exe is found - null it out 2 years ago
Carsten Haitzler 84d7e796a2 comp wl - blanking fix saver timeout if 0 - dont set it as its off at 0 2 years ago
Christopher Michael 099d42c02f e_comp_wl: Fix possible typo with function name 2 years ago
Carsten Haitzler 3b377bac00 only call notidle if wl compiled in and wl on... 2 years ago
Carsten Haitzler 9cfdc04f12 e comp x - ensure animator works before fading in backlight 2 years ago
Carsten Haitzler a0d4d2cf0a e wl screen dimming.blanking/timeouts/lock handling redo/fixup 2 years ago
Carsten Haitzler f1fe06edbb e init - stop listening to zone changes once init has been hidden 2 years ago
Carsten Haitzler 84bf7fc2fa fix preload of e icon when already loaded to show new icon 2 years ago
Carsten Haitzler d100938c07 e xsettings - do not use long for 32bit types... it's WRONG 2 years ago
Carsten Haitzler 70a70658cd fix null edid more - found hole missed in last fix 2 years ago
Carsten Haitzler 26309766b5 e - increase timeout for efreetd responding to 20 sec 2 years ago
Carsten Haitzler ddefdc1c45 init - handle zone changes during startup/init 2 years ago
Carsten Haitzler 653a456a02 pager+thumb - speed up thumb generation and pager aspect 2 years ago
q66 a175903a21 meson: fix fnmatch dependency lookup 2 years ago
q66 fde49a2f6b try linking against execinfo when execinfo.h is present 2 years ago
q66 3bd64d19a2 e_util_suid: need signal.h on some libcs 2 years ago
Carsten Haitzler 29c736e327 debug printf-- 2 years ago
Carsten Haitzler d17d6151d5 e backlight - fix initial restore of backlight after previous fix 2 years ago
Carsten Haitzler 29ade56c20 e backlight - handle screens with no edid 2 years ago
Carsten Haitzler e898224672 exec - dont run null exec commands 2 years ago
Carsten Haitzler 9efb53b80d release 0.24.1 2 years ago
Carsten Haitzler 2d811cc994 e sys - also force e to exit on halt or reboot after a timeout. 2 years ago
Carsten Haitzler adb376b23b Revert "po - update nl.po" 2 years ago
Carsten Haitzler e86c457f97 suspend/hibernate - add a small delay before doing the deed 2 years ago
Carsten Haitzler 3a5c671ddd po - update nl.po 2 years ago
Carsten Haitzler 3326b7e579 sys - fix non-systemd code patch for suspend/resume handling/tracking 2 years ago
Carsten Haitzler 3cdcc10c18 e randr x - move pointer to a visible screen coord if outside screens 2 years ago
Carsten Haitzler 3dfead6653 e ckpasse - also back out another change i made to fix up pk 2 years ago
Carsten Haitzler 9fc2b13c69 back out undo of pk fix - back to bu5hm4ns version 2 years ago
Carsten Haitzler 68dc80f25a polkit - fix user id we're authing to and be explicit which one it is 2 years ago
Carsten Haitzler 8a641727da e auth - fix missing stderr output logs i missed last commit 2 years ago
Marcel Hollerbach 67bdd4d071 e_ckpasswd_main: fix polkit to auth root 2 years ago
Carsten Haitzler 4fd99de9fa e auth - nicely prefix logs and clean up error reports and report more 2 years ago
Carsten Haitzler 964fa5c921 e polkit - improve ui to disable widgets while doing auth plus padding 2 years ago
Carsten Haitzler 61ebfffcd6 e wl - fix frame req timestamp to be the same as others 2 years ago
Carsten Haitzler 7c7527da2b xkb - optimize handling of keymaps to only change them a few times 2 years ago
  1. 9
      meson.build
  2. 10
      src/bin/e_askpass_main.c
  3. 58
      src/bin/e_backlight.c
  4. 98
      src/bin/e_ckpasswd_main.c
  5. 2
      src/bin/e_client.c
  6. 19
      src/bin/e_comp.c
  7. 41
      src/bin/e_comp_canvas.c
  8. 1
      src/bin/e_comp_canvas.h
  9. 162
      src/bin/e_comp_wl.c
  10. 6
      src/bin/e_comp_wl.h
  11. 18
      src/bin/e_comp_x.c
  12. 18
      src/bin/e_comp_x_randr.c
  13. 12
      src/bin/e_exec.c
  14. 2
      src/bin/e_hints.c
  15. 9
      src/bin/e_icon.c
  16. 176
      src/bin/e_init.c
  17. 2
      src/bin/e_ipc.c
  18. 139
      src/bin/e_main.c
  19. 2
      src/bin/e_pixmap.c
  20. 79
      src/bin/e_screensaver.c
  21. 1
      src/bin/e_screensaver.h
  22. 2
      src/bin/e_shelf.c
  23. 29
      src/bin/e_start_main.c
  24. 2
      src/bin/e_startup.c
  25. 162
      src/bin/e_sys.c
  26. 37
      src/bin/e_thumb_main.c
  27. 1
      src/bin/e_util_suid.h
  28. 39
      src/bin/e_xkb.c
  29. 2
      src/bin/e_xsettings.c
  30. 2
      src/bin/meson.build
  31. 2
      src/bin/system/e_system.h
  32. 4
      src/bin/system/e_system_backlight.c
  33. 13
      src/bin/system/e_system_main.c
  34. 8
      src/bin/system/e_system_power.c
  35. 6
      src/bin/system/e_system_storage.c
  36. 35
      src/modules/battery/e_mod_sysctl.c
  37. 24
      src/modules/cpufreq/e_mod_main.c
  38. 33
      src/modules/pager/e_mod_main.c
  39. 71
      src/modules/polkit/auth_ui.c
  40. 2
      src/modules/shot/e_mod_edit.c
  41. 31
      src/modules/tiling/e_mod_tiling.c
  42. 10
      src/modules/tiling/window_tree.c
  43. 1
      src/modules/vkbd/e_kbd_int.c

@ -1,6 +1,6 @@
##### project
project('enlightenment', 'c',
version : '0.24.0',
version : '0.24.2',
license : 'BSD 2 clause',
default_options: [ 'buildtype=release', 'c_std=gnu99', 'warning_level=2' ],
meson_version : '>= 0.47.0')
@ -184,6 +184,9 @@ if cc.has_header('netinet/in.h') == true
endif
if cc.has_header('execinfo.h') == true
config_h.set('HAVE_EXECINFO_H' , '1')
dep_execinfo = cc.find_library('execinfo', required: false)
else
dep_execinfo = dependency('', required: false)
endif
if cc.has_function('explicit_bzero') == true
config_h.set('HAVE_EXPLICIT_BZERO' , '1')
@ -202,9 +205,7 @@ if cc.has_header('fnmatch.h') == false
error('fnmatch.h not found')
endif
if cc.has_function('fnmatch') == false
dep_fnmatch = dependency('fnmatch', required: true)
endif
dep_fnmatch = cc.find_library('fnmatch', required: false)
add_global_arguments('-DPACKAGE_BIN_DIR="@0@"'.format(dir_bin), language: 'c')
add_global_arguments('-DPACKAGE_LIB_DIR="@0@"'.format(dir_lib), language: 'c')

@ -18,7 +18,15 @@ static void
password_out(void)
{
const char *str = elm_object_text_get(entry);
if (str) printf("%s\n", str);
if (str)
{
char *plain = elm_entry_markup_to_utf8(str);
if (plain)
{
printf("%s\n", plain);
free(plain);
}
}
}
static void

@ -45,7 +45,7 @@ _backlight_mismatch_retry(Backlight_Device *bd)
// and the delta between expected and val >= 0.05
(fabs(bd->expected_val - bd->val) >= 0.05) &&
// and we retried < 20 times
(bd->retries < 20))
(bd->retries < 10))
{ // try again
printf("RETRY backlight set as %1.2f != %1.2f (expected) try=%i\n",
bd->val, bd->expected_val, bd->retries);
@ -127,10 +127,11 @@ _backlight_devices_zone_device_find(E_Zone *zone)
Eina_List *l;
Backlight_Device *bd;
char *tmp, *sep;
const char *out, *edid;
const char *out, *edid, *id;
if (!zone->randr2_id) return NULL;
tmp = strdup(zone->randr2_id);
id = zone->randr2_id;
if (!id) id = "/";
tmp = strdup(id);
if (!tmp) return NULL;
sep = strchr(tmp, '/');
if (!sep)
@ -222,8 +223,8 @@ _backlight_devices_randr_output_get(Ecore_X_Window root, const char *output, con
static void
_backlight_devices_device_set(Backlight_Device *bd, double val)
{
if (fabs(bd->expected_val - val) > DBL_EPSILON) bd->retries = 0;
bd->val = bd->expected_val = val;
bd->retries = 0;
#ifndef HAVE_WAYLAND_ONLY
if (!strcmp(bd->dev, "randr"))
{
@ -261,8 +262,21 @@ _backlight_devices_device_zone_get(Backlight_Device *bd)
snprintf(buf, sizeof(buf), "%s/%s", bd->output? bd->output: "", bd->edid ? bd->edid : "");
EINA_LIST_FOREACH(e_comp->zones, l, zone)
{
if (!zone->randr2_id) continue;
if (!strcmp(zone->randr2_id, buf)) return zone;
const char *id = zone->randr2_id;
fprintf(stderr, "look at %p %s\n", zone, id);
if (!id)
{
const char *id2 = bd->edid;
if (!id2) id2 = "";
id = "";
fprintf(stderr, "cmp1 [%s] == [%s]\n", id, id2);
if (!strcmp(id, id2)) return zone;
}
else
{
fprintf(stderr, "cmp2 [%s] == [%s]\n", id, buf);
if (!strcmp(id, buf)) return zone;
}
}
return NULL;
}
@ -344,12 +358,14 @@ _backlight_devices_screen_edid_get(const char *edid)
{
Eina_List *l;
E_Randr2_Screen *sc;
const char *id;
if (!e_randr2) return NULL;
EINA_LIST_FOREACH(e_randr2->screens, l, sc)
{
if (!sc->info.edid) continue;
if (!strncmp(sc->info.edid, edid, strlen(edid))) return sc;
id = sc->info.edid;
if (!id) id = "";
if (!strncmp(id, edid, strlen(edid))) return sc;
}
return NULL;
}
@ -372,17 +388,20 @@ static void
_backlight_devices_lid_register(const char *dev, Eina_Bool force)
{
E_Randr2_Screen *sc = _backlight_devices_screen_lid_get();
Backlight_Device *bd;
Backlight_Device *bd = NULL;
const char *id;
if (!sc) return;
if (!sc->info.edid) return;
bd = _backlight_devices_edid_find(sc->info.edid);
id = sc->info.edid;
if (!id) id = "";
bd = _backlight_devices_edid_find(id);
if (!bd)
{
E_Zone *zone;
bd = calloc(1, sizeof(Backlight_Device));
if (!bd) return;
bd->edid = eina_stringshare_add(sc->info.edid);
bd->edid = eina_stringshare_add(id);
bd->output = eina_stringshare_add(sc->info.name);
_devices = eina_list_append(_devices, bd);
zone = _backlight_devices_device_zone_get(bd);
@ -415,10 +434,13 @@ _backlight_devices_edid_register(const char *dev, const char *edid)
if (!bd)
{
E_Zone *zone;
const char *id;
bd = calloc(1, sizeof(Backlight_Device));
if (!bd) return;
bd->edid = eina_stringshare_add(sc->info.edid);
id = sc->info.edid;
if (!id) id = "";
bd->edid = eina_stringshare_add(id);
bd->output = eina_stringshare_add(sc->info.name);
_devices = eina_list_append(_devices, bd);
zone = _backlight_devices_device_zone_get(bd);
@ -529,6 +551,7 @@ _backlight_devices_probe(Eina_Bool initial)
Ecore_X_Window root = e_comp->root;
Ecore_X_Randr_Output *out;
int i, num = 0;
Eina_Bool found = EINA_FALSE;
bl_devs = eina_list_append(bl_devs, eina_stringshare_add("randr"));
out = ecore_x_randr_window_outputs_get(root, &num);
@ -552,6 +575,7 @@ _backlight_devices_probe(Eina_Bool initial)
bd->output = eina_stringshare_add(name);
bd->edid = edid_str;
_devices = eina_list_append(_devices, bd);
found = EINA_TRUE;
}
else free(bd);
}
@ -560,6 +584,8 @@ _backlight_devices_probe(Eina_Bool initial)
}
}
free(out);
if (found)
e_backlight_level_set(NULL, e_config->backlight.normal, -1.0);
}
}
#endif
@ -702,11 +728,13 @@ e_backlight_level_set(E_Zone *zone, double val, double tim)
if (zone->bl_mode == E_BACKLIGHT_MODE_NORMAL) tim = 0.5;
else if (tim < 0.0) tim = e_config->backlight.transition;
if ((bd->anim) && (fabs(bd->to_val - val) < DBL_EPSILON)) return;
E_FREE_FUNC(bd->retry_timer, ecore_timer_del);
E_FREE_FUNC(bd->anim, ecore_animator_del);
bd->anim = ecore_animator_timeline_add(tim, _bl_anim, bd);
bd->from_val = bl_now;
bd->to_val = val;
bd->anim = ecore_animator_timeline_add(tim, _bl_anim, bd);
}
E_API double

@ -180,11 +180,11 @@ polkit_agent_response(void *data EINA_UNUSED, const Eldbus_Message *msg,
ecore_main_loop_quit();
if (eldbus_message_error_get(msg, &name, &text))
{
printf("Could not respond to auth.\n %s:\n %s\n", name, text);
fprintf(stderr, "AUTH: Could not respond to auth.\n %s:\n %s\n", name, text);
return;
}
polkit_auth_ok = 0;
printf("Auth OK\n");
fprintf(stderr, "AUTH: OK\n");
}
int
@ -200,46 +200,42 @@ polkit_auth(const char *cookie, unsigned int auth_uid)
ecore_init();
eldbus_init();
c = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
if (!c) return -1;
#define BARF(str) do { \
fprintf(stderr, "AUTH: POLKIT: %s\n", str); \
return -1; \
} while (0)
if (!c) BARF("Cannot get session dbus");
obj = eldbus_object_get(c, "org.freedesktop.PolicyKit1",
"/org/freedesktop/PolicyKit1/Authority");
if (!obj) return -1;
if (!obj) BARF("Cannot get obj: org.freedesktop.PolicyKit1 /org/freedesktop/PolicyKit1/Authority");
proxy = eldbus_proxy_get(obj, "org.freedesktop.PolicyKit1.Authority");
if (!proxy) return -1;
if (!proxy) BARF("Cannot proxy: org.freedesktop.PolicyKit1.Authority");
m = eldbus_proxy_method_call_new(proxy, "AuthenticationAgentResponse2");
if (!m) return -1;
if (!m) BARF("Cannot get method call: AuthenticationAgentResponse2");
iter = eldbus_message_iter_get(m);
if (!iter) return -1;
if (eldbus_message_iter_arguments_append(iter, "us", auth_uid, cookie))
{
if (eldbus_message_iter_arguments_append(iter, "(sa{sv})", &subj))
{
if (eldbus_message_iter_basic_append(subj, 's', "unix-user"))
{
if (eldbus_message_iter_arguments_append(subj, "a{sv}", &array))
{
if (eldbus_message_iter_arguments_append(array, "{sv}", &dict))
{
if (eldbus_message_iter_basic_append(dict, 's', "uid"))
{
vari = eldbus_message_iter_container_new(dict, 'v', "u");
if (vari)
{
if (eldbus_message_iter_basic_append(vari, 'u', auth_uid))
{
eldbus_message_iter_container_close(dict, vari);
} else return -1;
} else return -1;
} else return -1;
eldbus_message_iter_container_close(array, dict);
} else return -1;
eldbus_message_iter_container_close(subj, array);
} else return -1;
} else return -1;
eldbus_message_iter_container_close(iter, subj);
} else return -1;
eldbus_proxy_send(proxy, m, polkit_agent_response, NULL, -1);
} else return -1;
if (!iter) BARF("Cannot set iter on proxy");
if (!eldbus_message_iter_arguments_append(iter, "us", uid, cookie))
BARF("Cannot append 'us' args");
if (!eldbus_message_iter_arguments_append(iter, "(sa{sv})", &subj))
BARF("Cannot append '(sa{sv})' args");
if (!eldbus_message_iter_basic_append(subj, 's', "unix-user"))
BARF("Cannot append 's' arg for unix-user");
if (!eldbus_message_iter_arguments_append(subj, "a{sv}", &array))
BARF("Cannot append 'a{sv}' args");
if (!eldbus_message_iter_arguments_append(array, "{sv}", &dict))
BARF("Cannot append '{sv}' args");
if (!eldbus_message_iter_basic_append(dict, 's', "uid"))
BARF("Cannot append 's' arg for uid");
vari = eldbus_message_iter_container_new(dict, 'v', "u");
if (!vari)
BARF("Cannot create new iter container");
if (!eldbus_message_iter_basic_append(vari, 'u', auth_uid))
BARF("Cannot append 'u' arg for auth_id");
eldbus_message_iter_container_close(dict, vari);
eldbus_message_iter_container_close(array, dict);
eldbus_message_iter_container_close(subj, array);
eldbus_message_iter_container_close(iter, subj);
eldbus_proxy_send(proxy, m, polkit_agent_response, NULL, -1);
ecore_main_loop_begin();
@ -274,7 +270,7 @@ main(int argc, char **argv)
rd = read(0, pw, sizeof(pw) - 1);
if (rd < 0)
{
fprintf(stderr, "Error. Can't read passwd on stdin\n");
fprintf(stderr, "AUTH: Error. Can't read passwd on stdin\n");
goto err;
}
pw[rd] = 0;
@ -297,14 +293,14 @@ main(int argc, char **argv)
rd = read(0, pw + pos, 1);
if (rd < 0)
{
fprintf(stderr, "Error. Can't read polkit cookie on stdin\n");
fprintf(stderr, "AUTH: POLKIT: Error. Can't read polkit cookie on stdin\n");
goto err;
}
if (pw[pos] == ' ')
{
memcpy(polkit_cookie, pw, pos);
polkit_cookie[pos] = 0;
printf("COOKIE: [%s]\n", polkit_cookie);
fprintf(stderr, "AUTH: POLKIT: [%s]\n", polkit_cookie);
pos = 0;
break;
}
@ -313,7 +309,7 @@ main(int argc, char **argv)
pos++;
if (pos > 4000)
{
fprintf(stderr, "Error. Polkit cookie too long\n");
fprintf(stderr, "AUTH: POLKIT: Error. Polkit cookie too long\n");
return -10;
}
}
@ -323,14 +319,14 @@ main(int argc, char **argv)
rd = read(0, pw + pos, 1);
if (rd < 0)
{
fprintf(stderr, "Error. Can't read polkit uid on stdin\n");
fprintf(stderr, "AUTH: Error. Can't read polkit uid on stdin\n");
goto err;
}
if (pw[pos] == ' ')
{
pw[pos] = 0;
polkit_uid = atoi(pw);
printf("UID: [%u]\n", polkit_uid);
fprintf(stderr, "AUTH: UID: [%u]\n", polkit_uid);
break;
}
else
@ -338,17 +334,17 @@ main(int argc, char **argv)
pos++;
if (pos > 4000)
{
fprintf(stderr, "Error. Polkit uid too long\n");
fprintf(stderr, "AUTH: Error. Polkit uid too long\n");
return -11;
}
}
}
// password
printf("READPASS...\n");
fprintf(stderr, "AUTH: readpass...\n");
rd = read(0, pw, sizeof(pw) - 1);
if (rd < 0)
{
fprintf(stderr, "Error. Can't read passwd on stdin\n");
fprintf(stderr, "AUTH: Error. Can't read passwd on stdin\n");
goto err;
}
pw[rd] = 0;
@ -365,22 +361,22 @@ main(int argc, char **argv)
// ok to fail - auth will just possibly fail then
e_setuid_setup(&uid, &gid, &user_name, &group_name);
if (_check_auth(uid, pw) == 0)
if (_check_auth(polkit_mode ? polkit_uid : uid, pw) == 0)
{
fprintf(stderr, "Password OK\n");
fprintf(stderr, "AUTH: Password OK\n");
if (polkit_mode == 1)
{
if (polkit_auth(polkit_cookie, polkit_uid) == 0)
{
fprintf(stderr, "Polkit AuthenticationAgentResponse2 success\n");
fprintf(stderr, "AUTH: Polkit AuthenticationAgentResponse2 success\n");
return 0;
}
fprintf(stderr, "Polkit AuthenticationAgentResponse2 failure\n");
fprintf(stderr, "AUTH: Polkit AuthenticationAgentResponse2 failure\n");
return -2;
}
return 0;
}
err:
fprintf(stderr, "Password auth fail\n");
fprintf(stderr, "AUTH: Password auth fail\n");
return -1;
}

@ -4709,7 +4709,7 @@ e_client_urgent_set(E_Client *ec, Eina_Bool urgent)
int x, y;
ecore_evas_pointer_xy_get(e_comp->ee, &x, &y);
ecore_evas_pointer_warp(e_comp->ee, x, y);
e_screensaver_notidle();
e_comp_canvas_notidle();
}
if (!ec->zone) return;

@ -379,11 +379,11 @@ _e_comp_cb_update(void)
ecore_animator_freeze(e_comp->render_animator);
DBG("UPDATE ALL");
if (e_comp->nocomp) goto nocomp;
if (conf->grab && (!e_comp->grabbed))
{
if (e_comp->grab_cb) e_comp->grab_cb();
e_comp->grabbed = 1;
}
// if (conf->grab && (!e_comp->grabbed))
// {
// if (e_comp->grab_cb) e_comp->grab_cb();
// e_comp->grabbed = 1;
// }
e_comp->updating = 1;
l = e_comp->updates;
e_comp->updates = NULL;
@ -460,11 +460,6 @@ _e_comp_cb_update(void)
// if (!e_comp->nocomp) ecore_evas_manual_render(e_comp->ee);
}
if (conf->grab && e_comp->grabbed)
{
if (e_comp->grab_cb) e_comp->grab_cb();
e_comp->grabbed = 0;
}
if (e_comp->updates && (!e_comp->update_job))
ecore_animator_thaw(e_comp->render_animator);
/*
@ -1589,7 +1584,7 @@ e_comp_ignore_win_find(Ecore_Window win)
}
E_API void
e_comp_override_del()
e_comp_override_del(void)
{
e_comp->nocomp_override--;
if (e_comp->nocomp_override <= 0)
@ -1600,7 +1595,7 @@ e_comp_override_del()
}
E_API void
e_comp_override_add()
e_comp_override_add(void)
{
e_comp->nocomp_override++;
if ((e_comp->nocomp_override > 0) && (e_comp->nocomp)) _e_comp_nocomp_end();

@ -31,7 +31,7 @@ _e_comp_canvas_cb_first_frame(void *data EINA_UNUSED, Evas *e, void *event_info
{
case 'A': abort();
case 'E':
case 'D': exit(-1);
case 'D': exit(101);
case 'T': fprintf(stderr, "Startup time: '%f' - '%f' = '%f'\n", now, e_first_frame_start_time, now - e_first_frame_start_time);
break;
}
@ -42,6 +42,7 @@ _e_comp_canvas_cb_first_frame(void *data EINA_UNUSED, Evas *e, void *event_info
static void
_e_comp_canvas_render_post(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
{
E_Comp_Config *conf = e_comp_config_get();
E_Client *ec;
//Evas_Event_Render_Post *ev = event_info;
//Eina_List *l;
@ -65,6 +66,11 @@ _e_comp_canvas_render_post(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *ev
UNREFD(ec, 111);
e_object_unref(E_OBJECT(ec));
}
if (conf->grab && e_comp->grabbed)
{
if (e_comp->grab_cb) e_comp->grab_cb();
e_comp->grabbed = 0;
}
}
///////////////////////////////////
@ -74,7 +80,7 @@ _e_comp_canvas_cb_mouse_in(void *d EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object
{
E_Client *ec;
e_screensaver_notidle();
e_comp_canvas_notidle();
if (e_client_action_get() || e_grabinput_mouse_win_get()) return;
ec = e_client_focused_get();
if (ec && (!ec->border_menu)) e_focus_event_mouse_out(ec);
@ -83,7 +89,7 @@ _e_comp_canvas_cb_mouse_in(void *d EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object
static void
_e_comp_canvas_cb_mouse_down(void *d EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
e_screensaver_notidle();
e_comp_canvas_notidle();
if (e_client_action_get() || e_grabinput_mouse_win_get()) return;
e_bindings_mouse_down_evas_event_handle(E_BINDING_CONTEXT_COMPOSITOR, E_OBJECT(e_comp), event_info);
}
@ -91,7 +97,7 @@ _e_comp_canvas_cb_mouse_down(void *d EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Obje
static void
_e_comp_canvas_cb_mouse_up(void *d EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
e_screensaver_notidle();
e_comp_canvas_notidle();
if (e_client_action_get() || e_grabinput_mouse_win_get()) return;
e_bindings_mouse_up_evas_event_handle(E_BINDING_CONTEXT_COMPOSITOR, E_OBJECT(e_comp), event_info);
}
@ -99,7 +105,7 @@ _e_comp_canvas_cb_mouse_up(void *d EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object
static void
_e_comp_canvas_cb_mouse_wheel(void *d EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
e_screensaver_notidle();
e_comp_canvas_notidle();
if (e_client_action_get() || e_grabinput_mouse_win_get()) return;
e_bindings_wheel_evas_event_handle(E_BINDING_CONTEXT_COMPOSITOR, E_OBJECT(e_comp), event_info);
}
@ -107,7 +113,7 @@ _e_comp_canvas_cb_mouse_wheel(void *d EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Obj
static Eina_Bool
_key_down(int ctx, Ecore_Event_Key *ev)
{
e_screensaver_notidle();
e_comp_canvas_notidle();
if (e_desklock_state_get() && (ctx == E_BINDING_CONTEXT_MANAGER))
{
E_Desklock_Interface *iface = e_desklock_interface_current_get();
@ -157,7 +163,7 @@ _e_comp_cb_key_down(void *data EINA_UNUSED, int ev_type EINA_UNUSED, Ecore_Event
static Eina_Bool
_key_up(int ctx, Ecore_Event_Key *ev)
{
e_screensaver_notidle();
e_comp_canvas_notidle();
if (e_desklock_state_get() && (ctx == E_BINDING_CONTEXT_MANAGER))
{
E_Desklock_Interface *iface = e_desklock_interface_current_get();
@ -354,9 +360,16 @@ _e_comp_canvas_prerender(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *even
{
E_Comp_Cb cb;
Eina_List *l;
E_Comp_Config *conf = e_comp_config_get();
e_comp->rendering = EINA_TRUE;
if (conf->grab && (!e_comp->grabbed))
{
if (e_comp->grab_cb) e_comp->grab_cb();
e_comp->grabbed = 1;
}
EINA_LIST_FOREACH(e_comp->pre_render_cbs, l, cb)
cb();
}
@ -404,7 +417,7 @@ e_comp_canvas_init(int w, int h)
// ecore_evas_manual_render_set(e_comp->ee, conf->lock_fps);
ecore_evas_show(e_comp->ee);
evas_event_callback_add(e_comp->evas, EVAS_CALLBACK_RENDER_POST, _e_comp_canvas_render_post, NULL);
evas_event_callback_add(e_comp->evas, EVAS_CALLBACK_RENDER_FLUSH_POST, _e_comp_canvas_render_post, NULL);
e_comp->ee_win = ecore_evas_window_get(e_comp->ee);
@ -437,6 +450,10 @@ e_comp_canvas_init(int w, int h)
if ((!after_restart) || (!e_comp_x))
ecore_evas_pointer_warp(e_comp->ee, e_comp->w / 2, e_comp->h / 2);
#ifdef HAVE_WAYLAND
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
e_comp_wl_notidle();
#endif
return EINA_TRUE;
}
@ -874,6 +891,14 @@ e_comp_canvas_feed_mouse_up(unsigned int activate_time)
}
}
E_API void
e_comp_canvas_notidle(void)
{
#ifdef HAVE_WAYLAND
if (e_comp->comp_type == E_PIXMAP_TYPE_WL) e_comp_wl_notidle();
#endif
}
E_API Evas_Object *
e_comp_canvas_event_grabber_add(void)
{

@ -29,6 +29,7 @@ E_API E_Layer e_comp_canvas_client_layer_map_nearest(int layer);
E_API void e_comp_canvas_keys_grab(void);
E_API void e_comp_canvas_keys_ungrab(void);
E_API void e_comp_canvas_feed_mouse_up(unsigned int activate_time);
E_API void e_comp_canvas_notidle(void);
E_API Evas_Object *e_comp_canvas_event_grabber_add(void);
EINTERN void e_comp_canvas_intercept(void);

@ -1106,6 +1106,16 @@ _e_comp_wl_client_evas_init(E_Client *ec)
_e_comp_wl_evas_cb_color_set, ec);
ec->comp_data->evas_init = EINA_TRUE;
E_LIST_HANDLER_APPEND(handlers, E_EVENT_SCREENSAVER_ON, _e_comp_wl_screensaver_on, NULL);
E_LIST_HANDLER_APPEND(handlers, E_EVENT_SCREENSAVER_OFF, _e_comp_wl_screensaver_off, NULL);
e_comp_wl_notidle();
e_screensaver_attrs_set(e_screensaver_timeout_get(EINA_TRUE),
e_config->screensaver_blanking,
e_config->screensaver_expose);
// XXX: maybe later like x work on explicit suspend of compositor stuff?
// e_desklock_show_hook_add(_e_comp_x_desklock_show);
// e_desklock_hide_hook_add(_e_comp_x_desklock_hide);
}
static inline int
@ -1199,7 +1209,7 @@ _e_comp_wl_cb_mouse_move(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mou
e_comp_wl->ptr.x = ev->x;
e_comp_wl->ptr.y = ev->y;
e_screensaver_notidle();
e_comp_canvas_notidle();
if (e_comp_wl->selection.target &&
(!e_client_has_xwindow(e_comp_wl->selection.target)) &&
e_comp_wl->drag)
@ -3405,7 +3415,9 @@ e_comp_wl_key_down(Ecore_Event_Key *ev, E_Client *ec)
((ev->modifiers & ECORE_EVENT_MODIFIER_ALT) ||
(ev->modifiers & ECORE_EVENT_MODIFIER_ALTGR)) &&
eina_streq(ev->key, "BackSpace"))
exit(0);
{
if (!e_desklock_state_get()) exit(0);
}
#endif
end = (uint32_t *)e_comp_wl->kbd.keys.data + (e_comp_wl->kbd.keys.size / sizeof(*k));
@ -3682,3 +3694,149 @@ e_comp_wl_grab_client_mouse_button(const Ecore_Event_Mouse_Button *ev)
e_comp_canvas_feed_mouse_up(0);
return ECORE_CALLBACK_DONE;
}
static Eina_Bool saver_inhibit = EINA_FALSE;
static Eina_Bool saver_on = EINA_FALSE;
static Ecore_Timer *screensaver_eval_timer = NULL;
static Ecore_Timer *screensaver_idle_timer = NULL;
static Eina_Bool
_e_comp_wl_screensaver_eval_cb(void *d EINA_UNUSED)
{
screensaver_eval_timer = NULL;
if (!saver_on)
{
if (e_comp->screen && e_comp->screen->dpms)
e_comp->screen->dpms(0);
}
e_screensaver_eval(saver_on);
return EINA_FALSE;
}
static Eina_Bool
_e_comp_wl_screensaver_idle_cb(void *data EINA_UNUSED)
{
screensaver_idle_timer = NULL;
if (e_screensaver_ignore_get()) return EINA_FALSE;
if (!saver_on)
{
saver_on = EINA_TRUE;
E_FREE_FUNC(screensaver_eval_timer, ecore_timer_del);
screensaver_eval_timer = ecore_timer_loop_add
(0.3, _e_comp_wl_screensaver_eval_cb, NULL);
}
return EINA_FALSE;
}
static void
_e_comp_cb_pointer_suspend_resume_done(void *data, Evas_Object *obj, const char *emission, const char *source)
{
edje_object_signal_callback_del(obj, emission, source,
_e_comp_cb_pointer_suspend_resume_done);
if (!data)
{
e_pointer_grab_set(e_comp->pointer, EINA_FALSE);
}
}
EINTERN Eina_Bool
_e_comp_wl_screensaver_on()
{
const char *s;
if ((!e_comp->pointer) || (!e_comp->pointer->o_ptr)) return ECORE_CALLBACK_RENEW;
s = edje_object_data_get(e_comp->pointer->o_ptr, "can_suspend");
if ((s) && (atoi(s) == 1))
{
if (!e_desklock_state_get())
{
e_pointer_grab_set(e_comp->pointer, EINA_FALSE);
e_pointer_grab_set(e_comp->pointer, EINA_TRUE);
}
edje_object_signal_callback_del(e_comp->pointer->o_ptr,
"e,state,mouse,suspend,done", "e",
_e_comp_cb_pointer_suspend_resume_done);
edje_object_signal_callback_del(e_comp->pointer->o_ptr,
"e,state,mouse,resume,done", "e",
_e_comp_cb_pointer_suspend_resume_done);
edje_object_signal_callback_add(e_comp->pointer->o_ptr,
"e,state,mouse,suspend,done",
"e",
_e_comp_cb_pointer_suspend_resume_done,
e_comp);
edje_object_signal_emit(e_comp->pointer->o_ptr,
"e,state,mouse,suspend", "e");
}
return ECORE_CALLBACK_RENEW;
}
EINTERN Eina_Bool
_e_comp_wl_screensaver_off()
{
const char *s;
e_pointer_grab_set(e_comp->pointer, EINA_FALSE);
if ((!e_comp->pointer) || (!e_comp->pointer->o_ptr)) return ECORE_CALLBACK_RENEW;
s = edje_object_data_get(e_comp->pointer->o_ptr, "can_suspend");
if ((s) && (atoi(s) == 1))
{
if (!e_desklock_state_get())
{
e_pointer_grab_set(e_comp->pointer, EINA_TRUE);
}
edje_object_signal_callback_del(e_comp->pointer->o_ptr,
"e,state,mouse,suspend,done", "e",
_e_comp_cb_pointer_suspend_resume_done);
edje_object_signal_callback_del(e_comp->pointer->o_ptr,
"e,state,mouse,resume,done", "e",
_e_comp_cb_pointer_suspend_resume_done);
edje_object_signal_callback_add(e_comp->pointer->o_ptr,
"e,state,mouse,resume,done",
"e",
_e_comp_cb_pointer_suspend_resume_done,
NULL);
edje_object_signal_emit(e_comp->pointer->o_ptr,
"e,state,mouse,resume", "e");
}
return ECORE_CALLBACK_RENEW;
}
E_API void
e_comp_wl_notidle(void)
{
int timeout;
if (saver_on)
{
saver_on = EINA_FALSE;
E_FREE_FUNC(screensaver_eval_timer, ecore_timer_del);
screensaver_eval_timer = ecore_timer_loop_add
(0.3, _e_comp_wl_screensaver_eval_cb, NULL);
}
E_FREE_FUNC(screensaver_idle_timer, ecore_timer_del);
timeout = e_screensaver_timeout_get(EINA_TRUE);
if (timeout > 0)
screensaver_idle_timer = ecore_timer_add
(timeout, _e_comp_wl_screensaver_idle_cb, NULL);
}
E_API void
e_comp_wl_screensaver_activate(void)
{
saver_on = EINA_TRUE;
E_FREE_FUNC(screensaver_eval_timer, ecore_timer_del);
E_FREE_FUNC(screensaver_idle_timer, ecore_timer_del);
e_screensaver_eval(saver_on);
}
E_API void
e_comp_wl_screensaver_inhibit(Eina_Bool inhibit)
{
if (inhibit == saver_inhibit) return;
saver_inhibit = inhibit;
e_comp_wl_notidle();
if (inhibit)
E_FREE_FUNC(screensaver_idle_timer, ecore_timer_del);
}

@ -439,6 +439,12 @@ E_API void e_comp_wl_extension_pointer_unconstrain(E_Client *ec);
E_API void e_comp_wl_extension_action_route_pid_allowed_set(uint32_t pid, Eina_Bool allow);
E_API const void *e_comp_wl_extension_action_route_interface_get(int *version);
E_API void e_comp_wl_notidle(void);
E_API void e_comp_wl_screensaver_activate(void);
E_API void e_comp_wl_screensaver_inhibit(Eina_Bool inhibit);
EINTERN Eina_Bool _e_comp_wl_screensaver_on();
EINTERN Eina_Bool _e_comp_wl_screensaver_off();
E_API void
e_policy_wl_aux_message_send(E_Client *ec,

@ -5272,13 +5272,25 @@ _e_comp_x_screensaver_off()
}
static Ecore_Timer *screensaver_eval_timer = NULL;
static Ecore_Animator *screensaver_eval_animator = NULL;
static Eina_Bool saver_on = EINA_FALSE;
static Eina_Bool
_e_comp_x_screensaver_eval_cb(void *d EINA_UNUSED)
{
e_screensaver_eval(saver_on);
E_FREE_FUNC(screensaver_eval_animator, ecore_animator_del);
screensaver_eval_timer = NULL;
e_screensaver_eval(saver_on);
return EINA_FALSE;
}
static Eina_Bool
_e_comp_x_screensaver_pre_eval_cb(void *d EINA_UNUSED)
{
E_FREE_FUNC(screensaver_eval_timer, ecore_timer_del);
screensaver_eval_animator = NULL;
screensaver_eval_timer = ecore_timer_loop_add(0.3, _e_comp_x_screensaver_eval_cb, NULL);
e_screensaver_eval(saver_on);
return EINA_FALSE;
}
@ -5290,13 +5302,15 @@ _e_comp_x_screensaver_notify_cb(void *data EINA_UNUSED, int type EINA_UNUSED, Ec
{
saver_on = EINA_TRUE;
E_FREE_FUNC(screensaver_eval_timer, ecore_timer_del);
E_FREE_FUNC(screensaver_eval_animator, ecore_animator_del);
screensaver_eval_timer = ecore_timer_loop_add(0.3, _e_comp_x_screensaver_eval_cb, NULL);
}
else if ((!ev->on) && (saver_on))
{
saver_on = EINA_FALSE;
E_FREE_FUNC(screensaver_eval_timer, ecore_timer_del);
screensaver_eval_timer = ecore_timer_loop_add(0.3, _e_comp_x_screensaver_eval_cb, NULL);
E_FREE_FUNC(screensaver_eval_animator, ecore_animator_del);
screensaver_eval_animator = ecore_animator_add(_e_comp_x_screensaver_pre_eval_cb, NULL);
}
return ECORE_CALLBACK_PASS_ON;
}

@ -490,6 +490,8 @@ e_comp_x_randr_config_apply(void)
int crtcs_num = 0, outputs_num = 0, i, numout;
Ecore_X_Randr_Crtc_Info *info;
int top_priority = 0;
int px, py;
Eina_Bool fix_pointer = EINA_TRUE;
ecore_x_grab();
// set virtual resolution
@ -509,6 +511,8 @@ e_comp_x_randr_config_apply(void)
if (nh < minh) nh = minh;
ww = nw; if (nw < pw) ww = pw;
hh = nh; if (nh < ph) hh = ph;
ecore_x_pointer_xy_get(root, &px, &py);
ecore_x_randr_screen_current_size_set(root, ww, hh, -1, -1);
{
int dww = 0, dhh = 0, dww2 = 0, dhh2 = 0;
@ -610,6 +614,16 @@ e_comp_x_randr_config_apply(void)
screenconf[i]->config.geom.y,
mode, orient))
printf("RRR: failed to set crtc!!!!!!\n");
if (E_INSIDE(px, py,
screenconf[i]->config.geom.x,
screenconf[i]->config.geom.y,
screenconf[i]->config.geom.w,
screenconf[i]->config.geom.h))
fix_pointer = EINA_FALSE;
px = screenconf[i]->config.geom.x +
(screenconf[i]->config.geom.w / 2);
py = screenconf[i]->config.geom.y +
(screenconf[i]->config.geom.h / 2);
ecore_x_randr_crtc_panning_area_set
(root, crtcs[i],
screenconf[i]->config.geom.x,
@ -644,6 +658,10 @@ e_comp_x_randr_config_apply(void)
ecore_x_root_screen_barriers_set(NULL, 0);
}
}
if (fix_pointer)
{
ecore_x_pointer_warp(root, px, py);
}
free(outputs);
free(crtcs);

@ -469,7 +469,7 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining)
return NULL;
}
}
else
else if (exec)
{
if ((desktop) && (desktop->terminal))
{
@ -805,6 +805,14 @@ _e_exec_startup_id_pid_find(const Eina_Hash *hash EINA_UNUSED, const void *key E
search = data;
EINA_LIST_FOREACH(value, l, inst)
{
pid_t exe_pid;
exe_pid = 0;
if (inst->exe)
{
exe_pid = ecore_exe_pid_get(inst->exe);
if (exe_pid <= 0) inst->exe = NULL;
}
if (((search->desktop) &&
(search->desktop == inst->desktop)) ||
@ -812,7 +820,7 @@ _e_exec_startup_id_pid_find(const Eina_Hash *hash EINA_UNUSED, const void *key E
(search->startup_id == inst->startup_id)) ||
((inst->exe) && (search->pid > 1) && (!inst->phony) &&
(search->pid == ecore_exe_pid_get(inst->exe))))
(search->pid == exe_pid)))
{
search->inst = inst;
return EINA_FALSE;

@ -185,7 +185,7 @@ e_hints_init(Ecore_Window root, Ecore_Window propwin)
{
e_error_message_show(_("A previous instance of Enlightenment is still active\n"
"on this screen. Aborting startup.\n"));
exit(1);
exit(101);
}
/* get/check agan */
nwins = ecore_x_window_prop_window_get(root,

@ -86,7 +86,7 @@ _e_icon_obj_prepare(Evas_Object *obj, E_Smart_Data *sd)
{
if (!sd->obj) return;
if (sd->edje)
if (!sd->edje)
{
Evas_Object *pclip;
@ -97,6 +97,7 @@ _e_icon_obj_prepare(Evas_Object *obj, E_Smart_Data *sd)
evas_object_image_scale_hint_set(sd->obj,
EVAS_IMAGE_SCALE_HINT_STATIC);
evas_object_smart_member_add(sd->obj, obj);
evas_object_stack_below(sd->obj, sd->eventarea);
evas_object_event_callback_add(sd->obj, EVAS_CALLBACK_IMAGE_PRELOADED,
_e_icon_preloaded, obj);
evas_object_clip_set(sd->obj, pclip);
@ -236,7 +237,7 @@ e_icon_file_key_set(Evas_Object *obj, const char *file, const char *key)
if (sd->preload)
{
sd->loading = 1;
evas_object_image_preload(sd->obj, 0);
evas_object_image_preload(sd->obj, EINA_FALSE);
}
else if (evas_object_visible_get(obj))
evas_object_show(sd->obj);
@ -317,8 +318,9 @@ e_icon_file_edje_set(Evas_Object *obj, const char *file, const char *part)
edje_object_file_set(sd->obj, file, part);
// if (edje_object_load_error_get(sd->obj) != EDJE_LOAD_ERROR_NONE)
// return EINA_FALSE;
if (evas_object_visible_get(obj)) evas_object_show(