forked from enlightenment/enlightenment
Compare commits
152 Commits
Author | SHA1 | Date |
---|---|---|
maxerba | 2e54f9851e | |
Carsten Haitzler | 8b06ca97a6 | |
Ross Vandegrift | 9c4b442335 | |
maxerba | 4e32c90b7d | |
maxerba | 5e25ae24f8 | |
rafspiny | 3def50bd6a | |
rafspiny | 318de512f2 | |
rafspiny | 5efba6f8a3 | |
rafspiny | f34460bf96 | |
rafspiny | bd1ebaebad | |
rafspiny | 74cd743aa0 | |
rafspiny | 16bf105f34 | |
rafspiny | dcf621326b | |
rafspiny | bb37914492 | |
rafspiny | e7fb1684ce | |
rafspiny | a2bdd3c3ff | |
rafspiny | 801e552985 | |
rafspiny | 8c184e7ef0 | |
rafspiny | 5992d94c85 | |
rafspiny | 6939a34c1d | |
rafspiny | 1f36cc158b | |
rafspiny | b12978c7c9 | |
rafspiny | ffd51d8fca | |
rafspiny | 5e7fa42b8c | |
rafspiny | d60a6fd16b | |
rafspiny | 5b042e08e2 | |
rafspiny | fbfd52f679 | |
rafspiny | faa5c6ae84 | |
rafspiny | 095e14f439 | |
rafspiny | fc30c75946 | |
rafspiny | a139e88811 | |
rafspiny | 43b233348a | |
rafspiny | 4ea8172e51 | |
rafspiny | 479b83eb81 | |
rafspiny | d2ccd898f9 | |
rafspiny | 3c3a1ac603 | |
rafspiny | 608e2fcebf | |
rafspiny | ff71a650c2 | |
rafspiny | 1edbc5cca4 | |
rafspiny | 7f33315dcd | |
Carsten Haitzler | e10a0d2be1 | |
Carsten Haitzler | efe2f7b267 | |
Carsten Haitzler | ed64f9e0b8 | |
Carsten Haitzler | 5a5059b058 | |
Carsten Haitzler | 7eea5fb897 | |
maxerba | 6bfef9f30c | |
maxerba | c9bf720f9e | |
maxerba | 9377f96932 | |
maxerba | 6c5358f4cd | |
Carsten Haitzler | a6d7a2235a | |
Carsten Haitzler | cc4df8d320 | |
maxerba | 25640ae2fa | |
Carsten Haitzler | aa5fbfb1d3 | |
Carsten Haitzler | c0cf9176dc | |
Carsten Haitzler | 22d130f3ce | |
Carsten Haitzler | 5a493a5594 | |
Carsten Haitzler | 98e9c79246 | |
Carsten Haitzler | 3311cc0790 | |
Andre Schulz | 850c1ad41a | |
maxerba | 4072be6ee7 | |
Andre Schulz | 4bd15e3fec | |
maxerba | 942a6bf135 | |
NorwayFun | f1fb27aa2d | |
Carsten Haitzler | d8acc8d563 | |
maxerba | 1974113d1a | |
Carsten Haitzler | b775f51c82 | |
maxerba | 54c65ae38a | |
Carsten Haitzler | 81d7fb15ab | |
Ross Vandegrift | c18c52f36a | |
maxerba | 39cb8e6280 | |
Carsten Haitzler | d15de275f8 | |
maxerba | 36236e6e46 | |
Nekobit | 766360359b | |
Nekobit | 78470d03d9 | |
Nekobit | 98a9609f8c | |
maxerba | 7baf84c1dc | |
Carsten Haitzler | 0c6b0645bd | |
Carsten Haitzler | ef788779f9 | |
maxerba | 1b9d1c9796 | |
Carsten Haitzler | 1cb02d3480 | |
Carsten Haitzler | a6038af68f | |
Carsten Haitzler | 13454ff0bb | |
NorwayFun | 9542815c2c | |
NorwayFun | 2b00b6fbc9 | |
Carsten Haitzler | 72d639d1a6 | |
Carsten Haitzler | cb2bc1d1c1 | |
Carsten Haitzler | fd3e4a645d | |
kikadf | e5e3750ce1 | |
kikadf | 1b6d81a352 | |
Carsten Haitzler | 9882110357 | |
Carsten Haitzler | 42eedd5fe8 | |
Carsten Haitzler | fd64bd69c6 | |
Carsten Haitzler | 882261d8e2 | |
Carsten Haitzler | 21ac62127c | |
Carsten Haitzler | acb59e1c78 | |
Carsten Haitzler | 5c4f26f251 | |
Carsten Haitzler | 53a21b1b0d | |
Carsten Haitzler | e584097d45 | |
Carsten Haitzler | 239d989e59 | |
maxerba | 0ef9451d2c | |
Carsten Haitzler | 913b7d701a | |
Carsten Haitzler | 5a6fb2450c | |
Carsten Haitzler | 6cca3f77e8 | |
Carsten Haitzler | 6122bf24bb | |
Carsten Haitzler | a6c68aaf5e | |
Christopher Michael | 5ccfb44404 | |
Carsten Haitzler | a8f174e6c7 | |
Carsten Haitzler | bcf795d47f | |
maxerba | 7d21b19347 | |
Carsten Haitzler | e4cfb3c50c | |
Carsten Haitzler | 2386831529 | |
maxerba | 79a7c8e95c | |
Carsten Haitzler | 1a58e0e582 | |
maxerba | 38178d8c46 | |
maxerba | 5d49dceb36 | |
maxerba | 456713da90 | |
Marcel Hollerbach | 928cf22f3e | |
Marcel Hollerbach | f1d43c42a3 | |
Marcel Hollerbach | 5cc6f31035 | |
Marcel Hollerbach | 9778dc9738 | |
Carsten Haitzler | 319b307c59 | |
Carsten Haitzler | cc7faeccf7 | |
Carsten Haitzler | fe0945600a | |
Carsten Haitzler | 47e9eae4ed | |
Carsten Haitzler | 2e30f391fb | |
Carsten Haitzler | 05e150ad43 | |
Christopher Michael | a5d004a49b | |
Carsten Haitzler | 2294ea9f8a | |
Carsten Haitzler | 3c46a6796a | |
Carsten Haitzler | 88d7e3b836 | |
Carsten Haitzler | c93c976069 | |
Carsten Haitzler | aaf317b61d | |
Carsten Haitzler | 225cbac56f | |
Carsten Haitzler | bea94314bd | |
Carsten Haitzler | db3ea64dd3 | |
Carsten Haitzler | c2869268d8 | |
Carsten Haitzler | 5980468f7f | |
Carsten Haitzler | daabedaac1 | |
Carsten Haitzler | 130535af97 | |
Carsten Haitzler | a39341d4a6 | |
Carsten Haitzler | 3d4789531d | |
Carsten Haitzler | 70a5f83cf7 | |
Carsten Haitzler | 2bc9efc261 | |
Carsten Haitzler | 2b095b67d1 | |
Carsten Haitzler | 91e797eab7 | |
Carsten Haitzler | b312bb3aa6 | |
Carsten Haitzler | cdad184547 | |
Carsten Haitzler | bfd175e985 | |
Carsten Haitzler | b23eedae98 | |
maxerba | 1933f745f2 | |
Carsten Haitzler | 7dcf43051f | |
Carsten Haitzler | dbcc56014c |
2
COPYING
2
COPYING
|
@ -1,6 +1,6 @@
|
|||
Copyright notice for Enlightenment:
|
||||
|
||||
Copyright (C) 2000-2020 Carsten Haitzler and various contributors (see AUTHORS)
|
||||
Copyright (C) 2000-2024 Carsten Haitzler and various contributors (see AUTHORS)
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
|
@ -214,3 +214,12 @@ regular end users) use the meson `-Dwl=true option`. To run Enlightenment in
|
|||
Wayland mode, just login on any text VT and run `enlightenment_start`. If you
|
||||
wish to debug and see all the output try using something like screen then
|
||||
attaching to the remote screen session by sshing in etc.
|
||||
|
||||
-----
|
||||
|
||||
**NOTE:** Nvidia support - do *not* enable Wayland support if you have
|
||||
Nvidia cards and use Nvidia drivers. You will need to use **full**
|
||||
OpenGL+GLX with EFL instead of the default OpenGL-ES/EGL for those to not
|
||||
have problems and this conflicts with any **DRM** and **Wayland** support.
|
||||
You will
|
||||
|
||||
|
|
|
@ -58,7 +58,8 @@ group "E_Config" struct {
|
|||
value "winlist_mode" int: 1;
|
||||
value "winlist_large_size" double: 0.6666;
|
||||
value "winlist_list_size" double: 0.3333;
|
||||
value "winlist_list_no_miniatures" int: 0;
|
||||
value "winlist_list_no_miniatures" uchar: 0;
|
||||
value "no_state_hidden_desktop" uchar: 0;
|
||||
value "maximize_policy" int: 49;
|
||||
value "allow_manip" int: 0;
|
||||
value "border_fix_on_shelf_toggle" int: 0;
|
||||
|
@ -139,6 +140,8 @@ group "E_Config" struct {
|
|||
value "clientlist_max_caption_len" int: 2;
|
||||
value "mouse_hand" int: 1;
|
||||
value "mouse_accel" double: 0.0;
|
||||
value "mouse_flat_accel" uchar: 0;
|
||||
value "mouse_hires_scroll" uchar: 1;
|
||||
value "mouse_accel_threshold" int: 4;
|
||||
value "mouse_natural_scroll" uchar: 0;
|
||||
value "mouse_emulate_middle_button" uchar: 1;
|
||||
|
@ -146,6 +149,7 @@ group "E_Config" struct {
|
|||
value "touch_natural_scroll" uchar: 0;
|
||||
value "touch_emulate_middle_button" uchar: 1;
|
||||
value "touch_tap_to_click" uchar: 0;
|
||||
value "touch_flat_accel" uchar: 0;
|
||||
value "touch_clickpad" uchar: 1;
|
||||
value "touch_scrolling_2finger" uchar: 1;
|
||||
value "touch_scrolling_edge" uchar: 0;
|
||||
|
|
|
@ -54,7 +54,8 @@ group "E_Config" struct {
|
|||
value "winlist_mode" int: 1;
|
||||
value "winlist_large_size" double: 0.6666;
|
||||
value "winlist_list_size" double: 0.3333;
|
||||
value "winlist_list_no_miniatures" int: 0;
|
||||
value "winlist_list_no_miniatures" uchar: 0;
|
||||
value "no_state_hidden_desktop" uchar: 0;
|
||||
value "maximize_policy" int: 50;
|
||||
value "allow_manip" int: 0;
|
||||
value "border_fix_on_shelf_toggle" int: 0;
|
||||
|
@ -137,6 +138,8 @@ group "E_Config" struct {
|
|||
value "clientlist_max_caption_len" int: 2;
|
||||
value "mouse_hand" int: 1;
|
||||
value "mouse_accel" double: 0.0;
|
||||
value "mouse_flat_accel" uchar: 0;
|
||||
value "mouse_hires_scroll" uchar: 1;
|
||||
value "mouse_accel_threshold" int: 4;
|
||||
value "mouse_natural_scroll" uchar: 0;
|
||||
value "mouse_emulate_middle_button" uchar: 1;
|
||||
|
@ -144,6 +147,7 @@ group "E_Config" struct {
|
|||
value "touch_natural_scroll" uchar: 0;
|
||||
value "touch_emulate_middle_button" uchar: 1;
|
||||
value "touch_tap_to_click" uchar: 0;
|
||||
value "touch_flat_accel" uchar: 0;
|
||||
value "touch_clickpad" uchar: 1;
|
||||
value "touch_scrolling_2finger" uchar: 1;
|
||||
value "touch_scrolling_edge" uchar: 0;
|
||||
|
|
|
@ -54,7 +54,8 @@ group "E_Config" struct {
|
|||
value "winlist_mode" int: 1;
|
||||
value "winlist_large_size" double: 0.6666;
|
||||
value "winlist_list_size" double: 0.3333;
|
||||
value "winlist_list_no_miniatures" int: 0;
|
||||
value "winlist_list_no_miniatures" uchar: 0;
|
||||
value "no_state_hidden_desktop" uchar: 0;
|
||||
value "maximize_policy" int: 50;
|
||||
value "allow_manip" int: 0;
|
||||
value "border_fix_on_shelf_toggle" int: 0;
|
||||
|
@ -138,12 +139,15 @@ group "E_Config" struct {
|
|||
value "mouse_hand" int: 1;
|
||||
value "mouse_accel" double: 0.0;
|
||||
value "mouse_accel_threshold" int: 4;
|
||||
value "mouse_flat_accel" uchar: 0;
|
||||
value "mouse_hires_scroll" uchar: 1;
|
||||
value "mouse_natural_scroll" uchar: 0;
|
||||
value "mouse_emulate_middle_button" uchar: 1;
|
||||
value "touch_accel" double: 0.0;
|
||||
value "touch_natural_scroll" uchar: 0;
|
||||
value "touch_emulate_middle_button" uchar: 1;
|
||||
value "touch_tap_to_click" uchar: 0;
|
||||
value "touch_flat_accel" uchar: 0;
|
||||
value "touch_clickpad" uchar: 1;
|
||||
value "touch_scrolling_2finger" uchar: 1;
|
||||
value "touch_scrolling_edge" uchar: 0;
|
||||
|
|
|
@ -34,5 +34,5 @@ Comment[sr]=Пријавите се за коришћење Просвећења
|
|||
Comment[tr]=Enlightenment kullanarak giriş yaın (Version @VERSION@)
|
||||
Icon=@prefix@/share/enlightenment/data/images/enlightenment.png
|
||||
TryExec=@prefix@/bin/enlightenment_start
|
||||
Exec=@prefix@/bin/enlightenment_start
|
||||
Exec=env E_WL_FORCE=drm E_COMP_ENGINE=gl @prefix@/bin/enlightenment_start
|
||||
DesktopNames=Enlightenment
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
Type=XSession
|
||||
Name=Enlightenment
|
||||
Name[ca]=Enlightenment
|
||||
Name[de]=Enlightenment
|
||||
|
|
10
meson.build
10
meson.build
|
@ -1,6 +1,6 @@
|
|||
##### project
|
||||
project('enlightenment', 'c',
|
||||
version : '0.25.99',
|
||||
version : '0.26.99',
|
||||
license : 'BSD 2 clause',
|
||||
default_options: [ 'buildtype=release', 'c_std=gnu99', 'warning_level=2' ],
|
||||
meson_version : '>= 0.47.0')
|
||||
|
@ -30,7 +30,7 @@ else
|
|||
config_h.set('E_RELEASE_BUILD' , '1')
|
||||
endif
|
||||
|
||||
efl_version = '>= 1.26.0'
|
||||
efl_version = '>= 1.27.0'
|
||||
|
||||
add_global_arguments('-DHAVE_CONFIG_H=1', language: 'c')
|
||||
dir_prefix = get_option('prefix')
|
||||
|
@ -83,6 +83,11 @@ config_h.set('_POSIX_PTHREAD_SEMANTICS', '1')
|
|||
config_h.set('_TANDEM_SOURCE' , '1')
|
||||
config_h.set('__EXTENSIONS__' , '1')
|
||||
|
||||
str_ver_split = efl_version.replace('>= ', '').split('.')
|
||||
config_h.set('MIN_EFL_VERSION_MAJ', str_ver_split[0])
|
||||
config_h.set('MIN_EFL_VERSION_MIN', str_ver_split[1])
|
||||
config_h.set('MIN_EFL_VERSION_MIC', str_ver_split[2])
|
||||
|
||||
subdir('po')
|
||||
|
||||
darwin = host_machine.system().startswith('darwin')
|
||||
|
@ -293,6 +298,7 @@ dep_ecore_con = dependency('ecore-con' , required: true)
|
|||
dep_ecore_input = dependency('ecore-input' , required: true)
|
||||
dep_ecore_input_evas = dependency('ecore-input-evas', required: true)
|
||||
dep_ecore_evas = dependency('ecore-evas' , required: true)
|
||||
dep_ecore_audio = dependency('ecore-audio' , required: true)
|
||||
dep_evas = dependency('evas' , required: true)
|
||||
dep_edje = dependency('edje' , required: true)
|
||||
dep_efreet = dependency('efreet' , required: true)
|
||||
|
|
|
@ -132,6 +132,10 @@ option('connman',
|
|||
type: 'boolean',
|
||||
value: true,
|
||||
description: 'enable connman module: (default=true)')
|
||||
option('convertible',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
description: 'enable convertible module: (default=true)')
|
||||
option('cpufreq',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
|
|
|
@ -18,6 +18,7 @@ hr
|
|||
hu
|
||||
it
|
||||
ja
|
||||
ka
|
||||
km
|
||||
ko
|
||||
lt
|
||||
|
|
20946
po/fr_CH.po
20946
po/fr_CH.po
File diff suppressed because it is too large
Load Diff
19991
po/pt_BR.po
19991
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
19660
po/zh_CN.po
19660
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
19135
po/zh_TW.po
19135
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
|
@ -23,7 +23,7 @@ e_about_new(void)
|
|||
snprintf
|
||||
(buf, sizeof(buf), "%s%s",
|
||||
_(
|
||||
"<title>Copyright © 2000-2022, by the Enlightenment "
|
||||
"<title>Copyright © 2000-2024, by the Enlightenment "
|
||||
"Development Team</><ps/>"
|
||||
"<ps/>"
|
||||
"We hope you enjoy using this software as much as we enjoyed "
|
||||
|
|
|
@ -27,6 +27,9 @@ static Eina_Bool _e_bl_suspend = EINA_FALSE;
|
|||
static void _backlight_devices_device_set(Backlight_Device *bd, double val);
|
||||
static void _backlight_devices_device_update(Backlight_Device *bd);
|
||||
|
||||
#define MAX_BL_DIFF 0.15
|
||||
#define SET_RETRIES 5
|
||||
|
||||
static Eina_Bool
|
||||
_backlight_retry_timer_cb(void *data)
|
||||
{
|
||||
|
@ -45,17 +48,17 @@ _backlight_mismatch_retry(Backlight_Device *bd)
|
|||
((fabs(bd->expected_val - 1.0) < DBL_EPSILON) ||
|
||||
(fabs(bd->expected_val - e_config->backlight.normal) < DBL_EPSILON) ||
|
||||
(fabs(bd->expected_val - e_config->backlight.dim) < DBL_EPSILON)) &&
|
||||
// and the delta between expected and val >= 0.05
|
||||
(fabs(bd->expected_val - bd->val) >= 0.05) &&
|
||||
// and we retried < 20 times
|
||||
(bd->retries < 10) &&
|
||||
// and the delta between expected and val >= MAX_BL_DIFF
|
||||
(fabs(bd->expected_val - bd->val) >= MAX_BL_DIFF) &&
|
||||
// and we retried < SET_RETRIES times
|
||||
(bd->retries < SET_RETRIES) &&
|
||||
(_own_vt))
|
||||
{ // try again
|
||||
printf("RETRY backlight set as %1.2f != %1.2f (expected) try=%i\n",
|
||||
bd->val, bd->expected_val, bd->retries);
|
||||
bd->retries++;
|
||||
if (bd->retry_timer) ecore_timer_del(bd->retry_timer);
|
||||
bd->retry_timer = ecore_timer_add(0.1, _backlight_retry_timer_cb, bd);
|
||||
bd->retry_timer = ecore_timer_add(0.3, _backlight_retry_timer_cb, bd);
|
||||
} // or give up
|
||||
else bd->retries = 0;
|
||||
}
|
||||
|
@ -73,10 +76,10 @@ _backlight_system_get_cb(void *data, const char *params)
|
|||
if (!!strcmp(bd->dev, dev)) return;
|
||||
e_system_handler_del("bklight-val", _backlight_system_get_cb, bd);
|
||||
fval = (double)val / 1000.0;
|
||||
if (fabs(fval - bd->val) >= DBL_EPSILON)
|
||||
if (fabs(fval - bd->val) >= MAX_BL_DIFF)
|
||||
{
|
||||
bd->val = fval;
|
||||
ecore_event_add(E_EVENT_BACKLIGHT_CHANGE, NULL, NULL, NULL);
|
||||
// bd->val = fval;
|
||||
// ecore_event_add(E_EVENT_BACKLIGHT_CHANGE, NULL, NULL, NULL);
|
||||
_backlight_mismatch_retry(bd);
|
||||
}
|
||||
}
|
||||
|
@ -97,10 +100,10 @@ _backlight_system_ddc_get_cb(void *data, const char *params)
|
|||
if (val < 0) fval = -1.0;
|
||||
else fval = (double)val / 100.0;
|
||||
bd->ddc_max = max;
|
||||
if ((fabs(fval - bd->val) >= DBL_EPSILON) || (val == -1))
|
||||
if ((fabs(fval - bd->val) >= MAX_BL_DIFF) || (val == -1))
|
||||
{
|
||||
bd->val = fval;
|
||||
ecore_event_add(E_EVENT_BACKLIGHT_CHANGE, NULL, NULL, NULL);
|
||||
// bd->val = fval;
|
||||
// ecore_event_add(E_EVENT_BACKLIGHT_CHANGE, NULL, NULL, NULL);
|
||||
_backlight_mismatch_retry(bd);
|
||||
}
|
||||
}
|
||||
|
@ -791,7 +794,7 @@ e_backlight_level_set(E_Zone *zone, double val, double tim)
|
|||
if (fabs(tim) < DBL_EPSILON)
|
||||
{
|
||||
_backlight_devices_device_set(bd, val);
|
||||
_backlight_devices_device_update(bd);
|
||||
// _backlight_devices_device_update(bd);
|
||||
ecore_event_add(E_EVENT_BACKLIGHT_CHANGE, NULL, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -586,6 +586,8 @@ _e_client_free(E_Client *ec)
|
|||
if (ec->stack.prev) ec->stack.prev->stack.next = ec->stack.next;
|
||||
if (ec->stack.next) ec->stack.next->stack.prev = ec->stack.prev;
|
||||
|
||||
E_FREE_FUNC(ec->ignore_first_unmap_clear_timer, ecore_timer_del);
|
||||
|
||||
ec->e.state.profile.wait_desk = NULL;
|
||||
evas_object_del(ec->frame);
|
||||
E_OBJECT(ec)->references--;
|
||||
|
@ -2296,6 +2298,29 @@ _e_client_eval(E_Client *ec)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!ec->desktop && ec->icccm.class)
|
||||
{
|
||||
const char *p = strchr(ec->icccm.class, ' ');
|
||||
|
||||
if (p)
|
||||
{
|
||||
char *sp, *dup = strdup(ec->icccm.class);
|
||||
|
||||
if (dup)
|
||||
{
|
||||
for (sp = dup; *dup; sp++)
|
||||
{
|
||||
if (*sp == ' ')
|
||||
{
|
||||
*sp = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ec->desktop = efreet_util_desktop_exec_find(dup);
|
||||
free(dup);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ec->desktop && ec->icccm.name)
|
||||
{
|
||||
/* this works for most cases as fallback. useful when app is
|
||||
|
|
|
@ -302,6 +302,7 @@ struct E_Client
|
|||
|
||||
unsigned char ignore_first_unmap;
|
||||
E_Pointer_Mode resize_mode;
|
||||
Ecore_Timer *ignore_first_unmap_clear_timer;
|
||||
|
||||
struct
|
||||
{
|
||||
|
|
|
@ -749,7 +749,7 @@ _e_comp_object_shadow_setup(E_Comp_Object *cw)
|
|||
else
|
||||
edje_object_part_swallow(cw->shobj, "e.swallow.content", cw->obj);
|
||||
}
|
||||
if (cw->input_objs)
|
||||
if ((cw->input_objs) || ((cw->ec) && (cw->ec->shaped)))
|
||||
evas_object_pass_events_set(cw->obj, 1);
|
||||
else
|
||||
evas_object_pass_events_set(cw->obj, 0);
|
||||
|
|
|
@ -2881,7 +2881,7 @@ disp_err:
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_comp_wl_desklock_show(void)
|
||||
_e_comp_wl_desklock_show(Eina_Bool immediate EINA_UNUSED)
|
||||
{
|
||||
return e_comp_grab_input(1, 1);
|
||||
}
|
||||
|
|
|
@ -77,6 +77,7 @@ static int screen_size_index = -1;
|
|||
static Ecore_X_Atom backlight_atom = 0;
|
||||
|
||||
static Ecore_Timer *mouse_in_fix_check_timer = NULL;
|
||||
static Ecore_Timer *_e_comp_x_blank_apply_timer = NULL;
|
||||
|
||||
static Eina_Hash *dead_wins;
|
||||
|
||||
|
@ -3463,6 +3464,16 @@ _e_comp_x_frame_extents_adjust(E_Client *ec, int exl, int exr, int ext, int exb)
|
|||
}
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_cb_e_comp_x_ignore_first_unmap_clear_timer(void *data)
|
||||
{
|
||||
E_Client *ec = data;
|
||||
|
||||
ec->ignore_first_unmap_clear_timer = NULL;
|
||||
if (ec->ignore_first_unmap > 0) ec->ignore_first_unmap--;
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_x_hook_client_pre_frame_assign(void *d EINA_UNUSED, E_Client *ec)
|
||||
{
|
||||
|
@ -3515,6 +3526,9 @@ _e_comp_x_hook_client_pre_frame_assign(void *d EINA_UNUSED, E_Client *ec)
|
|||
if (!ec->internal)
|
||||
ecore_x_window_save_set_add(win);
|
||||
ec->ignore_first_unmap++;
|
||||
E_FREE_FUNC(ec->ignore_first_unmap_clear_timer, ecore_timer_del);
|
||||
ec->ignore_first_unmap_clear_timer = ecore_timer_add
|
||||
(0.2, _cb_e_comp_x_ignore_first_unmap_clear_timer, ec);
|
||||
ecore_x_window_reparent(win, pwin, 0, 0);
|
||||
e_pixmap_alias(ep, E_PIXMAP_TYPE_X, pwin);
|
||||
|
||||
|
@ -5312,6 +5326,7 @@ _e_comp_cb_pointer_suspend_resume_done(void *data, Evas_Object *obj, const char
|
|||
e_pointer_grab_set(e_comp->pointer, EINA_FALSE);
|
||||
}
|
||||
e_screensaver_update();
|
||||
e_dpms_force_update();
|
||||
}
|
||||
|
||||
EINTERN Eina_Bool
|
||||
|
@ -5366,6 +5381,7 @@ _e_comp_x_screensaver_off()
|
|||
const char *s;
|
||||
|
||||
e_screensaver_update();
|
||||
e_dpms_force_update();
|
||||
_e_comp_pointer_ungrab();
|
||||
e_pointer_grab_set(e_comp->pointer, EINA_FALSE);
|
||||
if ((!e_comp->pointer) || (!e_comp->pointer->o_ptr)) return ECORE_CALLBACK_RENEW;
|
||||
|
@ -5746,6 +5762,9 @@ _e_comp_x_manage_windows(void)
|
|||
evas_object_geometry_set(ec->frame, ec->client.x, ec->client.y, ec->client.w, ec->client.h);
|
||||
}
|
||||
ec->ignore_first_unmap = 1;
|
||||
E_FREE_FUNC(ec->ignore_first_unmap_clear_timer, ecore_timer_del);
|
||||
ec->ignore_first_unmap_clear_timer = ecore_timer_add
|
||||
(0.2, _cb_e_comp_x_ignore_first_unmap_clear_timer, ec);
|
||||
if (ec->override || (!ec->icccm.fetch.hints))
|
||||
evas_object_show(ec->frame);
|
||||
_e_comp_x_client_stack(ec);
|
||||
|
@ -5808,7 +5827,7 @@ _e_comp_x_desklock_hide(void)
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_comp_x_desklock_show(void)
|
||||
_e_comp_x_desklock_show(Eina_Bool immedate EINA_UNUSED)
|
||||
{
|
||||
if (!e_comp_grab_input(1, 1))
|
||||
{
|
||||
|
@ -6015,6 +6034,13 @@ _e_comp_x_screens_setup(void)
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_comp_x_blank_apply(void *data EINA_UNUSED)
|
||||
{
|
||||
e_screensaver_force_update();
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
E_API Eina_Bool
|
||||
e_comp_x_init(void)
|
||||
{
|
||||
|
@ -6182,6 +6208,8 @@ e_comp_x_init(void)
|
|||
e_config->screensaver_blanking,
|
||||
e_config->screensaver_expose);
|
||||
e_comp_x_devices_config_apply(EINA_FALSE);
|
||||
_e_comp_x_blank_apply_timer = ecore_timer_add
|
||||
(10.0, _e_comp_x_blank_apply, NULL);
|
||||
}
|
||||
else
|
||||
e_dnd_init();
|
||||
|
@ -6192,6 +6220,11 @@ e_comp_x_init(void)
|
|||
E_API void
|
||||
e_comp_x_shutdown(void)
|
||||
{
|
||||
if (_e_comp_x_blank_apply_timer)
|
||||
{
|
||||
ecore_timer_del(_e_comp_x_blank_apply_timer);
|
||||
_e_comp_x_blank_apply_timer = NULL;
|
||||
}
|
||||
_e_comp_x_del(e_comp);
|
||||
E_FREE_LIST(handlers, ecore_event_handler_del);
|
||||
E_FREE_FUNC(clients_win_hash, eina_hash_free);
|
||||
|
|
|
@ -144,11 +144,44 @@ _handle_dev_prop(int dev_slot, const char *dev, const char *prop, Device_Flags d
|
|||
}
|
||||
free(val);
|
||||
}
|
||||
// not for now - default
|
||||
// else if (!strcmp(prop, "libinput Accel Profile Enabled"))
|
||||
// {
|
||||
// // 1 bool, 0 = adaptive, 1 = flat
|
||||
// }
|
||||
else if (!strcmp(prop, "libinput Accel Profile Enabled"))
|
||||
{
|
||||
// 1 bool, 0 = adaptive, 1 = flat
|
||||
unsigned char cfval = 0;
|
||||
unsigned char *val = ecore_x_input_device_property_get
|
||||
(dev_slot, prop, &num, &fmt, &size);
|
||||
if (dev_flags == DEVICE_FLAG_TOUCHPAD)
|
||||
cfval = e_config->touch_flat_accel;
|
||||
else
|
||||
cfval = e_config->mouse_flat_accel;
|
||||
|
||||
if ((val) && (size == 8) && (num == 2) && (((cfval == 1) && (val[0] == 1)) ||
|
||||
((cfval == 0) && (val[0] == 0))))
|
||||
{
|
||||
// Does a little flip-flop for each variable
|
||||
val[0] = !cfval;
|
||||
val[1] = cfval;
|
||||
printf("DEV: change [%s] [%s] -> %i, %i\n", dev, prop, val[0], val[1]);
|
||||
ecore_x_input_device_property_set
|
||||
(dev_slot, prop, val, num, fmt, size);
|
||||
}
|
||||
free(val);
|
||||
}
|
||||
else if (!strcmp(prop, "libinput High Resolution Wheel Scroll Enabled"))
|
||||
{
|
||||
unsigned char cfval = e_config->mouse_hires_scroll;
|
||||
unsigned char *val = ecore_x_input_device_property_get
|
||||
(dev_slot, prop, &num, &fmt, &size);
|
||||
|
||||
if ((val) && (size == 8) && (num == 1) && (cfval != val[0]))
|
||||
{
|
||||
val[0] = cfval;
|
||||
printf("DEV: change [%s] [%s] -> %i\n", dev, prop, val[0]);
|
||||
ecore_x_input_device_property_set
|
||||
(dev_slot, prop, val, num, fmt, size);
|
||||
}
|
||||
free(val);
|
||||
}
|
||||
// do via button mapping for now - not sure about this evdev can't do this
|
||||
// else if (!strcmp(prop, "libinput Left Handed Enabled"))
|
||||
// {
|
||||
|
|
|
@ -20,6 +20,7 @@ static Eina_Bool _rotation_exists(int rot, Ecore_X_Randr_Crtc_Info *info);
|
|||
static Ecore_X_Randr_Mode _mode_screen_find(Ecore_X_Window root, E_Randr2_Screen *s, Ecore_X_Randr_Output out);
|
||||
|
||||
static Eina_List *handlers;
|
||||
static int use_xrandr = -1;
|
||||
|
||||
E_Comp_Screen_Iface xiface =
|
||||
{
|
||||
|
@ -501,9 +502,168 @@ e_comp_x_randr_shutdown(void)
|
|||
E_FREE_LIST(handlers, ecore_event_handler_del);
|
||||
}
|
||||
|
||||
E_API void
|
||||
e_comp_x_randr_config_apply(void)
|
||||
static void
|
||||
_e_comp_xrandr_cmd(void)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Randr2_Screen *s;
|
||||
Ecore_X_Window root = ecore_x_window_root_first_get();
|
||||
int top_priority = 0;
|
||||
Ecore_X_Randr_Crtc *crtcs = NULL;
|
||||
Ecore_X_Randr_Output *outputs = NULL, out, *outconf;
|
||||
E_Randr2_Screen **screenconf;
|
||||
Ecore_X_Randr_Crtc_Info *info;
|
||||
int crtcs_num = 0, outputs_num = 0, i, numout;
|
||||
|
||||
crtcs = ecore_x_randr_crtcs_get(root, &crtcs_num);
|
||||
outputs = ecore_x_randr_outputs_get(root, &outputs_num);
|
||||
|
||||
printf("RRR: crtcs=%p outputs=%p\n", crtcs, outputs);
|
||||
if ((crtcs) && (outputs))
|
||||
{
|
||||
outconf = alloca(outputs_num * sizeof(Ecore_X_Randr_Output));
|
||||
screenconf = alloca(outputs_num * sizeof(E_Randr2_Screen *));
|
||||
memset(outconf, 0, outputs_num * sizeof(Ecore_X_Randr_Output));
|
||||
memset(screenconf, 0, outputs_num * sizeof(E_Randr2_Screen *));
|
||||
|
||||
// decide which outputs get which crtcs
|
||||
EINA_LIST_FOREACH(e_randr2->screens, l, s)
|
||||
{
|
||||
printf("RRR: find output for '%s'\n", s->info.name);
|
||||
// XXX: find clones and set them as outputs in an array
|
||||
if ((s->config.configured) &&
|
||||
(_output_name_find(root, s->info.name, outputs,
|
||||
outputs_num, &out)))
|
||||
{
|
||||
printf("RRR: enabled: %i\n", s->config.enabled);
|
||||
if (s->config.enabled)
|
||||
{
|
||||
if (s->config.priority > top_priority)
|
||||
top_priority = s->config.priority;
|
||||
for (i = 0; i < outputs_num; i++)
|
||||
{
|
||||
if (!screenconf[i])
|
||||
{
|
||||
Ecore_X_Randr_Crtc crtc =
|
||||
ecore_x_randr_output_crtc_get(root,
|
||||
outputs[i]);
|
||||
info = NULL;
|
||||
printf("RRR: crtc slot empty: %i, crtc=%i, output=%i\n", i, crtc, outputs[i]);
|
||||
if (crtc)
|
||||
info = ecore_x_randr_crtc_info_get(root,
|
||||
crtc);
|
||||
printf("RRR: crtc info = %p\n", info);
|
||||
if (info)
|
||||
{
|
||||
printf("RRR: output exists=%i rot exists=%i\n",
|
||||
_output_exists(out, info), _rotation_exists(s->config.rotation, info));
|
||||
if (_output_exists(out, info) &&
|
||||
_rotation_exists(s->config.rotation,
|
||||
info))
|
||||
{
|
||||
printf("RRR: assign slot out: %x\n", out);
|
||||
outconf[i] = out;
|
||||
screenconf[i] = s;
|
||||
}
|
||||
ecore_x_randr_crtc_info_free(info);
|
||||
}
|
||||
if (!screenconf[i])
|
||||
{
|
||||
printf("RRR: assign slot off\n");
|
||||
outconf[i] = 0;
|
||||
screenconf[i] = s;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < outputs_num; i++)
|
||||
{
|
||||
if (!screenconf[i])
|
||||
{
|
||||
printf("RRR: assign slot off 2\n");
|
||||
outconf[i] = 0;
|
||||
screenconf[i] = s;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
numout = 0;
|
||||
for (i = 0; i < outputs_num; i++)
|
||||
{
|
||||
if (screenconf[i]) numout++;
|
||||
}
|
||||
if (numout)
|
||||
{
|
||||
Eina_Strbuf *sb;
|
||||
E_Randr2_Screen *sc;
|
||||
|
||||
sb = eina_strbuf_new();
|
||||
eina_strbuf_append(sb, "xrandr ");
|
||||
// set up a crtc to drive each output (or not)
|
||||
for (i = 0; i < numout; i++)
|
||||
{
|
||||
sc = screenconf[i];
|
||||
if (!sc) continue;
|
||||
if (!sc->info.name) continue;
|
||||
eina_strbuf_append_printf(sb, "--output '%s' ",
|
||||
sc->info.name);
|
||||
// XXX: find clones and set them as outputs in an array
|
||||
if (outconf[i])
|
||||
{
|
||||
eina_strbuf_append_printf(sb, "--mode %ix%i ",
|
||||
sc->config.mode.w,
|
||||
sc->config.mode.h);
|
||||
eina_strbuf_append_printf(sb, "--refresh %i.%02i ",
|
||||
(int)sc->config.mode.refresh,
|
||||
(int)((sc->config.mode.refresh - (int)sc->config.mode.refresh) * 100));
|
||||
eina_strbuf_append_printf(sb, "--rotate ");
|
||||
if (screenconf[i]->config.rotation == 0)
|
||||
eina_strbuf_append_printf(sb, "normal ");
|
||||
else if (screenconf[i]->config.rotation == 90)
|
||||
eina_strbuf_append_printf(sb, "left ");
|
||||
else if (screenconf[i]->config.rotation == 180)
|
||||
eina_strbuf_append_printf(sb, "inverted ");
|
||||
else if (screenconf[i]->config.rotation == 270)
|
||||
eina_strbuf_append_printf(sb, "right ");
|
||||
eina_strbuf_append_printf(sb, "--pos %ix%i ",
|
||||
sc->config.geom.x,
|
||||
sc->config.geom.y);
|
||||
if (screenconf[i]->config.priority == top_priority)
|
||||
{
|
||||
eina_strbuf_append_printf(sb, "--primary ");
|
||||
top_priority = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("RRR: crtc off: %i\n", i);
|
||||
eina_strbuf_append_printf(sb, "--off ");
|
||||
}
|
||||
}
|
||||
printf("RRR: XRANDR: %s\n", eina_strbuf_string_get(sb));
|
||||
ecore_exe_run(eina_strbuf_string_get(sb), NULL);
|
||||
eina_strbuf_free(sb);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("RRR: EERRRRRROOOORRRRRRR no outputs to configure!\n");
|
||||
ecore_timer_add(5.0, _cb_no_outputs_timer, NULL);
|
||||
ecore_x_root_screen_barriers_set(NULL, 0);
|
||||
}
|
||||
}
|
||||
free(outputs);
|
||||
free(crtcs);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_comp_xrandr_ecore_x(void)
|
||||
{
|
||||
|
||||
Eina_List *l;
|
||||
E_Randr2_Screen *s;
|
||||
Ecore_X_Window root = ecore_x_window_root_first_get();
|
||||
|
@ -548,12 +708,13 @@ e_comp_x_randr_config_apply(void)
|
|||
crtcs = ecore_x_randr_crtcs_get(root, &crtcs_num);
|
||||
outputs = ecore_x_randr_outputs_get(root, &outputs_num);
|
||||
|
||||
printf("RRR: crtcs=%p outputs=%p\n", crtcs, outputs);
|
||||
if ((crtcs) && (outputs))
|
||||
{
|
||||
outconf = alloca(crtcs_num * sizeof(Ecore_X_Randr_Output));
|
||||
screenconf = alloca(crtcs_num * sizeof(E_Randr2_Screen *));
|
||||
memset(outconf, 0, crtcs_num * sizeof(Ecore_X_Randr_Output));
|
||||
memset(screenconf, 0, crtcs_num * sizeof(E_Randr2_Screen *));
|
||||
outconf = alloca(outputs_num * sizeof(Ecore_X_Randr_Output));
|
||||
screenconf = alloca(outputs_num * sizeof(E_Randr2_Screen *));
|
||||
memset(outconf, 0, outputs_num * sizeof(Ecore_X_Randr_Output));
|
||||
memset(screenconf, 0, outputs_num * sizeof(E_Randr2_Screen *));
|
||||
|
||||
// decide which outputs get which crtcs
|
||||
EINA_LIST_FOREACH(e_randr2->screens, l, s)
|
||||
|
@ -569,7 +730,7 @@ e_comp_x_randr_config_apply(void)
|
|||
{
|
||||
if (s->config.priority > top_priority)
|
||||
top_priority = s->config.priority;
|
||||
for (i = 0; i < crtcs_num; i++)
|
||||
for (i = 0; i < outputs_num; i++)
|
||||
{
|
||||
if (!outconf[i])
|
||||
{
|
||||
|
@ -596,18 +757,18 @@ e_comp_x_randr_config_apply(void)
|
|||
}
|
||||
}
|
||||
numout = 0;
|
||||
for (i = 0; i < crtcs_num; i++)
|
||||
for (i = 0; i < outputs_num; i++)
|
||||
{
|
||||
if (outconf[i]) numout++;
|
||||
}
|
||||
if (numout)
|
||||
{
|
||||
Ecore_X_Rectangle *scrs = alloca(crtcs_num * sizeof(Ecore_X_Rectangle));
|
||||
Ecore_X_Rectangle *scrs = alloca(numout * sizeof(Ecore_X_Rectangle));
|
||||
int scrs_num;
|
||||
|
||||
scrs_num = 0;
|
||||
// set up a crtc to drive each output (or not)
|
||||
for (i = 0; i < crtcs_num; i++)
|
||||
for (i = 0; i < numout; i++)
|
||||
{
|
||||
// XXX: find clones and set them as outputs in an array
|
||||
if (outconf[i])
|
||||
|
@ -637,7 +798,7 @@ e_comp_x_randr_config_apply(void)
|
|||
screenconf[i]->config.geom.x,
|
||||
screenconf[i]->config.geom.y,
|
||||
mode, orient))
|
||||
printf("RRR: failed to set crtc!!!!!!\n");
|
||||
printf("RRR: failed to set crtc!!!!!!\n");
|
||||
if (E_INSIDE(px, py,
|
||||
screenconf[i]->config.geom.x,
|
||||
screenconf[i]->config.geom.y,
|
||||
|
@ -689,7 +850,7 @@ e_comp_x_randr_config_apply(void)
|
|||
free(outputs);
|
||||
free(crtcs);
|
||||
|
||||
printf("RRR: set vsize: %ix%i\n", nw, nh);
|
||||
printf("RRR: set vsize2: %ix%i\n", nw, nh);
|
||||
ecore_x_randr_screen_current_size_set(root, nw, nh, -1, -1);
|
||||
{
|
||||
int dww = 0, dhh = 0, dww2 = 0, dhh2 = 0;
|
||||
|
@ -704,7 +865,6 @@ e_comp_x_randr_config_apply(void)
|
|||
ecore_x_randr_screen_size_range_get(root, NULL, NULL, NULL, NULL);
|
||||
ecore_x_ungrab();
|
||||
ecore_x_sync();
|
||||
|
||||
// ignore the next batch of randr events - we caused them ourselves
|
||||
// XXX: a problem. thew first time we configure the screen we may not
|
||||
// get any events back to clear the ignore flag below, so only apply
|
||||
|
@ -712,6 +872,22 @@ e_comp_x_randr_config_apply(void)
|
|||
// event_ignore = EINA_TRUE;
|
||||
}
|
||||
|
||||
E_API void
|
||||
e_comp_x_randr_config_apply(void)
|
||||
{
|
||||
if (e_randr2_cfg->use_cmd)
|
||||
{
|
||||
if (use_xrandr == -1)
|
||||
{
|
||||
if (ecore_file_app_installed("xrandr")) use_xrandr = 1;
|
||||
else use_xrandr = 0;
|
||||
}
|
||||
}
|
||||
else use_xrandr = 0;
|
||||
if (use_xrandr == 1) _e_comp_xrandr_cmd();
|
||||
else _e_comp_xrandr_ecore_x();
|
||||
}
|
||||
|
||||
E_API Eina_Bool
|
||||
e_comp_x_randr_available(void)
|
||||
{
|
||||
|
|
|
@ -750,6 +750,7 @@ _e_config_edd_init(Eina_Bool old)
|
|||
E_CONFIG_VAL(D, T, winlist_list_size, DOUBLE); /**/
|
||||
E_CONFIG_VAL(D, T, winlist_large_size, DOUBLE); /**/
|
||||
E_CONFIG_VAL(D, T, winlist_list_no_miniatures, UCHAR); /**/
|
||||
E_CONFIG_VAL(D, T, no_state_hidden_desktop, UCHAR); /**/
|
||||
E_CONFIG_VAL(D, T, maximize_policy, INT); /**/
|
||||
E_CONFIG_VAL(D, T, allow_manip, INT); /**/
|
||||
E_CONFIG_VAL(D, T, border_fix_on_shelf_toggle, INT); /**/
|
||||
|
@ -855,8 +856,10 @@ _e_config_edd_init(Eina_Bool old)
|
|||
E_CONFIG_VAL(D, T, mouse_hand, INT);
|
||||
|
||||
E_CONFIG_VAL(D, T, mouse_accel, DOUBLE);
|
||||
E_CONFIG_VAL(D, T, mouse_flat_accel, UCHAR);
|
||||
E_CONFIG_VAL(D, T, mouse_accel_threshold, INT);
|
||||
E_CONFIG_VAL(D, T, mouse_natural_scroll, UCHAR);
|
||||
E_CONFIG_VAL(D, T, mouse_hires_scroll, UCHAR);
|
||||
E_CONFIG_VAL(D, T, mouse_emulate_middle_button, UCHAR);
|
||||
|
||||
E_CONFIG_VAL(D, T, touch_accel, DOUBLE);
|
||||
|
@ -864,6 +867,7 @@ _e_config_edd_init(Eina_Bool old)
|
|||
E_CONFIG_VAL(D, T, touch_emulate_middle_button, UCHAR);
|
||||
E_CONFIG_VAL(D, T, touch_tap_to_click, UCHAR);
|
||||
E_CONFIG_VAL(D, T, touch_clickpad, UCHAR);
|
||||
E_CONFIG_VAL(D, T, touch_flat_accel, UCHAR);
|
||||
E_CONFIG_VAL(D, T, touch_scrolling_2finger, UCHAR);
|
||||
E_CONFIG_VAL(D, T, touch_scrolling_edge, UCHAR);
|
||||
E_CONFIG_VAL(D, T, touch_scrolling_circular, UCHAR);
|
||||
|
@ -1801,6 +1805,14 @@ e_config_load(void)
|
|||
e_config->backlight.ddc = 1;
|
||||
e_config_save_queue();
|
||||
}
|
||||
CONFIG_VERSION_CHECK(36)
|
||||
{
|
||||
CONFIG_VERSION_UPDATE_INFO(36);
|
||||
e_config->mouse_flat_accel = 0;
|
||||
e_config->mouse_hires_scroll = 1;
|
||||
e_config->touch_flat_accel = 0;
|
||||
e_config_save_queue();
|
||||
}
|
||||
}
|
||||
elm_config_profile_set(_e_config_profile);
|
||||
if (!e_config->remember_internal_fm_windows)
|
||||
|
|
|
@ -135,6 +135,7 @@ struct _E_Config
|
|||
double winlist_list_size; // GUI
|
||||
double winlist_large_size; // GUI
|
||||
Eina_Bool winlist_list_no_miniatures; // GUI
|
||||
Eina_Bool no_state_hidden_desktop; // GUI
|
||||
int maximize_policy; // GUI
|
||||
int allow_manip; // GUI
|
||||
int border_fix_on_shelf_toggle; // GUI
|
||||
|
@ -245,12 +246,15 @@ struct _E_Config
|
|||
int mouse_hand; //GUI
|
||||
double mouse_accel; // GUI
|
||||
int mouse_accel_threshold; // GUI
|
||||
unsigned char mouse_flat_accel; // GUI
|
||||
unsigned char mouse_natural_scroll; // GUI
|
||||
unsigned char mouse_hires_scroll; // GUI
|
||||
unsigned char mouse_emulate_middle_button; // GUI
|
||||
|
||||
double touch_accel; // GUI
|
||||
unsigned char touch_natural_scroll; // GUI
|
||||
unsigned char touch_emulate_middle_button; // GUI
|
||||
unsigned char touch_flat_accel; // GUI
|
||||
unsigned char touch_tap_to_click; // GUI
|
||||
unsigned char touch_clickpad; // GUI
|
||||
unsigned char touch_scrolling_2finger; // GUI
|
||||
|
|
|
@ -434,16 +434,13 @@ e_dbusmenu_item_unref(E_DBusMenu_Item *m)
|
|||
E_API void
|
||||
e_dbusmenu_unload(E_DBusMenu_Ctx *ctx)
|
||||
{
|
||||
Eldbus_Connection *conn;
|
||||
Eldbus_Object *obj;
|
||||
EINA_SAFETY_ON_NULL_RETURN(ctx);
|
||||
|
||||
if (ctx->root_menu) e_dbusmenu_item_unref(ctx->root_menu);
|
||||
obj = eldbus_proxy_object_get(ctx->proxy);
|
||||
conn = eldbus_object_connection_get(obj);
|
||||
eldbus_proxy_unref(ctx->proxy);
|
||||
eldbus_object_unref(obj);
|
||||
eldbus_connection_unref(conn);
|
||||
free(ctx);
|
||||
}
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ e_desklock_interface_append(E_Desklock_Interface *iface)
|
|||
desklock_ifaces = eina_list_append(desklock_ifaces, (void*)iface);
|
||||
if (_e_desklock_state && (!current_iface))
|
||||
{
|
||||
if (iface->show())
|
||||
if (iface->show(EINA_TRUE))
|
||||
{
|
||||
iface->active = EINA_TRUE;
|
||||
current_iface = iface;
|
||||
|
@ -155,7 +155,7 @@ e_desklock_interface_remove(E_Desklock_Interface *iface)
|
|||
/* then try to find a replacement locker */
|
||||
EINA_LIST_REVERSE_FOREACH(desklock_ifaces, l, diface)
|
||||
{
|
||||
if (!diface->show()) continue;
|
||||
if (!diface->show(EINA_TRUE)) continue;
|
||||
diface->active = EINA_TRUE;
|
||||
current_iface = diface;
|
||||
break;
|
||||
|
@ -209,7 +209,7 @@ e_desklock_demo(void)
|
|||
|
||||
EINA_LIST_REVERSE_FOREACH(desklock_ifaces, l, iface)
|
||||
{
|
||||
if (iface->show())
|
||||
if (iface->show(EINA_FALSE))
|
||||
{
|
||||
demo = iface->active = EINA_TRUE;
|
||||
current_iface = iface;
|
||||
|
@ -254,7 +254,7 @@ _desklock_show_internal(Eina_Bool suspend)
|
|||
e_menu_hide_all();
|
||||
EINA_LIST_FOREACH(show_hooks, l, show_cb)
|
||||
{
|
||||
if (!show_cb()) goto fail;
|
||||
if (!show_cb(suspend)) goto fail;
|
||||
}
|
||||
|
||||
EINA_LIST_FOREACH(e_comp->zones, l, zone)
|
||||
|
@ -278,6 +278,28 @@ _desklock_show_internal(Eina_Bool suspend)
|
|||
if (e_config->desklock_language)
|
||||
e_intl_language_set(e_config->desklock_language);
|
||||
|
||||
if ((e_config->xkb.lock_layout) && (e_config->xkb.desklock_layout))
|
||||
{
|
||||
if ((!e_config->xkb.lock_layout->name) ||
|
||||
(!!strcmp(e_config->xkb.lock_layout->name, e_config->xkb.desklock_layout)))
|
||||
{
|
||||
e_config_xkb_layout_free(e_config->xkb.lock_layout);
|
||||
e_config->xkb.lock_layout = NULL;
|
||||
}
|
||||
}
|
||||
if ((e_config->xkb.desklock_layout) && (!e_config->xkb.lock_layout))
|
||||
{
|
||||
E_Config_XKB_Layout *cl;
|
||||
|
||||
EINA_LIST_FOREACH(e_config->xkb.used_layouts, l, cl)
|
||||
{
|
||||
if ((cl->name) && (!strcmp(cl->name, e_config->xkb.desklock_layout)))
|
||||
{
|
||||
e_config->xkb.lock_layout = e_config_xkb_layout_dup(cl);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e_config->xkb.lock_layout)
|
||||
e_xkb_layout_set(e_config->xkb.lock_layout);
|
||||
|
||||
|
@ -295,7 +317,7 @@ _desklock_show_internal(Eina_Bool suspend)
|
|||
|
||||
EINA_LIST_REVERSE_FOREACH(desklock_ifaces, l, iface)
|
||||
{
|
||||
success = iface->show();
|
||||
success = iface->show(suspend);
|
||||
if (success)
|
||||
{
|
||||
iface->active = EINA_TRUE;
|
||||
|
@ -507,8 +529,6 @@ _e_desklock_cb_run(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
|||
E_Order *desk_run;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
if (!ev->suspend) return ECORE_CALLBACK_PASS_ON;
|
||||
|
||||
if (ev->on)
|
||||
{
|
||||
e_user_dir_concat_static(buf, "applications/desk-lock/.order");
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef struct _E_Event_Desklock E_Event_Desklock;
|
||||
typedef Eina_Bool (*E_Desklock_Show_Cb)(void);
|
||||
typedef Eina_Bool (*E_Desklock_Show_Cb)(Eina_Bool immediate);
|
||||
typedef void (*E_Desklock_Hide_Cb)(void);
|
||||
|
||||
typedef enum _E_Desklock_Background_Method {
|
||||
|
|
|
@ -13,6 +13,7 @@ static unsigned int _e_dpms_timeout_standby = 0;
|
|||
static unsigned int _e_dpms_timeout_suspend = 0;
|
||||
static unsigned int _e_dpms_timeout_off = 0;
|
||||
static int _e_dpms_enabled = EINA_FALSE;
|
||||
E_API Eina_Bool e_dpms_actual = EINA_FALSE;
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
static Eina_List *handlers;
|
||||
|
@ -21,10 +22,6 @@ static Ecore_Timer *suspend_timer;
|
|||
static Ecore_Timer *off_timer;
|
||||
#endif
|
||||
|
||||
#define STANDBY 10
|
||||
#define SUSPEND 11
|
||||
#define OFF 12
|
||||
|
||||
E_API void
|
||||
e_dpms_update(void)
|
||||
{
|
||||
|
@ -35,6 +32,7 @@ e_dpms_update(void)
|
|||
enabled = ((e_config->screensaver_enable) &&
|
||||
(!((e_util_fullscreen_any()) &&
|
||||
(e_config->no_dpms_on_fullscreen))));
|
||||
if (e_screensaver_current_timeout_get() == 0) enabled = EINA_FALSE;
|
||||
if (_e_dpms_enabled != enabled)
|
||||
{
|
||||
_e_dpms_enabled = enabled;
|
||||
|
@ -42,9 +40,15 @@ e_dpms_update(void)
|
|||
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
||||
{
|
||||
if (!e_config->screensaver_dpms_off)
|
||||
ecore_x_dpms_enabled_set(enabled);
|
||||
{
|
||||
ecore_x_dpms_enabled_set(enabled);
|
||||
e_dpms_actual = enabled;
|
||||
}
|
||||
else
|
||||
ecore_x_dpms_enabled_set(0);
|
||||
{
|
||||
ecore_x_dpms_enabled_set(0);
|
||||
e_dpms_actual = EINA_FALSE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -53,9 +57,9 @@ e_dpms_update(void)
|
|||
if (e_config->screensaver_enable)
|
||||
{
|
||||
off = suspend = standby = e_screensaver_timeout_get(EINA_FALSE);
|
||||
standby += STANDBY;
|
||||
suspend += SUSPEND;
|
||||
off += OFF;
|
||||
standby += E_DPMS_STANDBY;
|
||||
suspend += E_DPMS_SUSPEND;
|
||||
off += E_DPMS_OFF;
|
||||
}
|
||||
if (_e_dpms_timeout_standby != standby)
|
||||
{
|
||||
|
@ -87,13 +91,20 @@ e_dpms_force_update(void)
|
|||
int enabled;
|
||||
|
||||
enabled = (e_config->screensaver_enable);
|
||||
if (e_screensaver_current_timeout_get() == 0) enabled = EINA_FALSE;
|
||||
#ifndef HAVE_WAYLAND_ONLY
|
||||
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
||||
{
|
||||
if (!e_config->screensaver_dpms_off)
|
||||
ecore_x_dpms_enabled_set(enabled);
|
||||
{
|
||||
ecore_x_dpms_enabled_set(enabled);
|
||||
e_dpms_actual = enabled;
|
||||
}
|
||||
else
|
||||
ecore_x_dpms_enabled_set(0);
|
||||
{
|
||||
ecore_x_dpms_enabled_set(0);
|
||||
e_dpms_actual = EINA_FALSE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!enabled) return;
|
||||
|
@ -101,9 +112,9 @@ e_dpms_force_update(void)
|
|||
if (e_config->screensaver_enable)
|
||||
{
|
||||
off = suspend = standby = e_screensaver_timeout_get(EINA_FALSE);
|
||||
standby += STANDBY;
|
||||
suspend += SUSPEND;
|
||||
off += OFF;
|
||||
standby += E_DPMS_STANDBY;
|
||||
suspend += E_DPMS_SUSPEND;
|
||||
off += E_DPMS_OFF;
|
||||
}
|
||||
#ifndef HAVE_WAYLAND_ONLY
|
||||
if (e_comp->comp_type != E_PIXMAP_TYPE_X) return;
|
||||
|
@ -171,9 +182,9 @@ _e_dpms_off(void *d EINA_UNUSED)
|
|||
static Eina_Bool
|
||||
_e_dpms_screensaver_on()
|
||||
{
|
||||
standby_timer = ecore_timer_loop_add(STANDBY, _e_dpms_standby, NULL);
|
||||
suspend_timer = ecore_timer_loop_add(SUSPEND, _e_dpms_suspend, NULL);
|
||||
off_timer = ecore_timer_loop_add(OFF, _e_dpms_off, NULL);
|
||||
standby_timer = ecore_timer_loop_add(E_DPMS_STANDBY, _e_dpms_standby, NULL);
|
||||
suspend_timer = ecore_timer_loop_add(E_DPMS_SUSPEND, _e_dpms_suspend, NULL);
|
||||
off_timer = ecore_timer_loop_add(E_DPMS_OFF, _e_dpms_off, NULL);
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,11 +3,17 @@
|
|||
#ifndef E_DPMS_H
|
||||
#define E_DPMS_H
|
||||
|
||||
#define E_DPMS_STANDBY 10
|
||||
#define E_DPMS_SUSPEND 11
|
||||
#define E_DPMS_OFF 12
|
||||
|
||||
EINTERN int e_dpms_init(void);
|
||||
EINTERN int e_dpms_shutdown(void);
|
||||
|
||||
E_API void e_dpms_update(void);
|
||||
E_API void e_dpms_force_update(void);
|
||||
|
||||
E_API extern Eina_Bool e_dpms_actual;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -599,6 +599,7 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining)
|
|||
if (startup_id < 0) startup_id = 0;
|
||||
}
|
||||
if (++startup_id < 1) startup_id = 1;
|
||||
e_exehist_startup_id_set(startup_id);
|
||||
snprintf(buf, sizeof(buf), "E_START|%i", startup_id);
|
||||
e_util_env_set("DESKTOP_STARTUP_ID", buf);
|
||||
|
||||
|
|
|
@ -597,8 +597,11 @@ e_hints_window_state_set(E_Client *ec)
|
|||
if (ec->netwm.state.skip_pager)
|
||||
state[num++] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
|
||||
}
|
||||
if (ec->netwm.state.hidden)
|
||||
state[num++] = ECORE_X_WINDOW_STATE_HIDDEN;
|
||||
if (!e_config->no_state_hidden_desktop)
|
||||
{
|
||||
if (ec->netwm.state.hidden)
|
||||
state[num++] = ECORE_X_WINDOW_STATE_HIDDEN;
|
||||
}
|
||||
if (ec->netwm.state.fullscreen)
|
||||
state[num++] = ECORE_X_WINDOW_STATE_FULLSCREEN;
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
"terminology.desktop",
|
||||
"xterm.desktop",
|
||||
"rxvt.desktop",
|
||||
"gnome-terminal.desktop",
|
||||
"konsole.desktop",
|
||||
"Alacritty.desktop",
|
||||
"cool-retro-term.desktop",
|
||||
"kitty.desktop",
|
||||
"urxvt.desktop",
|
||||
"terminator.desktop",
|
||||
"termite.desktop",
|
||||
"qterminal.desktop",
|
||||
"xfce4-terminal.desktop",
|
||||
"lxterminal.desktop",
|
||||
"com.gexperts.Tilix.desktop",
|
||||
"deepin-terminal.desktop",
|
|
@ -28,6 +28,7 @@
|
|||
#include "e_place.h"
|
||||
#include "e_resist.h"
|
||||
#include "e_startup.h"
|
||||
#include "e_state.h"
|
||||
#include "e_signals.h"
|
||||
#include "e_xinerama.h"
|
||||
#include "e_layout.h"
|
||||
|
@ -155,6 +156,7 @@
|
|||
#include "e_comp_x_randr.h"
|
||||
#include "e_watchdog.h"
|
||||
#include "e_gesture.h"
|
||||
#include "e_sound.h"
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
# include "e_comp_wl.h"
|
||||
|
|
|
@ -72,6 +72,7 @@ e_int_client_prop(E_Client *ec)
|
|||
if (ec->border_prop_dialog) return;
|
||||
|
||||
dia = e_dialog_new(NULL, "E", "_window_props");
|
||||
e_dialog_resizable_set(dia, 1);
|
||||
e_object_del_attach_func_set(E_OBJECT(dia), _ec_cb_dialog_del);
|
||||
|
||||
_create_data(dia, ec);
|
||||
|
@ -455,30 +456,30 @@ _ec_icccm_create(E_Dialog *dia, void *data EINA_UNUSED)
|
|||
e_widget_toolbook_page_append(otb, NULL, _("General"), o, 1, 1, 1, 1, 0.5, 0.0);
|
||||
|
||||
o = e_widget_table_add(e_win_evas_win_get(evas), 0);
|
||||
STR_ENTRY(_("Minimum Size"), 0, 6, icccm.min);
|
||||
STR_ENTRY(_("Maximum Size"), 0, 7, icccm.max);
|
||||
STR_ENTRY(_("Base Size"), 0, 8, icccm.base);
|
||||
STR_ENTRY(_("Resize Steps"), 0, 9, icccm.step);
|
||||
STR_ENTRY(_("Minimum Size"), 0, 0, icccm.min);
|
||||
STR_ENTRY(_("Maximum Size"), 0, 1, icccm.max);
|
||||
STR_ENTRY(_("Base Size"), 0, 2, icccm.base);
|
||||
STR_ENTRY(_("Resize Steps"), 0, 3, icccm.step);
|
||||
e_widget_toolbook_page_append(otb, NULL, _("Sizing"), o, 1, 1, 1, 1, 0.5, 0.0);
|
||||
|
||||
o = e_widget_table_add(e_win_evas_win_get(evas), 0);
|
||||
STR_ENTRY(_("Aspect Ratio"), 2, 0, icccm.aspect);
|
||||
STR_ENTRY(_("Initial State"), 2, 1, icccm.initial_state);
|
||||
STR_ENTRY(_("State"), 2, 2, icccm.state);
|
||||
STR_ENTRY(_("Window ID"), 2, 3, icccm.window_id);
|
||||
STR_ENTRY(_("Window Group"), 2, 4, icccm.window_group);
|
||||
STR_ENTRY(_("Transient For"), 2, 5, icccm.transient_for);
|
||||
STR_ENTRY(_("Client Leader"), 2, 6, icccm.client_leader);
|
||||
STR_ENTRY(_("Gravity"), 2, 7, icccm.gravity);
|
||||
STR_ENTRY(_("Command"), 2, 8, icccm.command);
|
||||
STR_ENTRY(_("Aspect Ratio"), 0, 0, icccm.aspect);
|
||||
STR_ENTRY(_("Initial State"), 0, 1, icccm.initial_state);
|
||||
STR_ENTRY(_("State"), 0, 2, icccm.state);
|
||||
STR_ENTRY(_("Window ID"), 0, 3, icccm.window_id);
|
||||
STR_ENTRY(_("Window Group"), 0, 4, icccm.window_group);
|
||||
STR_ENTRY(_("Transient For"), 0, 5, icccm.transient_for);
|
||||
STR_ENTRY(_("Client Leader"), 0, 6, icccm.client_leader);
|
||||
STR_ENTRY(_("Gravity"), 0, 7, icccm.gravity);
|
||||
STR_ENTRY(_("Command"), 0, 8, icccm.command);
|
||||
e_widget_toolbook_page_append(otb, NULL, _("States"), o, 1, 1, 1, 1, 0.5, 0.0);
|
||||
|
||||
o = e_widget_table_add(e_win_evas_win_get(evas), 0);
|
||||
CHK_ENTRY(_("Take Focus"), 0, 11, icccm.take_focus);
|
||||
CHK_ENTRY(_("Accepts Focus"), 0, 12, icccm.accepts_focus);
|
||||
CHK_ENTRY(_("Urgent"), 0, 13, icccm.urgent);
|
||||
CHK_ENTRY(_("Request Delete"), 2, 11, icccm.delete_request);
|
||||
CHK_ENTRY(_("Request Position"), 2, 12, icccm.request_pos);
|
||||
CHK_ENTRY(_("Take Focus"), 0, 0, icccm.take_focus);
|
||||
CHK_ENTRY(_("Accepts Focus"), 0, 1, icccm.accepts_focus);
|
||||
CHK_ENTRY(_("Urgent"), 0, 2, icccm.urgent);
|
||||
CHK_ENTRY(_("Request Delete"), 2, 0, icccm.delete_request);
|
||||
CHK_ENTRY(_("Request Position"), 2, 1, icccm.request_pos);
|
||||
e_widget_toolbook_page_append(otb, NULL, _("Settings"), o, 1, 1, 1, 1, 0.5, 0.0);
|
||||
e_widget_toolbook_page_show(otb, 0);
|
||||
|
||||
|
@ -501,19 +502,19 @@ _ec_netwm_create(E_Dialog *dia, void *data EINA_UNUSED)
|
|||
evas = evas_object_evas_get(dia->win);
|
||||
otb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale);
|
||||
o = e_widget_table_add(e_win_evas_win_get(evas), 0);
|
||||
STR_ENTRY(_("Name"), 0, 1, netwm.name);
|
||||
STR_ENTRY(_("Icon Name"), 0, 2, netwm.icon_name);
|
||||
STR_ENTRY(_("Stacking"), 0, 3, netwm.stacking);
|
||||
STR_ENTRY(_("Name"), 0, 0, netwm.name);
|
||||
STR_ENTRY(_("Icon Name"), 0, 1, netwm.icon_name);
|
||||
STR_ENTRY(_("Stacking"), 0, 2, netwm.stacking);
|
||||
e_widget_toolbook_page_append(otb, NULL, _("General"), o, 1, 1, 1, 1, 0.5, 0.0);
|
||||
|
||||
o = e_widget_table_add(e_win_evas_win_get(evas), 0);
|
||||
CHK_ENTRY(_("Modal"), 0, 4, netwm.modal);
|
||||
CHK_ENTRY(_("Sticky"), 0, 5, netwm.sticky);
|
||||
CHK_ENTRY(_("Shaded"), 0, 6, netwm.shaded);
|
||||
CHK_ENTRY(_("Skip Taskbar"), 0, 7, netwm.skip_taskbar);
|
||||
CHK_ENTRY(_("Skip Pager"), 0, 8, netwm.skip_pager);
|
||||
CHK_ENTRY(_("Hidden"), 0, 9, netwm.hidden);
|
||||
CHK_ENTRY(_("Fullscreen"), 0, 10, netwm.fullscreen);
|
||||
CHK_ENTRY(_("Modal"), 0, 0, netwm.modal);
|
||||
CHK_ENTRY(_("Sticky"), 0, 1, netwm.sticky);
|
||||
CHK_ENTRY(_("Shaded"), 0, 2, netwm.shaded);
|
||||
CHK_ENTRY(_("Skip Taskbar"), 2, 0, netwm.skip_taskbar);
|
||||
CHK_ENTRY(_("Skip Pager"), 2, 1, netwm.skip_pager);
|
||||
CHK_ENTRY(_("Hidden"), 2, 2, netwm.hidden);
|
||||
CHK_ENTRY(_("Fullscreen"), 2, 3, netwm.fullscreen);
|
||||
e_widget_toolbook_page_append(otb, NULL, _("Settings"), o, 1, 1, 1, 1, 0.5, 0.0);
|
||||
e_widget_toolbook_page_show(otb, 0);
|
||||
|
||||
|
|
|
@ -445,6 +445,7 @@ e_int_menus_inhibitors_new(void)
|
|||
E_Menu_Item *mi;
|
||||
Eina_List *l;
|
||||
E_Msgbus_Data_Screensaver_Inhibit *inhibit;
|
||||
char buf[1024];
|
||||
|
||||
m = e_menu_new();
|
||||
if (!((e_msgbus_data) && (e_msgbus_data->screensaver_inhibits)))
|
||||
|
@ -452,7 +453,15 @@ e_int_menus_inhibitors_new(void)
|
|||
EINA_LIST_FOREACH(e_msgbus_data->screensaver_inhibits, l, inhibit)
|
||||
{
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, inhibit->application);
|
||||
if ((inhibit->application) && (inhibit->reason))
|
||||
snprintf(buf, sizeof(buf), "%s (%s)", inhibit->application, inhibit->reason);
|
||||
else if (inhibit->application)
|
||||
snprintf(buf, sizeof(buf), "%s", inhibit->application);
|
||||
else if (inhibit->reason)
|
||||
snprintf(buf, sizeof(buf), "(%s)", inhibit->reason);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "???");
|
||||
e_menu_item_label_set(mi, buf);
|
||||
e_menu_item_check_set(mi, 1);
|
||||
e_menu_item_toggle_set(mi, 1);
|
||||
e_menu_item_callback_set(mi, _e_int_menus_inhibit_cb,
|
||||
|
|
|
@ -865,11 +865,7 @@ _e_intl_locale_system_locales_get(void)
|
|||
|
||||
locales = NULL;
|
||||
/* FIXME: Maybe needed for other BSD OS, or even Solaris */
|
||||
#ifdef __OpenBSD__
|
||||
output = popen("ls /usr/share/locale", "r");
|
||||
#else
|
||||
output = popen("locale -a", "r");
|
||||
#endif
|
||||
if (output)
|
||||
{
|
||||
char line[32];
|
||||
|
|
|
@ -629,6 +629,7 @@ main(int argc, char **argv)
|
|||
|
||||
efreet_desktop_environment_set(e_config->desktop_environment);
|
||||
e_util_env_set("E_ICON_THEME", e_config->icon_theme);
|
||||
if (e_config->icon_theme) elm_config_icon_theme_set(e_config->icon_theme);
|
||||
ecore_exe_run_priority_set(e_config->priority);
|
||||
locked |= e_config->desklock_start_locked;
|
||||
|
||||
|
@ -698,6 +699,11 @@ main(int argc, char **argv)
|
|||
TS("E_Ipc Init Done");
|
||||
_e_main_shutdown_push(e_ipc_shutdown);
|
||||
|
||||
TS("E_State Init");
|
||||
e_state_init();
|
||||
TS("E_State Init Done");
|
||||
_e_main_shutdown_push(e_state_shutdown);
|
||||
|
||||
TS("E_Font Init");
|
||||
if (!e_font_init())
|
||||
{
|
||||
|
@ -800,6 +806,10 @@ main(int argc, char **argv)
|
|||
TS("E_Powersave Init Done");
|
||||
_e_main_shutdown_push(e_powersave_shutdown);
|
||||
|
||||
TS("E_Sound Init");
|
||||
e_sound_init();
|
||||
_e_main_shutdown_push(e_sound_shutdown);
|
||||
|
||||
TS("Screens Init");
|
||||
if (!_e_main_screens_init())
|
||||
{
|
||||
|
@ -894,6 +904,7 @@ main(int argc, char **argv)
|
|||
{
|
||||
e_desklock_show_manual(EINA_TRUE);
|
||||
e_screensaver_update();
|
||||
e_dpms_force_update();
|
||||
}
|
||||
|
||||
TS("Efreet Paths");
|
||||
|
@ -1116,7 +1127,7 @@ main(int argc, char **argv)
|
|||
E_LIST_FOREACH(e_comp->zones, e_comp_canvas_zone_restarted);
|
||||
}
|
||||
|
||||
// e_watchdog_begin();
|
||||
e_watchdog_begin();
|
||||
TS("MAIN LOOP AT LAST");
|
||||
if (!setjmp(x_fatal_buff))
|
||||
{
|
||||
|
@ -1125,7 +1136,7 @@ main(int argc, char **argv)
|
|||
}
|
||||
else
|
||||
CRI("FATAL: X Died. Connection gone. Abbreviated Shutdown\n");
|
||||
// e_watchdog_end();
|
||||
e_watchdog_end();
|
||||
e_main_loop_running = EINA_FALSE;
|
||||
|
||||
inloop = EINA_FALSE;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
#define E_BUS "org.enlightenment.wm.service"
|
||||
#define E_IFACE "org.enlightenment.wm.service"
|
||||
#define E_IFACE "org.enlightenment.wm.Core"
|
||||
#define E_PATH "/org/enlightenment/wm/RemoteObject"
|
||||
static void _e_msgbus_core_request_name_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending);
|
||||
static Eldbus_Message *_e_msgbus_core_version_cb(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
|
||||
|
@ -26,6 +26,7 @@ static const Eldbus_Service_Interface_Desc _e_core_desc = {
|
|||
#define SCREENSAVER_BUS "org.freedesktop.ScreenSaver"
|
||||
#define SCREENSAVER_IFACE "org.freedesktop.ScreenSaver"
|
||||
#define SCREENSAVER_PATH "/org/freedesktop/ScreenSaver"
|
||||
#define SCREENSAVER_PATH2 "/ScreenSaver"
|
||||
static void _e_msgbus_screensaver_request_name_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending);
|
||||
static void _e_msgbus_screensaver_inhibit_free(E_Msgbus_Data_Screensaver_Inhibit *inhibit);
|
||||
static void _e_msgbus_screensaver_owner_change_cb(void *data EINA_UNUSED, const char *bus, const char *old_id, const char *new_id);
|
||||
|
@ -69,6 +70,8 @@ e_msgbus_init(void)
|
|||
|
||||
e_msgbus_data->screensaver_iface = eldbus_service_interface_register
|
||||
(e_msgbus_data->conn, SCREENSAVER_PATH, &_screensaver_core_desc);
|
||||
e_msgbus_data->screensaver_iface2 = eldbus_service_interface_register
|
||||
(e_msgbus_data->conn, SCREENSAVER_PATH2, &_screensaver_core_desc);
|
||||
eldbus_name_request(e_msgbus_data->conn, SCREENSAVER_BUS, 0,
|
||||
_e_msgbus_screensaver_request_name_cb, NULL);
|
||||
return 1;
|
||||
|
@ -79,6 +82,10 @@ e_msgbus_shutdown(void)
|
|||
{
|
||||
E_Msgbus_Data_Screensaver_Inhibit *inhibit;
|
||||
|
||||
if (e_msgbus_data->screensaver_iface2)
|
||||
eldbus_service_object_unregister(e_msgbus_data->screensaver_iface2);
|
||||
if (e_msgbus_data->screensaver_iface)
|
||||
eldbus_service_object_unregister(e_msgbus_data->screensaver_iface);
|
||||
if (e_msgbus_data->e_iface)
|
||||
eldbus_service_object_unregister(e_msgbus_data->e_iface);
|
||||
if (e_msgbus_data->conn)
|
||||
|
@ -222,6 +229,7 @@ _e_msgbus_screensaver_owner_change_cb(void *data EINA_UNUSED, const char *bus EI
|
|||
{
|
||||
// stop inhibiting SS
|
||||
e_screensaver_update();
|
||||
e_dpms_force_update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -267,6 +275,7 @@ _e_msgbus_screensaver_inhibit_cb(const Eldbus_Service_Interface *iface EINA_UNUS
|
|||
// start inhibiting SS
|
||||
e_screensaver_deactivate();
|
||||
e_screensaver_update();
|
||||
e_dpms_force_update();
|
||||
}
|
||||
err:
|
||||
return reply;
|
||||
|
@ -320,6 +329,7 @@ e_msgbus_screensaver_inhibit_remove(unsigned int cookie)
|
|||
{
|
||||
// stop inhibiting SS
|
||||
e_screensaver_update();
|
||||
e_dpms_force_update();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ struct _E_Msgbus_Data
|
|||
Eldbus_Connection *conn;
|
||||
Eldbus_Service_Interface *e_iface;
|
||||
Eldbus_Service_Interface *screensaver_iface;
|
||||
Eldbus_Service_Interface *screensaver_iface2;
|
||||
Eina_List *screensaver_inhibits;
|
||||
};
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
typedef struct _Notification_Data
|
||||
{
|
||||
Eldbus_Connection *conn;
|
||||
Eldbus_Service_Interface *iface;
|
||||
Eldbus_Connection *conn;
|
||||
Eldbus_Service_Interface *iface;
|
||||
E_Notification_Notify_Cb notify_cb;
|
||||
E_Notification_Close_Cb close_cb;
|
||||
void *data;
|
||||
|
@ -15,15 +15,28 @@ static Notification_Data *n_data = NULL;
|
|||
static void
|
||||
_notification_free(E_Notification_Notify *notify)
|
||||
{
|
||||
int i;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN(notify);
|
||||
eina_stringshare_del(notify->app_name);
|
||||
eina_stringshare_del(notify->body);
|
||||
eina_stringshare_del(notify->icon.icon);
|
||||
if (notify->icon.icon_path)
|
||||
eina_stringshare_del(notify->icon.icon_path);
|
||||
eina_stringshare_del(notify->summary);
|
||||
if (notify->icon.raw.data)
|
||||
free(notify->icon.raw.data);
|
||||
if (notify->app_name) eina_stringshare_del(notify->app_name);
|
||||
if (notify->body) eina_stringshare_del(notify->body);
|
||||
if (notify->icon.icon) eina_stringshare_del(notify->icon.icon);
|
||||
if (notify->icon.icon_path) eina_stringshare_del(notify->icon.icon_path);
|
||||
if (notify->summary) eina_stringshare_del(notify->summary);
|
||||
if (notify->icon.raw.data) free(notify->icon.raw.data);
|
||||
if (notify->category) eina_stringshare_del(notify->category);
|
||||
if (notify->desktop_entry) eina_stringshare_del(notify->desktop_entry);
|
||||
if (notify->sound_file) eina_stringshare_del(notify->sound_file);
|
||||
if (notify->sound_name) eina_stringshare_del(notify->sound_name);
|
||||
if (notify->actions)
|
||||
{
|
||||
for (i = 0; notify->actions[i].action; i++)
|
||||
{
|
||||
eina_stringshare_del(notify->actions[i].action);
|
||||
eina_stringshare_del(notify->actions[i].label);
|
||||
}
|
||||
free(notify->actions);
|
||||
}
|
||||
free(notify);
|
||||
}
|
||||
|
||||
|
@ -31,12 +44,15 @@ static void
|
|||
hints_dict_iter(void *data, const void *key, Eldbus_Message_Iter *var)
|
||||
{
|
||||
E_Notification_Notify *n = data;
|
||||
if (!strcmp(key, "image-data") || !strcmp(key, "image_data"))
|
||||
|
||||
if ((!strcmp(key, "image-data")) || (!strcmp(key, "image_data")) ||
|
||||
(!strcmp(key, "icon_data")))
|
||||
{
|
||||
Eldbus_Message_Iter *st, *data_iter;
|
||||
int w, h, r, bits, channels;
|
||||
Eina_Bool alpha;
|
||||
unsigned char *raw_data;
|
||||
|
||||
if (!eldbus_message_iter_arguments_get(var, "(iiibiiay)", &st))
|
||||
return;
|
||||
if (!eldbus_message_iter_arguments_get(st, "iiibiiay", &w, &h, &r,
|
||||
|
@ -54,173 +70,318 @@ hints_dict_iter(void *data, const void *key, Eldbus_Message_Iter *var)
|
|||
n->icon.raw.data = malloc(sizeof(char) * n->icon.raw.data_size);
|
||||
EINA_SAFETY_ON_NULL_RETURN(n->icon.raw.data);
|
||||
memcpy(n->icon.raw.data, raw_data, sizeof(char) * n->icon.raw.data_size);
|
||||
}
|
||||
else if (!strcmp(key, "urgency"))
|
||||
{
|
||||
unsigned char urgency;
|
||||
eldbus_message_iter_arguments_get(var, "y", &urgency);
|
||||
if (urgency < 3)
|
||||
n->urgency = urgency;
|
||||
printf("NOT: image-data=%ix%i,a=%i\n", w, h, alpha);
|
||||
}
|
||||
else if (!strcmp(key, "image-path") || !strcmp(key, "image_path"))
|
||||
{
|
||||
eldbus_message_iter_arguments_get(var, "s", &n->icon.icon_path);
|
||||
n->icon.icon_path = eina_stringshare_add(n->icon.icon_path);
|
||||
printf("NOT: image-path=[%s]\n", n->icon.icon_path);
|
||||
// path to image file
|
||||
}
|
||||
else if (!strcmp(key, "urgency"))
|
||||
{
|
||||
unsigned char urgency;
|
||||
|
||||
eldbus_message_iter_arguments_get(var, "y", &urgency);
|
||||
if (urgency < 3) n->urgency = urgency;
|
||||
printf("NOT: urgency=%i\n", n->urgency);
|
||||
// 0=low, 1=normal, 2=critical
|
||||
}
|
||||
else if (!strcmp(key, "category"))
|
||||
{ // XXX: store category
|
||||
const char *val = NULL;
|
||||
|
||||
eldbus_message_iter_arguments_get(var, "s", &val);
|
||||
printf("NOT: category=[%s]\n", val);
|
||||
// "device" A generic device-related notification that doesn't fit into any other category.
|
||||
// "device.added" A device, such as a USB device, was added to the system.
|
||||
// "device.error" A device had some kind of error.
|
||||
// "device.removed" A device, such as a USB device, was removed from the system.
|
||||
// "email" A generic e-mail-related notification that doesn't fit into any other category.
|
||||
// "email.arrived" A new e-mail notification.
|
||||
// "email.bounced" A notification stating that an e-mail has bounced.
|
||||
// "im" A generic instant message-related notification that doesn't fit into any other category.
|
||||
// "im.error" An instant message error notification.
|
||||
// "im.received" A received instant message notification.
|
||||
// "network" A generic network notification that doesn't fit into any other category.
|
||||
// "network.connected" A network connection notification, such as successful sign-on to a network service. This should not be confused with device.added for new network devices.
|
||||
// "network.disconnected" A network disconnected notification. This should not be confused with device.removed for disconnected network devices.
|
||||
// "network.error" A network-related or connection-related error.
|
||||
// "presence" A generic presence change notification that doesn't fit into any other category, such as going away or idle.
|
||||
// "presence.offline" An offline presence change notification.
|
||||
// "presence.online" An online presence change notification.
|
||||
// "transfer" A generic file transfer or download notification that doesn't fit into any other category.
|
||||
// "transfer.complete" A file transfer or download complete notification.
|
||||
// "transfer.error" A file transfer or download error.
|
||||
if (val) n->category = eina_stringshare_add(val);
|
||||
}
|
||||
else if (!strcmp(key, "desktop-entry"))
|
||||
{
|
||||
const char *val = NULL;
|
||||
|
||||
eldbus_message_iter_arguments_get(var, "s", &val);
|
||||
printf("NOT: desktop-entry=[%s]\n", val);
|
||||
// if rage.desktop -> "rage"
|
||||
// if terminology.desktop -> "terminology"
|
||||
if (val) n->desktop_entry = eina_stringshare_add(val);
|
||||
}
|
||||
else if (!strcmp(key, "icon-actions"))
|
||||
{
|
||||
Eina_Bool val = 0;
|
||||
|
||||
eldbus_message_iter_arguments_get(var, "b", &val);
|
||||
printf("NOT: icon-actions=%i\n", val);
|
||||
// 1 == interpret action identifier == named icon in icon naming standards
|
||||
n->icon_actions = val;
|
||||
}
|
||||
else if (!strcmp(key, "resident"))
|
||||
{
|
||||
Eina_Bool val = 0;
|
||||
|
||||
eldbus_message_iter_arguments_get(var, "b", &val);
|
||||
printf("NOT: resident=%i\n", val);
|
||||
// 1== remove notification when action invoked - no timeout
|
||||
n->resident = val;
|
||||
}
|
||||
else if (!strcmp(key, "suppress-sound"))
|
||||
{
|
||||
Eina_Bool val = 0;
|
||||
|
||||
eldbus_message_iter_arguments_get(var, "b", &val);
|
||||
printf("NOT: suppress-sound=%i\n", val);
|
||||
// 1== remove notification when action invoked - no timeout
|
||||
n->suppress_sound = val;
|
||||
}
|
||||
else if (!strcmp(key, "sound-file"))
|
||||
{
|
||||
const char *val = NULL;
|
||||
|
||||
eldbus_message_iter_arguments_get(var, "s", &val);
|
||||
printf("NOT: sound-file=[%s]\n", val);
|
||||
// path to sound file to play
|
||||
if (val) n->sound_file = eina_stringshare_add(val);
|
||||
}
|
||||
else if (!strcmp(key, "sound-name"))
|
||||
{
|
||||
const char *val = NULL;
|
||||
|
||||
eldbus_message_iter_arguments_get(var, "s", &val);
|
||||
printf("NOT: sound-file=[%s]\n", val);
|
||||
// sound naming spec to play
|
||||
// http://0pointer.de/public/sound-naming-spec.html
|
||||
if (val) n->sound_name = eina_stringshare_add(val);
|
||||
}
|
||||
else if (!strcmp(key, "transient"))
|
||||
{
|
||||
Eina_Bool val = 0;
|
||||
|
||||
eldbus_message_iter_arguments_get(var, "b", &val);
|
||||
printf("NOT: transient=%i\n", val);
|
||||
n->transient = val;
|
||||
}
|
||||
else if (!strcmp(key, "x"))
|
||||
{
|
||||
int val = 0;
|
||||
|
||||
eldbus_message_iter_arguments_get(var, "i", &val);
|
||||
printf("NOT: x=%i\n", val);
|
||||
n->x = val;
|
||||
n->have_xy = EINA_TRUE;
|
||||
}
|
||||
else if (!strcmp(key, "y"))
|
||||
{
|
||||
int val = 0;
|
||||
|
||||
eldbus_message_iter_arguments_get(var, "i", &val);
|
||||
printf("NOT: y=%i\n", val);
|
||||
n->y = val;
|
||||
n->have_xy = EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* this function should be external in edje for use in cases such as this module.
|
||||
*
|
||||
* happily, it was decided that the function would not be external so that it could
|
||||
* be duplicated into the module in full.
|
||||
*/
|
||||
|
||||
static int
|
||||
_text_escape(Eina_Strbuf *txt, const char *text)
|
||||
_tag_len(const char *txt)
|
||||
{
|
||||
const char *escaped;
|
||||
int advance;
|
||||
const char *s;
|
||||
Eina_Bool backslash = EINA_FALSE;
|
||||
Eina_Bool inquote = EINA_FALSE, indblquote = EINA_FALSE;
|
||||
|
||||
escaped = evas_textblock_string_escape_get(text, &advance);
|
||||
if (!escaped)
|
||||
if (txt[0] != '<') return 0;
|
||||
for (s = txt; *s; s++)
|
||||
{
|
||||
eina_strbuf_append_char(txt, text[0]);
|
||||
advance = 1;
|
||||
if (!backslash)
|
||||
{
|
||||
if (*s == '\\') backslash = EINA_TRUE;
|
||||
else
|
||||
{
|
||||
if (inquote)
|
||||
{
|
||||
if (*s == '\'') inquote = EINA_FALSE;
|
||||
}
|
||||
else if (indblquote)
|
||||
{
|
||||
if (*s == '"') indblquote = EINA_FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*s == '>')
|
||||
{
|
||||
s++;
|
||||
break;
|
||||
}
|
||||
else if (*s == '\'') inquote = EINA_TRUE;
|
||||
else if (*s == '\"') indblquote = EINA_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else backslash = EINA_FALSE;
|
||||
}
|
||||
else
|
||||
eina_strbuf_append(txt, escaped);
|
||||
return advance;
|
||||
return s - txt;
|
||||
}
|
||||
|
||||
/* hardcoded list of allowed tags based on
|
||||
* https://people.gnome.org/~mccann/docs/notification-spec/notification-spec-latest.html#markup
|
||||
*/
|
||||
static const char *tags[] =
|
||||
static char *
|
||||
_path_get(const char *txt)
|
||||
{
|
||||
"<b",
|
||||
"<i",
|
||||
"<u",
|
||||
//"<a", FIXME: we can't actually display these right now
|
||||
//"<img",
|
||||
};
|
||||
Eina_Strbuf *buf;
|
||||
char *ret;
|
||||
const char *s;
|
||||
Eina_Bool backslash = EINA_FALSE;
|
||||
Eina_Bool inquote = EINA_FALSE, indblquote = EINA_FALSE;
|
||||
|
||||
static const char *
|
||||
_get_tag(const char *c)
|
||||
{
|
||||
unsigned int i;
|
||||
if (txt[0] == '>') return NULL;
|
||||
|
||||
if (c[1] != '>') return NULL;
|
||||
for (i = 0; i < EINA_C_ARRAY_LENGTH(tags); i++)
|
||||
if (tags[i][1] == c[0]) return tags[i];
|
||||
return NULL;
|
||||
buf = eina_strbuf_new();
|
||||
if (!buf) return NULL;
|
||||
|
||||
for (s = txt; *s; s++)
|
||||
{
|
||||
if (!backslash)
|
||||
{
|
||||
if (*s == '\\') backslash = EINA_TRUE;
|
||||
else
|
||||
{
|
||||
if (inquote)
|
||||
{
|
||||
if (*s == '\'') inquote = EINA_FALSE;
|
||||
else eina_strbuf_append_char(buf, *s);
|
||||
}
|
||||
else if (indblquote)
|
||||
{
|
||||
if (*s == '"') indblquote = EINA_FALSE;
|
||||
else eina_strbuf_append_char(buf, *s);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*s == '>') break;
|
||||
else if (*s == ' ') break;
|
||||
else if (*s == '\'') inquote = EINA_TRUE;
|
||||
else if (*s == '\"') indblquote = EINA_TRUE;
|
||||
else eina_strbuf_append_char(buf, *s);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
eina_strbuf_append_char(buf, *s);
|
||||
backslash = EINA_FALSE;
|
||||
}
|
||||
}
|
||||
ret = eina_strbuf_string_steal(buf);
|
||||
eina_strbuf_free(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
char *
|
||||
static char *
|
||||
_nedje_text_escape(const char *text)
|
||||
{
|
||||
Eina_Strbuf *txt;
|
||||
char *ret;
|
||||
const char *text_end;
|
||||
size_t text_len;
|
||||
Eina_Array *arr;
|
||||
const char *cur_tag = NULL;
|
||||
int taglen;
|
||||
|
||||
if (!text) return NULL;
|
||||
|
||||
txt = eina_strbuf_new();
|
||||
text_len = strlen(text);
|
||||
arr = eina_array_new(3);
|
||||
if (!txt) return NULL;
|
||||
|
||||
text_end = text + strlen(text);
|
||||
|
||||
text_end = text + text_len;
|
||||
while (text < text_end)
|
||||
{
|
||||
int advance;
|
||||
|
||||
if ((text[0] == '<') && text[1])
|
||||
taglen = _tag_len(text);
|
||||
if (taglen == 0)
|
||||
{
|
||||
const char *tag, *popped;
|
||||
Eina_Bool closing = EINA_FALSE;
|
||||
|
||||
if (text[1] == '/') //closing tag
|
||||
{
|
||||
closing = EINA_TRUE;
|
||||
tag = _get_tag(text + 2);
|
||||
}
|
||||
else
|
||||
tag = _get_tag(text + 1);
|
||||
if (closing)
|
||||
{
|
||||
if (cur_tag && (tag != cur_tag))
|
||||
{
|
||||
/* tag mismatch: autoclose all failure tags
|
||||
* not technically required by the spec,
|
||||
* but it makes me feel better about myself
|
||||
*/
|
||||
do
|
||||
{
|
||||
popped = eina_array_pop(arr);
|
||||
if (eina_array_count(arr))
|
||||
cur_tag = eina_array_data_get(arr, eina_array_count(arr) - 1);
|
||||
else
|
||||
cur_tag = NULL;
|
||||
eina_strbuf_append_printf(txt, "</%c>", popped[1]);
|
||||
} while (cur_tag && (popped != tag));
|
||||
advance = 4;
|
||||
}
|
||||
else if (cur_tag)
|
||||
{
|
||||
/* tag match: just pop */
|
||||
popped = eina_array_pop(arr);
|
||||
if (eina_array_count(arr))
|
||||
cur_tag = eina_array_data_get(arr, eina_array_count(arr) - 1);
|
||||
else
|
||||
cur_tag = NULL;
|
||||
eina_strbuf_append_printf(txt, "</%c>", popped[1]);
|
||||
advance = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* no current tag: escape */
|
||||
advance = _text_escape(txt, text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tag)
|
||||
{
|
||||
cur_tag = tag;
|
||||
eina_array_push(arr, tag);
|
||||
eina_strbuf_append_printf(txt, "<%c>", tag[1]);
|
||||
advance = 3;
|
||||
}
|
||||
else
|
||||
advance = _text_escape(txt, text);
|
||||
}
|
||||
}
|
||||
else if (text[0] == '&')
|
||||
{
|
||||
const char *s;
|
||||
|
||||
s = strchr(text, ';');
|
||||
if (s)
|
||||
s = evas_textblock_escape_string_range_get(text, s + 1);
|
||||
if (s)
|
||||
{
|
||||
eina_strbuf_append_char(txt, text[0]);
|
||||
advance = 1;
|
||||
}
|
||||
else
|
||||
advance = _text_escape(txt, text);
|
||||
eina_strbuf_append_char(txt, text[0]);
|
||||
text++;
|
||||
}
|
||||
else
|
||||
advance = _text_escape(txt, text);
|
||||
{
|
||||
if (!strncmp(text, "<b>", 3)) eina_strbuf_append(txt, "<b>");
|
||||
else if (!strncmp(text, "</b>", 4)) eina_strbuf_append(txt, "</b>");
|
||||
else if (!strncmp(text, "<i>", 3)) eina_strbuf_append(txt, "<i>");
|
||||
else if (!strncmp(text, "</i>", 4)) eina_strbuf_append(txt, "</i>");
|
||||
else if (!strncmp(text, "<u>", 3)) eina_strbuf_append(txt, "<u>");
|
||||
else if (!strncmp(text, "</u>", 4)) eina_strbuf_append(txt, "</u>");
|
||||
else if (!strncmp(text, "<a ", 3))
|
||||
{
|
||||
eina_strbuf_append(txt, "<link>");
|
||||
eina_strbuf_append_n(txt, text, taglen);
|
||||
}
|
||||
else if (!strncmp(text, "</a>", 3))
|
||||
{
|
||||
eina_strbuf_append(txt, "</a></link>");
|
||||
}
|
||||
else if (!strncmp(text, "<img src=", 9))
|
||||
{
|
||||
Evas_Object *o;
|
||||
int w = 0, h = 0;
|
||||
char *path;
|
||||
|
||||
text += advance;
|
||||
path = _path_get(text + 9);
|
||||
if ((path) && (strlen(path) > 0))
|
||||
{
|
||||
o = evas_object_image_add(e_comp->evas);
|
||||
evas_object_image_file_set(o, path, NULL);
|
||||
evas_object_image_size_get(o, &w, &h);
|
||||
printf("NOT: imgpath=%s %ix%i\n", path, w, h);
|
||||
if ((w > 0) && (h > 0))
|
||||
{
|
||||
double neww = w, newh = h;
|
||||
|
||||
if (neww > 200.0)
|
||||
{
|
||||
double oldw = neww;
|
||||
|
||||
neww = 200.0;
|
||||
newh = (newh * neww) / oldw;
|
||||
}
|
||||
if (newh > 100.0)
|
||||
{
|
||||
double oldh = newh;
|
||||
|
||||
newh = 100.0;
|
||||
neww = (neww * newh) / oldh;
|
||||
}
|
||||
neww *= e_scale;
|
||||
newh *= e_scale;
|
||||
w = neww + 0.5;
|
||||
h = newh + 0.5;
|
||||
eina_strbuf_append_printf
|
||||
(txt, "<item absize=%ix%i href=", w, h);
|
||||
eina_strbuf_append_n(txt, text + 9, taglen - 9);
|
||||
eina_strbuf_append(txt, "</item>");
|
||||
}
|
||||
evas_object_del(o);
|
||||
}
|
||||
free(path);
|
||||
}
|
||||
text += taglen;
|
||||
}
|
||||
}
|
||||
|
||||
eina_array_free(arr);
|
||||
ret = eina_strbuf_string_steal(txt);
|
||||
printf("NOT: body -> [%s]\n", ret);
|
||||
eina_strbuf_free(txt);
|
||||
return ret;
|
||||
}
|
||||
|
@ -231,28 +392,30 @@ notify_cb(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Messag
|
|||
E_Notification_Notify *n;
|
||||
Eldbus_Message_Iter *actions_iter, *hints_iter;
|
||||
Eldbus_Message *reply;
|
||||
char *txt;
|
||||
char *txt, *txt2;
|
||||
int num;
|
||||
|
||||
if (!n_data->notify_cb)
|
||||
return NULL;
|
||||
if (!n_data->notify_cb) return NULL;
|
||||
|
||||
n = E_OBJECT_ALLOC(E_Notification_Notify, E_NOTIFICATION_TYPE, _notification_free);
|
||||
n->urgency = E_NOTIFICATION_NOTIFY_URGENCY_NORMAL;
|
||||
if (!eldbus_message_arguments_get(msg, "susssasa{sv}i", &n->app_name,
|
||||
&n->replaces_id, &n->icon.icon, &n->summary,
|
||||
&n->body, &actions_iter, &hints_iter,
|
||||
&n->timeout))
|
||||
if (!eldbus_message_arguments_get(msg, "susssasa{sv}i",
|
||||
&n->app_name, &n->replaces_id,
|
||||
&n->icon.icon, &n->summary, &n->body,
|
||||
&actions_iter, &hints_iter, &n->timeout))
|
||||
{
|
||||
ERR("Reading message.");
|
||||
e_object_del(E_OBJECT(n));
|
||||
return NULL;
|
||||
}
|
||||
if (e_screensaver_on_get() && e_config->screensaver_wake_on_notify)
|
||||
{
|
||||
{ // XXX: this is an attempt to wake the screen? should be an option
|
||||
int x, y;
|
||||
|
||||
ecore_evas_pointer_xy_get(e_comp->ee, &x, &y);
|
||||
ecore_evas_pointer_warp(e_comp->ee, x, y);
|
||||
}
|
||||
// walk hints
|
||||
eldbus_message_iter_dict_iterate(hints_iter, "sv", hints_dict_iter, n);
|
||||
n->app_name = eina_stringshare_add(n->app_name);
|
||||
n->icon.icon = eina_stringshare_add(n->icon.icon);
|
||||
|
@ -261,22 +424,44 @@ notify_cb(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Messag
|
|||
n->body = eina_stringshare_add(txt);
|
||||
free(txt);
|
||||
|
||||
num = 0;
|
||||
while (eldbus_message_iter_get_and_next(actions_iter, 's', &txt))
|
||||
{
|
||||
if (eldbus_message_iter_get_and_next(actions_iter, 's', &txt2))
|
||||
{ // XXX: add actions to notification
|
||||
E_Notification_Notify_Action *actions;
|
||||
|
||||
printf("NOT: act=[%s] [%s]\n", txt, txt2);
|
||||
num++;
|
||||
actions = realloc(n->actions, (num + 1) *
|
||||
sizeof(E_Notification_Notify_Action));
|
||||
if (actions)
|
||||
{
|
||||
n->actions = actions;
|
||||
n->actions[num - 1].action = eina_stringshare_add(txt);
|
||||
n->actions[num - 1].label = eina_stringshare_add(txt2);
|
||||
n->actions[num].action = NULL;
|
||||
n->actions[num].label = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
e_object_ref(E_OBJECT(n));
|
||||
n->id = n_data->notify_cb(n_data->data, n);
|
||||
reply = eldbus_message_method_return_new(msg);
|
||||
eldbus_message_arguments_append(reply, "u", n->id);
|
||||
e_object_unref(E_OBJECT(n));
|
||||
|
||||
return reply;
|
||||
}
|
||||
|
||||
static Eldbus_Message *
|
||||
close_notification_cb(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
|
||||
{
|
||||
unsigned id;
|
||||
if (!eldbus_message_arguments_get(msg, "u", &id))
|
||||
return NULL;
|
||||
if (n_data->close_cb)
|
||||
n_data->close_cb(n_data->data, id);
|
||||
unsigned int id;
|
||||
|
||||
if (!eldbus_message_arguments_get(msg, "u", &id)) return NULL;
|
||||
if (n_data->close_cb) n_data->close_cb(n_data->data, id);
|
||||
return eldbus_message_method_return_new(msg);
|
||||
}
|
||||
|
||||
|
@ -291,8 +476,10 @@ capabilities_cb(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_
|
|||
eldbus_message_iter_arguments_append(main_iter, "as", &array);
|
||||
|
||||
for (i = 0; n_data->server_info->capabilities[i]; i++)
|
||||
eldbus_message_iter_arguments_append(array, "s",
|
||||
n_data->server_info->capabilities[i]);
|
||||
{
|
||||
eldbus_message_iter_arguments_append
|
||||
(array, "s", n_data->server_info->capabilities[i]);
|
||||
}
|
||||
eldbus_message_iter_container_close(main_iter, array);
|
||||
return reply;
|
||||
}
|
||||
|
@ -301,23 +488,32 @@ static Eldbus_Message *
|
|||
server_info_cb(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
|
||||
{
|
||||
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
|
||||
eldbus_message_arguments_append(reply, "ssss", n_data->server_info->name,
|
||||
n_data->server_info->vendor,
|
||||
n_data->server_info->version,
|
||||
n_data->server_info->spec_version);
|
||||
eldbus_message_arguments_append(reply, "ssss",
|
||||
n_data->server_info->name,
|
||||
n_data->server_info->vendor,
|
||||
n_data->server_info->version,
|
||||
n_data->server_info->spec_version);
|
||||
return reply;
|
||||
}
|
||||
|
||||
static const Eldbus_Method methods[] = {
|
||||
{ "Notify",
|
||||
ELDBUS_ARGS({"s", "app_name"}, {"u", "replaces_id"}, {"s", "app_icon"}, {"s", "summary"}, {"s", "body"}, {"as", "actions"}, {"a{sv}", "hints"}, {"i", "expire_timeout"}),
|
||||
ELDBUS_ARGS({"u", "id"}), notify_cb, 0 },
|
||||
{ "CloseNotification", ELDBUS_ARGS({"u", "id"}), NULL, close_notification_cb, 0 },
|
||||
{ "GetCapabilities", NULL, ELDBUS_ARGS({"as", "capabilities"}),
|
||||
capabilities_cb, 0 },
|
||||
{ "GetServerInformation", NULL,
|
||||
ELDBUS_ARGS({"s", "name"}, {"s", "vendor"}, {"s", "version"}, {"s", "spec_version"}),
|
||||
server_info_cb, 0 },
|
||||
ELDBUS_ARGS({"s", "app_name"}, {"u", "replaces_id"}, {"s", "app_icon"}, {"s", "summary"}, {"s", "body"}, {"as", "actions"}, {"a{sv}", "hints"}, {"i", "expire_timeout"}),
|
||||
ELDBUS_ARGS({"u", "id"}),
|
||||
notify_cb, 0 },
|
||||
{ "CloseNotification",
|
||||
ELDBUS_ARGS({"u", "id"}),
|
||||
NULL,
|
||||
close_notification_cb, 0 },
|
||||
{ "GetCapabilities",
|
||||
NULL,
|
||||
ELDBUS_ARGS({"as", "capabilities"}),
|
||||
capabilities_cb, 0 },
|
||||
{ "GetServerInformation",
|
||||
NULL,
|
||||
ELDBUS_ARGS({"s", "name"}, {"s", "vendor"}, {"s", "version"}, {"s", "spec_version"}),
|
||||
server_info_cb, 0 },
|
||||
|
||||
{ NULL, NULL, NULL, NULL, 0 }
|
||||
};
|
||||
|
||||
|
@ -332,6 +528,7 @@ static const Eldbus_Signal signals[] = {
|
|||
{ "NotificationClosed", ELDBUS_ARGS({"u", "id"}, {"u", "reason"}), 0 },
|
||||
[SIGNAL_ACTION_INVOKED] =
|
||||
{ "ActionInvoked", ELDBUS_ARGS({"u", "id"}, {"s", "action_key"}), 0 },
|
||||
|
||||
{ NULL, NULL, 0}
|
||||
};
|
||||
|
||||
|
@ -347,8 +544,8 @@ E_API Eina_Bool
|
|||
e_notification_server_register(const E_Notification_Server_Info *server_info, E_Notification_Notify_Cb n_cb, E_Notification_Close_Cb close_cb, const void *data)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(server_info, EINA_FALSE);
|
||||
if (n_data)
|
||||
return EINA_FALSE;
|
||||
|
||||
if (n_data) return EINA_FALSE;
|
||||
n_data = calloc(1, sizeof(Notification_Data));
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(n_data, EINA_FALSE);
|
||||
|
||||
|
@ -359,8 +556,7 @@ e_notification_server_register(const E_Notification_Server_Info *server_info, E_
|
|||
n_data->data = (void *)data;
|
||||
n_data->server_info = server_info;
|
||||
eldbus_name_request(n_data->conn, BUS,
|
||||
ELDBUS_NAME_REQUEST_FLAG_REPLACE_EXISTING, NULL, NULL);
|
||||
|
||||
ELDBUS_NAME_REQUEST_FLAG_REPLACE_EXISTING, NULL, NULL);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
@ -381,7 +577,17 @@ e_notification_notify_close(E_Notification_Notify *notify, E_Notification_Notify
|
|||
EINA_SAFETY_ON_NULL_RETURN(notify);
|
||||
EINA_SAFETY_ON_FALSE_RETURN(reason <= E_NOTIFICATION_NOTIFY_CLOSED_REASON_UNDEFINED);
|
||||
eldbus_service_signal_emit(n_data->iface, SIGNAL_NOTIFICATION_CLOSED,
|
||||
notify->id, reason);
|
||||
notify->id, reason);
|
||||
}
|
||||
|
||||
E_API void
|
||||
e_notification_notify_action(E_Notification_Notify *notify, const char *action)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN(n_data);
|
||||
EINA_SAFETY_ON_NULL_RETURN(notify);
|
||||
if (!action) action = "";
|
||||
eldbus_service_signal_emit(n_data->iface, SIGNAL_ACTION_INVOKED,
|
||||
notify->id, action);
|
||||
}
|
||||
|
||||
E_API Evas_Object *
|
||||
|
@ -491,6 +697,7 @@ notification_client_dbus_send(E_Notification_Notify *notify, E_Notification_Clie
|
|||
{
|
||||
Eldbus_Message_Iter *st, *data_iter;
|
||||
int i;
|
||||
|
||||
eldbus_message_iter_arguments_append(hints, "{sv}", &entry);
|
||||
eldbus_message_iter_arguments_append(entry, "s", "image-data");
|
||||
var = eldbus_message_iter_container_new(entry, 'v', "(iiibiiay)");
|
||||
|
@ -533,8 +740,7 @@ notification_client_dbus_send(E_Notification_Notify *notify, E_Notification_Clie
|
|||
|
||||
p = eldbus_connection_send(conn, msg, client_notify_cb, data, 5000);
|
||||
EINA_SAFETY_ON_NULL_GOTO(p, error);
|
||||
if (cb)
|
||||
eldbus_pending_data_set(p, "cb", cb);
|
||||
if (cb) eldbus_pending_data_set(p, "cb", cb);
|
||||
eldbus_pending_data_set(p, "conn", conn);
|
||||
|
||||
return EINA_TRUE;
|
||||
|
@ -547,8 +753,7 @@ error:
|
|||
static void
|
||||
normalize_notify(E_Notification_Notify *notify)
|
||||
{
|
||||
if (!notify->timeout)
|
||||
notify->timeout = -1;
|
||||
if (!notify->timeout) notify->timeout = -1;
|
||||
}
|
||||
|
||||
E_API Eina_Bool
|
||||
|
@ -562,11 +767,12 @@ e_notification_client_send(E_Notification_Notify *notify, E_Notification_Client_
|
|||
|
||||
if (!n_data)
|
||||
{
|
||||
fprintf(stderr, "UNHANDLED NOTIFICATION:\nSummary: %s\nBody: %s\n", notify->summary, notify->body);
|
||||
fprintf(stderr, "UNHANDLED NOTIFICATION:\nSummary: %s\nBody: %s\n",
|
||||
notify->summary, notify->body);
|
||||
return notification_client_dbus_send(notify, cb, data);
|
||||
}
|
||||
|
||||
//local
|
||||
// local
|
||||
copy = malloc(sizeof(E_Notification_Notify));
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(copy, EINA_FALSE);
|
||||
memcpy(copy, notify, sizeof(E_Notification_Notify));
|
||||
|
@ -579,8 +785,7 @@ e_notification_client_send(E_Notification_Notify *notify, E_Notification_Client_
|
|||
copy->icon.icon_path = eina_stringshare_add(notify->icon.icon_path);
|
||||
|
||||
id = n_data->notify_cb(n_data->data, copy);
|
||||
if (cb)
|
||||
cb((void *)data, id);
|
||||
if (cb) cb((void *)data, id);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,35 +7,39 @@
|
|||
|
||||
typedef enum _E_Notification_Notify_Urgency
|
||||
{
|
||||
E_NOTIFICATION_NOTIFY_URGENCY_LOW,
|
||||
E_NOTIFICATION_NOTIFY_URGENCY_NORMAL,
|
||||
E_NOTIFICATION_NOTIFY_URGENCY_CRITICAL
|
||||
E_NOTIFICATION_NOTIFY_URGENCY_LOW = 0,
|
||||
E_NOTIFICATION_NOTIFY_URGENCY_NORMAL = 1,
|
||||
E_NOTIFICATION_NOTIFY_URGENCY_CRITICAL = 2
|
||||
} E_Notification_Notify_Urgency;
|
||||
|
||||
typedef enum _E_Notification_Notify_Closed_Reason
|
||||
{
|
||||
E_NOTIFICATION_NOTIFY_CLOSED_REASON_EXPIRED, /** The notification expired. */
|
||||
E_NOTIFICATION_NOTIFY_CLOSED_REASON_DISMISSED, /** The notification was dismissed by the user. */
|
||||
E_NOTIFICATION_NOTIFY_CLOSED_REASON_REQUESTED, /** The notification was closed by a call to CloseNotification method. */
|
||||
E_NOTIFICATION_NOTIFY_CLOSED_REASON_UNDEFINED /** Undefined/reserved reasons. */
|
||||
E_NOTIFICATION_NOTIFY_CLOSED_REASON_EXPIRED = 1,
|
||||
E_NOTIFICATION_NOTIFY_CLOSED_REASON_DISMISSED = 2,
|
||||
E_NOTIFICATION_NOTIFY_CLOSED_REASON_REQUESTED = 3,
|
||||
E_NOTIFICATION_NOTIFY_CLOSED_REASON_UNDEFINED = 4
|
||||
} E_Notification_Notify_Closed_Reason;
|
||||
|
||||
typedef struct _E_Notification_Notify_Action
|
||||
{
|
||||
const char *action;
|
||||
const char *label;
|
||||
} E_Notification_Notify_Action;
|
||||
|
||||
typedef struct _E_Notification_Notify
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
unsigned int id;
|
||||
const char *app_name;
|
||||
unsigned replaces_id;
|
||||
unsigned int replaces_id;
|
||||
const char *summary;
|
||||
const char *body;
|
||||
int timeout;
|
||||
int timeout; // time in ms
|
||||
E_Notification_Notify_Urgency urgency;
|
||||
struct
|
||||
{
|
||||
struct {
|
||||
const char *icon;
|
||||
const char *icon_path;
|
||||
struct
|
||||
{
|
||||
struct {
|
||||
int width;
|
||||
int height;
|
||||
int rowstride;
|
||||
|
@ -46,6 +50,17 @@ typedef struct _E_Notification_Notify
|
|||
int data_size;
|
||||
} raw;
|
||||
} icon;
|
||||
const char *category;
|
||||
const char *desktop_entry;
|
||||
const char *sound_file;
|
||||
const char *sound_name;
|
||||
int x, y;
|
||||
Eina_Bool have_xy;
|
||||
Eina_Bool icon_actions;
|
||||
Eina_Bool resident;
|
||||
Eina_Bool suppress_sound;
|
||||
Eina_Bool transient;
|
||||
E_Notification_Notify_Action *actions;
|
||||
} E_Notification_Notify;
|
||||
|
||||
typedef unsigned int (*E_Notification_Notify_Cb)(void *data, E_Notification_Notify *n);
|
||||
|
@ -80,7 +95,9 @@ E_API Evas_Object *e_notification_notify_raw_image_get(E_Notification_Notify *no
|
|||
|
||||
//client
|
||||
typedef void (*E_Notification_Client_Send_Cb)(void *data, unsigned int id);
|
||||
|
||||
E_API Eina_Bool e_notification_client_send(E_Notification_Notify *notify, E_Notification_Client_Send_Cb cb, const void *data);
|
||||
E_API void e_notification_notify_action(E_Notification_Notify *notify, const char *action);
|
||||
E_API Eina_Bool e_notification_util_send(const char *summary, const char *body);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -391,26 +391,17 @@ _e_pointer_cb_free(E_Pointer *ptr)
|
|||
free(ptr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Fallback to x11 setting the correct cursor and shape.
|
||||
*
|
||||
* Not rendering any application rendered canvas, only works for x11 compositors
|
||||
*/
|
||||
static void
|
||||
_e_pointer_x11_setup(E_Pointer *ptr, const char *cursor)
|
||||
_e_pointer_x11_fallback_to_x11_pointer(E_Pointer *ptr)
|
||||
{
|
||||
if (ptr->e_cursor && (e_comp->comp_type != E_PIXMAP_TYPE_WL))
|
||||
{
|
||||
/* create a pointer canvas if we need to */
|
||||
if ((!ptr->buffer_evas) && ptr->win) _e_pointer_canvas_add(ptr);
|
||||
if (ptr->buffer_o_ptr && (ptr->buffer_o_ptr != ptr->o_ptr))
|
||||
{
|
||||
e_theme_edje_object_set(ptr->buffer_o_ptr, "base/theme/pointer", cursor);
|
||||
edje_object_part_swallow(ptr->buffer_o_ptr, "e.swallow.hotspot", ptr->buffer_o_hot);
|
||||
if (!init)
|
||||
{
|
||||
edje_object_signal_emit(ptr->o_ptr, "e,state,init", "e");
|
||||
edje_object_message_signal_process(ptr->o_ptr);
|
||||
init = EINA_TRUE;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
EINA_SAFETY_ON_FALSE_RETURN((e_comp->comp_type != E_PIXMAP_TYPE_WL));
|
||||
|
||||
// Remove any application rendered pointer canvas, x11 is going to render
|
||||
if (ptr->buffer_evas) _e_pointer_canvas_del(ptr);
|
||||
#ifndef HAVE_WAYLAND_ONLY
|
||||
if (!e_comp_util_has_x()) return;
|
||||
|
@ -459,6 +450,43 @@ _e_pointer_x11_setup(E_Pointer *ptr, const char *cursor)
|
|||
#endif
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_pointer_theme_object_setup(Evas_Object *edje, const char *cursor, Evas_Object *hotspot)
|
||||
{
|
||||
/* try to set the edje object theme */
|
||||
if (!e_theme_edje_object_set(edje, "base/theme/pointer", cursor))
|
||||
return EINA_FALSE;
|
||||
if (!edje_object_part_swallow(edje, "e.swallow.hotspot", hotspot))
|
||||
return EINA_FALSE;
|
||||
if (!init)
|
||||
{
|
||||
edje_object_signal_emit(edje, "e,state,init", "e");
|
||||
edje_object_message_signal_process(edje);
|
||||
init = EINA_TRUE;
|
||||
}
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_pointer_x11_setup(E_Pointer *ptr, const char *cursor)
|
||||
{
|
||||
EINA_SAFETY_ON_FALSE_RETURN((e_comp->comp_type != E_PIXMAP_TYPE_WL));
|
||||
if (ptr->e_cursor)
|
||||
{
|
||||
/* create a pointer canvas if we need to */
|
||||
if ((!ptr->buffer_evas) && ptr->win) _e_pointer_canvas_add(ptr);
|
||||
if (ptr->buffer_o_ptr && (ptr->buffer_o_ptr != ptr->o_ptr))
|
||||
{
|
||||
if (!_e_pointer_theme_object_setup(ptr->buffer_o_ptr, cursor, ptr->buffer_o_hot))
|
||||
{
|
||||
_e_pointer_x11_fallback_to_x11_pointer(ptr);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
_e_pointer_x11_fallback_to_x11_pointer(ptr);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_pointer_type_set(E_Pointer *ptr, const char *type)
|
||||
{
|
||||
|
@ -486,18 +514,17 @@ _e_pointer_type_set(E_Pointer *ptr, const char *type)
|
|||
if ((!ptr->buffer_evas) && ptr->win) _e_pointer_canvas_add(ptr);
|
||||
_e_pointer_theme_buf(ptr, cursor);
|
||||
|
||||
/* try to set the edje object theme */
|
||||
if (!e_theme_edje_object_set(ptr->o_ptr, "base/theme/pointer", cursor))
|
||||
cursor[0] = 0;
|
||||
edje_object_part_swallow(ptr->o_ptr, "e.swallow.hotspot", ptr->o_hot);
|
||||
if (!init)
|
||||
if (!_e_pointer_theme_object_setup(ptr->o_ptr, cursor, ptr->o_hot))
|
||||
{
|
||||
edje_object_signal_emit(ptr->o_ptr, "e,state,init", "e");
|
||||
edje_object_message_signal_process(ptr->o_ptr);
|
||||
init = EINA_TRUE;
|
||||
if (e_comp->comp_type != E_PIXMAP_TYPE_WL)
|
||||
{
|
||||
_e_pointer_x11_setup(ptr, cursor);
|
||||
}
|
||||
else
|
||||
{
|
||||
_e_pointer_theme_object_setup(ptr->o_ptr, "default", ptr->o_hot);
|
||||
}
|
||||
}
|
||||
_e_pointer_x11_setup(ptr, cursor);
|
||||
if (!cursor[0]) return;
|
||||
|
||||
_hot_update(ptr);
|
||||
|
||||
|
@ -507,7 +534,17 @@ _e_pointer_type_set(E_Pointer *ptr, const char *type)
|
|||
evas_object_show(ptr->o_ptr);
|
||||
}
|
||||
else
|
||||
_e_pointer_x11_setup(ptr, NULL);
|
||||
{
|
||||
if (e_comp->comp_type != E_PIXMAP_TYPE_WL)
|
||||
{
|
||||
_e_pointer_x11_fallback_to_x11_pointer(ptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
CRI("WL must always use the application pointer!!!");
|
||||
_e_pointer_theme_object_setup(ptr->o_ptr, "default", ptr->o_hot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EINTERN int
|
||||
|
@ -849,7 +886,7 @@ e_pointer_object_set(E_Pointer *ptr, Evas_Object *obj, int x, int y)
|
|||
int px, py;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN(ptr);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ptr->o_ptr);
|
||||
EINA_SAFETY_ON_NULL_GOTO(ptr->o_ptr, misst);
|
||||
|
||||
ecore_evas_cursor_get(ptr->ee, &o, NULL, &px, &py);
|
||||
if (o)
|
||||
|
@ -885,6 +922,10 @@ e_pointer_object_set(E_Pointer *ptr, Evas_Object *obj, int x, int y)
|
|||
ptr->client.ec = ec;
|
||||
ptr->client.x = x;
|
||||
ptr->client.y = y;
|
||||
|
||||
return;
|
||||
misst:
|
||||
INF("The ptr object of pointer %p is missing.", ptr);
|
||||
}
|
||||
|
||||
E_API void
|
||||
|
|
|
@ -365,8 +365,10 @@ _e_powersave_event_update_free(void *data EINA_UNUSED, void *event)
|
|||
else mode = powersave_mode;
|
||||
free(event);
|
||||
|
||||
printf("PWSAVE: update free...\n");
|
||||
if (mode > E_POWERSAVE_MODE_LOW)
|
||||
{
|
||||
printf("PWSAVE: low pwr hib=%i sus=%i\n", powersave_deferred_hibernate, powersave_deferred_suspend);
|
||||
if (powersave_deferred_hibernate)
|
||||
e_sys_action_do(E_SYS_HIBERNATE, NULL);
|
||||
else if (powersave_deferred_suspend)
|
||||
|
|
|
@ -90,6 +90,7 @@ e_randr2_init(void)
|
|||
E_CONFIG_LIST(D, T, screens, _e_randr2_cfg_screen_edd);
|
||||
E_CONFIG_VAL(D, T, hotplug_response, DOUBLE);
|
||||
E_CONFIG_VAL(D, T, restore, UCHAR);
|
||||
E_CONFIG_VAL(D, T, use_cmd, UCHAR);
|
||||
E_CONFIG_VAL(D, T, ignore_hotplug_events, UCHAR);
|
||||
E_CONFIG_VAL(D, T, ignore_acpi_events, UCHAR);
|
||||
E_CONFIG_VAL(D, T, default_policy, UINT);
|
||||
|
@ -393,6 +394,7 @@ _config_load(void)
|
|||
cfg->version = E_RANDR_CONFIG_VERSION;
|
||||
cfg->screens = NULL;
|
||||
cfg->restore = 1;
|
||||
cfg->use_cmd = 0;
|
||||
cfg->ignore_hotplug_events = 0;
|
||||
cfg->ignore_acpi_events = 0;
|
||||
cfg->default_policy = E_RANDR2_POLICY_EXTEND;
|
||||
|
@ -785,6 +787,7 @@ _screens_differ(E_Randr2 *r1, E_Randr2 *r2)
|
|||
return changed;
|
||||
}
|
||||
|
||||
/*
|
||||
static Eina_Bool
|
||||
_cb_deferred_suspend_screen_change(void *data EINA_UNUSED)
|
||||
{
|
||||
|
@ -813,6 +816,7 @@ _cb_deferred_suspend_screen_change(void *data EINA_UNUSED)
|
|||
}
|
||||
return EINA_FALSE;
|
||||
}
|
||||
*/
|
||||
|
||||
static Eina_Bool
|
||||
_cb_screen_change_delay(void *data EINA_UNUSED)
|
||||
|
@ -931,8 +935,9 @@ _cb_screen_change_delay(void *data EINA_UNUSED)
|
|||
if ((e_config->screensaver_suspend_on_ac) ||
|
||||
(e_powersave_mode_get() > E_POWERSAVE_MODE_LOW))
|
||||
{
|
||||
printf("RRR: we should try and suspend now because on ac or suspend on ac is on\n");
|
||||
ecore_timer_add(1.0, _cb_deferred_suspend_screen_change, NULL);
|
||||
// disable for now.. moving to state system
|
||||
// printf("RRR: we should try and suspend now because on ac or suspend on ac is on\n");
|
||||
// ecore_timer_add(1.0, _cb_deferred_suspend_screen_change, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1164,7 +1169,7 @@ again:
|
|||
if (!common)
|
||||
{
|
||||
modes = eina_list_remove_list(modes, l);
|
||||
// the list is no longer save to walk - so let's just
|
||||
// the list is no longer safe to walk - so let's just
|
||||
// walk it again from scratch
|
||||
goto again;
|
||||
}
|
||||
|
@ -1238,11 +1243,13 @@ _screen_config_do(E_Randr2_Screen *s)
|
|||
_config_do_recurse++;
|
||||
// find dependent clones and find a common config res
|
||||
cloneset = _screen_clones_find(e_randr2->screens, s);
|
||||
printf("RRR: '%s' cloneset %p %i\n", s->info.name, cloneset, eina_list_count(cloneset));
|
||||
if (cloneset)
|
||||
{
|
||||
_screen_clones_common_sync(cloneset);
|
||||
eina_list_free(cloneset);
|
||||
}
|
||||
printf("RRR: _screen_config_do 2\n");
|
||||
// if screen has a dependency...
|
||||
if ((s->config.relative.mode != E_RANDR2_RELATIVE_UNKNOWN) &&
|
||||
(s->config.relative.mode != E_RANDR2_RELATIVE_NONE) &&
|
||||
|
@ -1258,9 +1265,11 @@ _screen_config_do(E_Randr2_Screen *s)
|
|||
if (!s2->config.enabled) s2 = NULL;
|
||||
}
|
||||
}
|
||||
printf("RRR: _screen_config_do 3\n");
|
||||
s->config.geom.x = 0;
|
||||
s->config.geom.y = 0;
|
||||
printf("RRR: screen config do %ix%i rotation=%i\n", s->config.mode.w, s->config.mode.h, s->config.rotation);
|
||||
printf("RRR: _screen_config_do 4\n");
|
||||
if ((s->config.rotation == 0) || (s->config.rotation == 180))
|
||||
{
|
||||
s->config.geom.w = s->config.mode.w;
|
||||
|
@ -1273,6 +1282,7 @@ _screen_config_do(E_Randr2_Screen *s)
|
|||
}
|
||||
if (s2)
|
||||
{
|
||||
printf("RRR: _screen_config_do 5\n");
|
||||
if (s->config.relative.mode == E_RANDR2_RELATIVE_CLONE)
|
||||
{
|
||||
printf("RRR: clone relative\n");
|
||||
|
@ -1321,6 +1331,7 @@ _screen_config_do(E_Randr2_Screen *s)
|
|||
}
|
||||
else
|
||||
{
|
||||
printf("RRR: _screen_config_do 6\n");
|
||||
if ((s->config.relative.mode == E_RANDR2_RELATIVE_CLONE) &&
|
||||
(s->config.relative.to))
|
||||
{
|
||||
|
|
|
@ -102,6 +102,7 @@ struct _E_Config_Randr2
|
|||
unsigned char restore;
|
||||
unsigned char ignore_hotplug_events;
|
||||
unsigned char ignore_acpi_events;
|
||||
unsigned char use_cmd;
|
||||
E_Randr2_Policy default_policy;
|
||||
double hotplug_response;
|
||||
};
|
||||
|
|
|
@ -88,6 +88,71 @@ e_screensaver_ignore_get(void)
|
|||
return _screensaver_ignore;
|
||||
}
|
||||
|
||||
static int
|
||||
_e_screensaver_timeout_get(void)
|
||||
{
|
||||
int timeout = e_screensaver_timeout_get(EINA_TRUE);
|
||||
|
||||
if (!((e_config->screensaver_enable) &&
|
||||
(!((e_util_fullscreen_current_any()) &&
|
||||
(e_config->no_dpms_on_fullscreen)))))
|
||||
timeout = 0;
|
||||
if ((e_msgbus_data) &&
|
||||
(e_msgbus_data->screensaver_inhibits))
|
||||
timeout = 0;
|
||||
return timeout;
|
||||
}
|
||||
|
||||
E_API void
|
||||
e_screensaver_force_update(void)
|
||||
{
|
||||
#ifndef HAVE_WAYLAND_ONLY
|
||||
if (e_comp->comp_type != E_PIXMAP_TYPE_WL)
|
||||
{
|
||||
int timeout = _e_screensaver_timeout_get();
|
||||
int x_timeout = ecore_x_screensaver_timeout_get();
|
||||
|
||||
if (!e_config->screensaver_dpms_off)
|
||||
{
|
||||
Eina_Bool x_dpms = ecore_x_dpms_enabled_get();
|
||||
unsigned int x_standby = 0, x_suspend = 0, x_off = 0;
|
||||
unsigned int standby = 0, suspend = 0, off = 0;
|
||||
|
||||
if (e_dpms_actual != x_dpms)
|
||||
{
|
||||
printf("SCRSV: someone else messed with screen dpms!\n");
|
||||
ecore_x_dpms_enabled_set(e_config->screensaver_enable);
|
||||
}
|
||||
off = suspend = standby = e_screensaver_timeout_get(EINA_FALSE);
|
||||
standby += E_DPMS_STANDBY;
|
||||
suspend += E_DPMS_SUSPEND;
|
||||
off += E_DPMS_OFF;
|
||||
ecore_x_dpms_timeouts_get(&x_standby, &x_suspend, &x_off);
|
||||
if ((x_standby != standby) || (x_suspend != suspend) ||
|
||||
(x_off != off))
|
||||
{
|
||||
printf("SCRSV: someone else messed with screen dpms timeouts!\n");
|
||||
ecore_x_dpms_timeouts_set(standby, suspend, off);
|
||||
}
|
||||
}
|
||||
if (timeout != x_timeout)
|
||||
{
|
||||
printf("SCRSV: someone else messed with screen blanking!\n");
|
||||
ecore_x_screensaver_set(timeout,
|
||||
e_config->screensaver_interval,
|
||||
e_config->screensaver_blanking,
|
||||
e_config->screensaver_expose);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
E_API int
|
||||
e_screensaver_current_timeout_get(void)
|
||||
{
|
||||
return _e_screensaver_timeout_get();
|
||||
}
|
||||
|
||||
E_API void
|
||||
e_screensaver_update(void)
|
||||
{
|
||||
|
@ -109,15 +174,7 @@ e_screensaver_update(void)
|
|||
_e_screensaver_cfg_timeout = e_config->screensaver_timeout;
|
||||
_e_screensaver_cfg_dim = dim_timeout;
|
||||
|
||||
timeout = e_screensaver_timeout_get(EINA_TRUE);
|
||||
if (!((e_config->screensaver_enable) &&
|
||||
(!((e_util_fullscreen_current_any()) &&
|
||||
(e_config->no_dpms_on_fullscreen)))))
|
||||
timeout = 0;
|
||||
if (e_msgbus_data)
|
||||
{
|
||||
if (e_msgbus_data->screensaver_inhibits) timeout = 0;
|
||||
}
|
||||
timeout = _e_screensaver_timeout_get();
|
||||
|
||||
if (_e_screensaver_timeout != timeout)
|
||||
{
|
||||
|
@ -153,7 +210,7 @@ e_screensaver_update(void)
|
|||
// screen doesn't turn off at all because x thinks internally
|
||||
// that the monitor is still off... so this is odd, but it's
|
||||
// necessary on some hardware.
|
||||
if ((real_changed) && (!e_config->screensaver_dpms_off))
|
||||
if (real_changed && (!e_config->screensaver_dpms_off))
|
||||
{
|
||||
ecore_x_dpms_enabled_set(!e_config->screensaver_enable);
|
||||
ecore_x_dpms_enabled_set(e_config->screensaver_enable);
|
||||
|
|
|
@ -11,6 +11,8 @@ E_API void e_screensaver_ignore(void);
|
|||
E_API void e_screensaver_unignore(void);
|
||||
E_API Eina_Bool e_screensaver_ignore_get(void);
|
||||
|
||||
E_API void e_screensaver_force_update(void);
|
||||
E_API int e_screensaver_current_timeout_get(void);
|
||||
E_API void e_screensaver_update(void);
|
||||
|
||||
E_API int e_screensaver_timeout_get(Eina_Bool use_idle);
|
||||
|
|
|
@ -0,0 +1,123 @@
|
|||
#include <e.h>
|
||||
|
||||
#include <Ecore_Audio.h>
|
||||
|
||||
static int _can_sound_out = -1;
|
||||
static Eo *_sound_out = NULL;
|
||||
static int _outs = 0;
|
||||
static Ecore_Timer *_outs_end_timer = NULL;
|
||||
|
||||
static void
|
||||
_cb_out_fail(void *data EINA_UNUSED, const Efl_Event *event)
|
||||
{
|
||||
efl_unref(event->object);
|
||||
_sound_out = NULL;
|
||||
_can_sound_out = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_out_ready(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
|
||||
{
|
||||
_can_sound_out = 1;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_cb_outs_end_timer(void *data EINA_UNUSED)
|
||||
{
|
||||
efl_unref(_sound_out);
|
||||
_sound_out = NULL;
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
_out_end(void)
|
||||
{
|
||||
if (_outs > 0) _outs--;
|
||||
if (_outs == 0)
|
||||
{
|
||||
if (_outs_end_timer) ecore_timer_del(_outs_end_timer);
|
||||
_outs_end_timer = ecore_timer_add(2.0, _cb_outs_end_timer, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_in_stopped(void *data EINA_UNUSED, const Efl_Event *event)
|
||||
{
|
||||
efl_unref(event->object);
|
||||
_out_end();
|
||||
}
|
||||
|
||||
E_API int
|
||||
e_sound_init(void)
|
||||
{
|
||||
ecore_audio_init();
|
||||
return 1;
|
||||
}
|
||||
|
||||
E_API int
|
||||
e_sound_shutdown(void)
|
||||
{
|
||||
if (_outs_end_timer)
|
||||
{
|
||||
ecore_timer_del(_outs_end_timer);
|
||||
_outs_end_timer = NULL;
|
||||
}
|
||||
if (_sound_out)
|
||||
{
|
||||
efl_unref(_sound_out);
|
||||
_sound_out = NULL;
|
||||
}
|
||||
ecore_audio_shutdown();
|
||||
return 1;
|
||||
}
|
||||
|
||||
E_API void
|
||||
e_sound_file_play(const char *file, double vol)
|
||||
{
|
||||
Eo *in;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
if (_can_sound_out == 0) return;
|
||||
if (!_sound_out)
|
||||
_sound_out = efl_add_ref
|
||||
(ECORE_AUDIO_OUT_PULSE_CLASS, NULL,
|
||||
efl_event_callback_add(efl_added,
|
||||
ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL,
|
||||
_cb_out_fail, NULL),
|
||||
efl_event_callback_add(efl_added,
|
||||
ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY,
|
||||
_cb_out_ready, NULL)
|
||||
);
|
||||
if (!_sound_out) return;
|
||||
|
||||
if (_outs_end_timer)
|
||||
{
|
||||
ecore_timer_del(_outs_end_timer);
|
||||
_outs_end_timer = NULL;
|
||||
}
|
||||
_outs++;
|
||||
snprintf(buf, sizeof(buf), "sound-file[%s]", file);
|
||||
in = efl_add_ref(ECORE_AUDIO_IN_SNDFILE_CLASS, NULL,
|
||||
efl_name_set(efl_added, buf),
|
||||
efl_event_callback_add(efl_added,
|
||||
ECORE_AUDIO_IN_EVENT_IN_STOPPED,
|
||||
_cb_in_stopped, NULL));
|
||||
if (!in)
|
||||
{
|
||||
_out_end();
|
||||
return;
|
||||
}
|
||||
if (!ecore_audio_obj_source_set(in, file))
|
||||
{
|
||||
efl_unref(in);
|
||||
_out_end();
|
||||
return;
|
||||
}
|
||||
ecore_audio_obj_volume_set(in, vol);
|
||||
if (!ecore_audio_obj_out_input_attach(_sound_out, in))
|
||||
{
|
||||
efl_unref(in);
|
||||
_out_end();
|
||||
return;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
#else
|
||||
#ifndef E_SOUND_H
|
||||
#define E_SOUND_H
|
||||
E_API int e_sound_init(void);
|
||||
E_API int e_sound_shutdown(void);
|
||||
E_API void e_sound_file_play(const char *file, double vol);
|
||||
#endif
|
||||
#endif
|
|
@ -524,6 +524,7 @@ main(int argc, char **argv)
|
|||
struct sigaction action;
|
||||
pid_t child = -1;
|
||||
Eina_Bool restart = EINA_TRUE;
|
||||
unsigned int provided_eina_version, required_eina_version;
|
||||
|
||||
unsetenv("NOTIFY_SOCKET");
|
||||
|
||||
|
@ -547,6 +548,58 @@ main(int argc, char **argv)
|
|||
|
||||
eina_init();
|
||||
|
||||
/* check eina version ... this should be the whole efl version */
|
||||
/* check for sanity here in case someone has done something very silly */
|
||||
provided_eina_version =
|
||||
(eina_version->major * 1000 * 1000) +
|
||||
(eina_version->minor * 1000 ) +
|
||||
(eina_version->micro);
|
||||
required_eina_version =
|
||||
(MIN_EFL_VERSION_MAJ * 1000 * 1000) +
|
||||
(MIN_EFL_VERSION_MIN * 1000) +
|
||||
(MIN_EFL_VERSION_MIC);
|
||||
printf("Enlightenment: EFL Version Check: %u >= %u\n",
|
||||
provided_eina_version, required_eina_version);
|
||||
if (provided_eina_version < required_eina_version)
|
||||
{
|
||||
char *logf = NULL, *logf_old = NULL;
|
||||
FILE *fps[2];
|
||||
FILE *outf;
|
||||
|
||||
home = getenv("HOME");
|
||||
// rename old olg file
|
||||
if (!home)
|
||||
{
|
||||
myasprintf(&logf, ".e-log.log");
|
||||
myasprintf(&logf_old, ".e-log.log.old");
|
||||
}
|
||||
else
|
||||
{
|
||||
myasprintf(&logf, "%s/.e-log.log", home);
|
||||
myasprintf(&logf_old, "%s/.e-log.log.old", home);
|
||||
}
|
||||
rename(logf, logf_old);
|
||||
outf = fopen(logf, "w");
|
||||
fps[0] = stderr;
|
||||
fps[1] = outf;
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
if (fps[i])
|
||||
fprintf(fps[i],
|
||||
"ERROR: EFL version provided is %i.%i.%i\n"
|
||||
"Enlightenment requires a minimum of %i.%i.%i\n"
|
||||
"Abort\n",
|
||||
eina_version->major,
|
||||
eina_version->minor,
|
||||
eina_version->micro,
|
||||
MIN_EFL_VERSION_MAJ,
|
||||
MIN_EFL_VERSION_MIN,
|
||||
MIN_EFL_VERSION_MIC);
|
||||
}
|
||||
if (outf) fclose(outf);
|
||||
exit(42); // exit 42 for this as life the universe and everything...
|
||||
}
|
||||
|
||||
/* reexcute myself with dbus-launch if dbus-launch is not running yet */
|
||||
if ((!getenv("DBUS_SESSION_BUS_ADDRESS")) &&
|
||||
(!getenv("DBUS_LAUNCHD_SESSION_BUS_SOCKET")))
|
||||
|
@ -585,6 +638,11 @@ main(int argc, char **argv)
|
|||
printf(" \n");
|
||||
printf(" E_WL_FORCE=drm enlightenment_start \n");
|
||||
printf(" \n");
|
||||
printf(" If you wish to set software or GL rendering too then also: \n");
|
||||
printf(" \n");
|
||||
printf(" E_WL_FORCE=drm E_COMP_ENGINE=gl enlightenment_start \n");
|
||||
printf(" E_WL_FORCE=drm E_COMP_ENGINE=sw enlightenment_start \n");
|
||||
printf(" \n");
|
||||
sleep(10);
|
||||
}
|
||||
for (i = 1; i < argc; i++)
|
||||
|
|
|
@ -0,0 +1,340 @@
|
|||
#include "e.h"
|
||||
|
||||
/* public variables */
|
||||
E_API int E_EVENT_STATE_CHANGE = 0;
|
||||
|
||||
/* private stuff */
|
||||
|
||||
typedef struct _E_State_Item_Change_Callback
|
||||
{
|
||||
const char *glob;
|
||||
void (*cb) (void *data, E_State_Item item, Eina_Bool del);
|
||||
void *data;
|
||||
Eina_Bool delete_me : 1;
|
||||
} E_State_Item_Change_Callback;
|
||||
|
||||
static Eina_Hash *_e_state_items = NULL;
|
||||
static int _e_state_change_callbacks_walking = 0;
|
||||
static Eina_Bool _e_state_change_callbacks_need_del= EINA_FALSE;
|
||||
static Eina_List *_e_state_change_callbacks = NULL;
|
||||
|
||||
static void
|
||||
_state_item_free(void *data)
|
||||
{
|
||||
E_State_Item *it = data;
|
||||
|
||||
if (it->name) eina_stringshare_del(it->name);
|
||||
if (it->type == E_STATE_STRING) eina_stringshare_del(it->val.s);
|
||||
free(data);
|
||||
}
|
||||
|
||||
static void
|
||||
_state_event_free(void *data EINA_UNUSED, void *ev)
|
||||
{
|
||||
E_Event_State *e = ev;
|
||||
Eina_List *l, *ll;
|
||||
E_State_Item_Change_Callback *cbit;
|
||||
|
||||
_e_state_change_callbacks_walking++;
|
||||
EINA_LIST_FOREACH(_e_state_change_callbacks, l, cbit)
|
||||
{
|
||||
if (eina_fnmatch(cbit->glob, e->item.name, 0))
|
||||
{
|
||||
cbit->cb(cbit->data, e->item,
|
||||
(e->event == E_STATE_DEL) ?
|
||||
EINA_TRUE : EINA_FALSE);
|
||||
}
|
||||
}
|
||||
_e_state_change_callbacks_walking--;
|
||||
if ((_e_state_change_callbacks_walking == 0) &&
|
||||
(_e_state_change_callbacks_need_del))
|
||||
{
|
||||
EINA_LIST_FOREACH_SAFE(_e_state_change_callbacks, l, ll, cbit)
|
||||
{
|
||||
if (cbit->delete_me)
|
||||
{
|
||||
_e_state_change_callbacks =
|
||||
eina_list_remove_list(_e_state_change_callbacks, l);
|
||||
eina_stringshare_del(cbit->glob);
|
||||
free(cbit);
|
||||
}
|
||||
}
|
||||
_e_state_change_callbacks_need_del = EINA_FALSE;
|
||||
}
|
||||
if (e->item.name) eina_stringshare_del(e->item.name);
|
||||
if (e->item.type == E_STATE_STRING) eina_stringshare_del(e->item.val.s);
|
||||
free(e);
|
||||
}
|
||||
|
||||
/* public functions */
|
||||
EINTERN int
|
||||
e_state_init(void)
|
||||
{
|
||||
E_EVENT_STATE_CHANGE = ecore_event_type_new();
|
||||
|
||||
_e_state_items = eina_hash_string_superfast_new(_state_item_free);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
EINTERN int
|
||||
e_state_shutdown(void)
|
||||
{
|
||||
E_State_Item_Change_Callback *cbit;
|
||||
|
||||
E_FREE_FUNC(_e_state_items, eina_hash_free);
|
||||
EINA_LIST_FREE(_e_state_change_callbacks, cbit)
|
||||
{
|
||||
eina_stringshare_del(cbit->glob);
|
||||
free(cbit);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
E_API void
|
||||
e_state_item_change_callback_add(const char *glob, void (*cb) (void *data, E_State_Item item, Eina_Bool del), const void *data)
|
||||
{
|
||||
E_State_Item_Change_Callback *cbit = calloc(1, sizeof(E_State_Item_Change_Callback));
|
||||
|
||||
if (!cbit) return;
|
||||
cbit->glob = eina_stringshare_add(glob);
|
||||
if (!cbit->glob)
|
||||
{
|
||||
free(cbit);
|
||||
return;
|
||||
}
|
||||
cbit->cb = cb;
|
||||
cbit->data = (void *)data;
|
||||
_e_state_change_callbacks = eina_list_append(_e_state_change_callbacks, cbit);
|
||||
}
|
||||
|
||||
E_API void
|
||||
e_state_item_change_callback_del(const char *glob, void (*cb) (void *data, E_State_Item item, Eina_Bool del), const void *data)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_State_Item_Change_Callback *cbit;
|
||||
|
||||
EINA_LIST_FOREACH(_e_state_change_callbacks, l, cbit)
|
||||
{
|
||||
if ((!strcmp(cbit->glob, glob)) &&
|
||||
(cbit->cb == cb) && (cbit->data == data))
|
||||
{
|
||||
if (_e_state_change_callbacks_walking > 0)
|
||||
{
|
||||
cbit->delete_me = EINA_TRUE;
|
||||
_e_state_change_callbacks_need_del = EINA_TRUE;
|
||||
break;
|
||||
}
|
||||
_e_state_change_callbacks =
|
||||
eina_list_remove_list(_e_state_change_callbacks, l);
|
||||
eina_stringshare_del(cbit->glob);
|
||||
free(cbit);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
E_API E_State_Item
|
||||
e_state_item_get(const char *name)
|
||||
{
|
||||
E_State_Item it = { NULL, E_STATE_UNKNOWN, { 0 } };
|
||||
E_State_Item *it2 = eina_hash_find(_e_state_items, name);
|
||||
|
||||
if (it2) it = *it2;
|
||||
return it;
|
||||
}
|
||||
|
||||
E_API void
|
||||
e_state_item_set(E_State_Item it)
|
||||
{
|
||||
E_State_Item *it2 = eina_hash_find(_e_state_items, it.name);
|
||||
Eina_Bool changed = EINA_FALSE;
|
||||
|
||||
if (!it2)
|
||||
{
|
||||
it2 = calloc(1, sizeof(E_State_Item));
|
||||
if (!it2) return;
|
||||
it2->name = eina_stringshare_add(it.name);
|
||||
eina_hash_add(_e_state_items, it2->name, it2);
|
||||
changed = EINA_TRUE;
|
||||
}
|
||||
if (!changed)
|
||||
{
|
||||
if (it2->type != it.type) changed = EINA_TRUE;
|
||||
}
|
||||
if (!changed)
|
||||
{
|
||||
switch (it2->type)
|
||||
{
|
||||
case E_STATE_UNKNOWN:
|
||||
changed = EINA_TRUE;
|
||||
break;
|
||||
case E_STATE_BOOL:
|
||||
if (it2->val.b != it.val.b) changed = EINA_TRUE;
|
||||
break;
|
||||
case E_STATE_INT:
|
||||
if (it2->val.i != it.val.i) changed = EINA_TRUE;
|
||||
break;
|
||||
case E_STATE_UINT:
|
||||
if (it2->val.u != it.val.u) changed = EINA_TRUE;
|
||||
break;
|
||||
case E_STATE_DOUBLE:
|
||||
if (!EINA_FLT_EQ(it2->val.d, it.val.d)) changed = EINA_TRUE;
|
||||
break;
|
||||
case E_STATE_STRING:
|
||||
if (!((it2->val.s) && (it.val.s) &&
|
||||
(!strcmp(it2->val.s, it.val.s))))
|
||||
changed = EINA_TRUE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (changed)
|
||||
{
|
||||
E_Event_State *e;
|
||||
|
||||
if (it2->type == E_STATE_STRING)
|
||||
{
|
||||
eina_stringshare_del(it2->val.s);
|
||||
it2->val.s = NULL;
|
||||
}
|
||||
it2->type = it.type;
|
||||
if (it2->type == E_STATE_STRING)
|
||||
it2->val.s = eina_stringshare_add(it.val.s);
|
||||
else
|
||||
it2->val = it.val;
|
||||
e = calloc(1, sizeof(E_Event_State));
|
||||
if (e)
|
||||
{
|
||||
e->event = E_STATE_CHANGE;
|
||||
e->item = *it2;
|
||||
e->item.name = eina_stringshare_add(e->item.name);
|
||||
if (e->item.type == E_STATE_STRING)
|
||||
e->item.val.s = eina_stringshare_add(e->item.val.s);
|
||||
ecore_event_add(E_EVENT_STATE_CHANGE, e, _state_event_free, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
E_API void
|
||||
e_state_item_del(const char *name)
|
||||
{
|
||||
E_State_Item *it2 = eina_hash_find(_e_state_items, name);
|
||||
|
||||
if (it2)
|
||||
{
|
||||
E_Event_State *e = calloc(1, sizeof(E_Event_State));
|
||||
|
||||
if (e)
|
||||
{
|
||||
e->event = E_STATE_DEL;
|
||||
e->item = *it2;
|
||||
e->item.name = eina_stringshare_add(e->item.name);
|
||||
if (e->item.type == E_STATE_STRING)
|
||||
e->item.val.s = eina_stringshare_add(e->item.val.s);
|
||||
ecore_event_add(E_EVENT_STATE_CHANGE, e, _state_event_free, NULL);
|
||||
}
|
||||
eina_hash_del_by_key(_e_state_items, name);
|
||||
}
|
||||
}
|
||||
|
||||
E_API Eina_Bool
|
||||
e_state_item_val_bool_get(const char *name)
|
||||
{
|
||||
E_State_Item it = e_state_item_get(name);
|
||||
|
||||
if (it.type != E_STATE_BOOL) return EINA_FALSE;
|
||||
return it.val.b;
|
||||
}
|
||||
|
||||
E_API int
|
||||
e_state_item_val_int_get(const char *name)
|
||||
{
|
||||
E_State_Item it = e_state_item_get(name);
|
||||
|
||||
if (it.type != E_STATE_INT) return 0;
|
||||
return it.val.i;
|
||||
}
|
||||
|
||||
E_API unsigned int
|
||||
e_state_item_val_uint_get(const char *name)
|
||||
{
|
||||
E_State_Item it = e_state_item_get(name);
|
||||
|
||||
if (it.type != E_STATE_UINT) return 0;
|
||||
return it.val.u;
|
||||
}
|
||||
|
||||
E_API double
|
||||
e_state_item_val_double_get(const char *name)
|
||||
{
|
||||
E_State_Item it = e_state_item_get(name);
|
||||
|
||||
if (it.type != E_STATE_DOUBLE) return 0.0;
|
||||
return it.val.d;
|
||||
}
|
||||
|
||||
E_API const char *
|
||||
e_state_item_val_string_get(const char *name)
|
||||
{
|
||||
E_State_Item it = e_state_item_get(name);
|
||||
|
||||
if (it.type != E_STATE_STRING) return NULL;
|
||||
return it.val.s;
|
||||
}
|
||||
|
||||
E_API void
|
||||
e_state_item_val_bool_set(const char *name, Eina_Bool b)
|
||||
{
|
||||
E_State_Item it;
|
||||
|
||||
it.name = name;
|
||||
it.type = E_STATE_BOOL;
|
||||
it.val.b = b;
|
||||
e_state_item_set(it);
|
||||
}
|
||||
|
||||
E_API void
|
||||
e_state_item_val_int_set(const char *name, int i)
|
||||
{
|
||||
E_State_Item it;
|
||||
|
||||
it.name = name;
|
||||
it.type = E_STATE_INT;
|
||||
it.val.i = i;
|
||||
e_state_item_set(it);
|
||||
}
|
||||
|
||||
E_API void
|
||||
e_state_item_val_uint_set(const char *name, unsigned int u)
|
||||
{
|
||||
E_State_Item it;
|
||||
|
||||
it.name = name;
|
||||
it.type = E_STATE_UINT;
|
||||
it.val.u = u;
|
||||
e_state_item_set(it);
|
||||
}
|
||||
|
||||
E_API void
|
||||
e_state_item_val_double_set(const char *name, double d)
|
||||
{
|
||||
E_State_Item it;
|
||||
|
||||
it.name = name;
|
||||
it.type = E_STATE_DOUBLE;
|
||||
it.val.d = d;
|
||||
e_state_item_set(it);
|
||||
}
|
||||
|
||||
E_API void
|
||||
e_state_item_val_string_set(const char *name, const char *s)
|
||||
{
|
||||
E_State_Item it;
|
||||
|
||||
it.name = name;
|
||||
it.type = E_STATE_STRING;
|
||||
it.val.s = s;
|
||||
e_state_item_set(it);
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
#ifdef E_TYPEDEFS
|
||||
|
||||
/* struct used to pass to event handlers */
|
||||
typedef struct _E_Event_State E_Event_State;
|
||||
|
||||
typedef struct _E_State_Item E_State_Item;
|
||||
typedef union _E_State_Val E_State_Val;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
E_STATE_UNKNOWN,
|
||||
E_STATE_BOOL,
|
||||
E_STATE_INT,
|
||||
E_STATE_UINT,
|
||||
E_STATE_DOUBLE,
|
||||
E_STATE_STRING
|
||||
} E_State_Type;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
E_STATE_CHANGE,
|
||||
E_STATE_DEL
|
||||
} E_State_Event;
|
||||
|
||||
#else
|
||||
# ifndef E_STATE_H
|
||||
# define E_STATE_H
|
||||
|
||||
union _E_State_Val
|
||||
{
|
||||
Eina_Bool b;
|
||||
int i;
|
||||
unsigned int u;
|
||||
double d;
|
||||
const char *s;
|
||||
};
|
||||
|
||||
struct _E_State_Item
|
||||
{
|
||||
const char *name;
|
||||
E_State_Type type;
|
||||
E_State_Val val;
|
||||
};
|
||||
|
||||
struct _E_Event_State
|
||||
{
|
||||
E_State_Event event;
|
||||
E_State_Item item;
|
||||
};
|
||||
|
||||
EINTERN int e_state_init(void);
|
||||
EINTERN int e_state_shutdown(void);
|
||||
|
||||
E_API void e_state_item_change_callback_add(const char *glob, void (*cb) (void *data, E_State_Item item, Eina_Bool del), const void *data);
|
||||
E_API void e_state_item_change_callback_del(const char *glob, void (*cb) (void *data, E_State_Item item, Eina_Bool del), const void *data);
|
||||
|
||||
E_API E_State_Item e_state_item_get(const char *name);
|
||||
E_API void e_state_item_set(E_State_Item it);
|
||||
|
||||
E_API void e_state_item_del(const char *name);
|
||||
|
||||
E_API Eina_Bool e_state_item_val_bool_get(const char *name);
|
||||
E_API int e_state_item_val_int_get(const char *name);
|
||||
E_API unsigned int e_state_item_val_uint_get(const char *name);
|
||||
E_API double e_state_item_val_double_get(const char *name);
|
||||
E_API const char *e_state_item_val_string_get(const char *name);
|
||||
E_API void e_state_item_val_bool_set(const char *name, Eina_Bool b);
|
||||
E_API void e_state_item_val_int_set(const char *name, int i);
|
||||
E_API void e_state_item_val_uint_set(const char *name, unsigned int u);
|
||||
E_API void e_state_item_val_double_set(const char *name, double d);
|
||||
E_API void e_state_item_val_string_set(const char *name, const char *s);
|
||||
|
||||
extern E_API int E_EVENT_STATE_CHANGE;
|
||||
|
||||
# endif
|
||||
#endif
|
|
@ -522,26 +522,20 @@ e_sys_shutdown(void)
|
|||
_e_sys_acpi_handler = NULL;
|
||||
if (login1_session_proxy)
|
||||
{
|
||||
Eldbus_Connection *conn;
|
||||
Eldbus_Object *obj;
|
||||
|
||||
obj = eldbus_proxy_object_get(login1_session_proxy);
|
||||
conn = eldbus_object_connection_get(obj);
|
||||
eldbus_proxy_unref(login1_session_proxy);
|
||||
eldbus_object_unref(obj);
|
||||
eldbus_connection_unref(conn);
|
||||
login1_session_proxy = NULL;
|
||||
}
|
||||
if (login1_manger_proxy)
|
||||
{
|
||||
Eldbus_Connection *conn;
|
||||
Eldbus_Object *obj;
|
||||
|
||||
obj = eldbus_proxy_object_get(login1_manger_proxy);
|
||||
conn = eldbus_object_connection_get(obj);
|
||||
eldbus_proxy_unref(login1_manger_proxy);
|
||||
eldbus_object_unref(obj);
|
||||
eldbus_connection_unref(conn);
|
||||
login1_manger_proxy = NULL;
|
||||
}
|
||||
if (_e_sys_systemd_inhibit_fd >= 0)
|
||||
|
|
|
@ -342,6 +342,7 @@ main(int argc,
|
|||
rm = EINA_FALSE;
|
||||
eina_stringshare_del(s);
|
||||
}
|
||||
eina_iterator_free(it);
|
||||
if (rm)
|
||||
{
|
||||
if (rmdir(path))
|
||||
|
@ -358,6 +359,19 @@ main(int argc,
|
|||
|
||||
/* local subsystem functions */
|
||||
#ifdef HAVE_EEZE_MOUNT
|
||||
|
||||
static Eina_Bool
|
||||
check_is_num_to_comma(const char *s)
|
||||
{
|
||||
const char *p;
|
||||
|
||||
for (p = s; *p && (*p != ','); p++)
|
||||
{
|
||||
if (!((*p >= '0') && (*p <= '9'))) return EINA_FALSE;
|
||||
}
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
mountopts_check(const char *opts)
|
||||
{
|
||||
|
@ -400,6 +414,8 @@ mountopts_check(const char *opts)
|
|||
{
|
||||
p += 4;
|
||||
errno = 0;
|
||||
|
||||
if (!check_is_num_to_comma(p)) return EINA_FALSE;
|
||||
muid = strtoul(p, &end, 10);
|
||||
if (muid == ULONG_MAX) return EINA_FALSE;
|
||||
if (errno) return EINA_FALSE;
|
||||
|
@ -414,13 +430,53 @@ mountopts_check(const char *opts)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
check_is_alpha_num(char c)
|
||||
{
|
||||
if (((c >= '0') && (c <= '9')) ||
|
||||
((c >= 'a') && (c <= 'z')) ||
|
||||
((c >= 'A') && (c <= 'Z'))) return EINA_TRUE;
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
check_uuid(const char *uuid)
|
||||
{
|
||||
const char *p;
|
||||
|
||||
for (p = uuid; p[0]; p++)
|
||||
if ((!isalnum(*p)) && (*p != '-')) return EINA_FALSE;
|
||||
{
|
||||
if ((!check_is_alpha_num(*p)) && (*p != '-')) return EINA_FALSE;
|
||||
}
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
check_sane_path(const char *path)
|
||||
{
|
||||
const char *forbidden_ch = "`~!#$%^&*()[]{}|\\;'\"<>?";
|
||||
const char *p;
|
||||
|
||||
if (strstr(path, "..")) return EINA_FALSE; // just don't allow .. anywhere
|
||||
for (p = forbidden_ch; *p; p++) // no invalid chars like above
|
||||
{
|
||||
if (strchr(path, *p)) return EINA_FALSE;
|
||||
}
|
||||
for (p = path; *p; p++) // nothing in lower ascii ctrl chars or high ascii
|
||||
{
|
||||
if ((*p <= ' ') || (*p >= 0x7f)) return EINA_FALSE;
|
||||
}
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
check_sane_dev(const char *dev)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
if (strncmp(dev, "/dev/", 5)) return EINA_FALSE; // not a /dev file
|
||||
if (!check_sane_path(dev)) return EINA_FALSE;
|
||||
if (stat(dev, &st)) return EINA_FALSE; // must actually exist
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
@ -428,9 +484,9 @@ static Eina_Bool
|
|||
mount_args_check(int argc, char **argv, const char *action)
|
||||
{
|
||||
Eina_Bool opts = EINA_FALSE;
|
||||
struct stat st;
|
||||
const char *node;
|
||||
char buf[PATH_MAX];
|
||||
struct stat st;
|
||||
|
||||
if (!strcmp(action, "mount"))
|
||||
{
|
||||
|
@ -451,9 +507,9 @@ mount_args_check(int argc, char **argv, const char *action)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (strncmp(argv[4], "/dev/", 5)) return EINA_FALSE;
|
||||
if (stat(argv[4], &st)) return EINA_FALSE;
|
||||
if (!check_sane_dev(argv[4])) return EINA_FALSE;
|
||||
}
|
||||
if (!check_sane_path(argv[5])) return EINA_FALSE;
|
||||
|
||||
node = strrchr(argv[5], '/');
|
||||
if (!node) return EINA_FALSE;
|
||||
|
@ -468,8 +524,7 @@ mount_args_check(int argc, char **argv, const char *action)
|
|||
/path/to/umount /dev/$devnode
|
||||
*/
|
||||
if (argc != 3) return EINA_FALSE;
|
||||
if (strncmp(argv[2], "/dev/", 5)) return EINA_FALSE;
|
||||
if (stat(argv[2], &st)) return EINA_FALSE;
|
||||
if (!check_sane_dev(argv[2])) return EINA_FALSE;
|
||||
node = strrchr(argv[2], '/');
|
||||
if (!node) return EINA_FALSE;
|
||||
if (!node[1]) return EINA_FALSE;
|
||||
|
@ -488,8 +543,7 @@ mount_args_check(int argc, char **argv, const char *action)
|
|||
/path/to/eject /dev/$devnode
|
||||
*/
|
||||
if (argc != 3) return EINA_FALSE;
|
||||
if (strncmp(argv[2], "/dev/", 5)) return EINA_FALSE;
|
||||
if (stat(argv[2], &st)) return EINA_FALSE;
|
||||
if (!check_sane_dev(argv[2])) return EINA_FALSE;
|
||||
node = strrchr(argv[2], '/');
|
||||
if (!node) return EINA_FALSE;
|
||||
if (!node[1]) return EINA_FALSE;
|
||||
|
@ -545,10 +599,8 @@ auth_action_ok(char *a,
|
|||
*/
|
||||
ret = auth_etc_enlightenment_sysactions(a, usr, grp);
|
||||
if (ret == 1) return 1;
|
||||
else if (ret == -1)
|
||||
return 0;
|
||||
/* the DEFAULT - allow */
|
||||
return 1;
|
||||
else if (ret == -1) return 0;
|
||||
return 0; // no sysactions.conf file found - just say no. bad system
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -146,8 +146,12 @@ static void
|
|||
_update_machid_get(void)
|
||||
{
|
||||
FILE *f;
|
||||
char buf[4096], *c;
|
||||
static const char appid[] = "EnL+7',xkDv&!@*)df%@#hcs$;l%o$fc#^$%&%$FDFeJ$%c^$#";
|
||||
static const char hex[] = "0123456789abcdef";
|
||||
char buf[4096], buf2[4096 + 1024], *c;
|
||||
unsigned char sha[20];
|
||||
size_t len;
|
||||
int i;
|
||||
|
||||
f = fopen("/etc/machine-id", "r");
|
||||
if (!f) f = fopen("/var/lib/dbus/machine-id", "r");
|
||||
|
@ -159,7 +163,7 @@ _update_machid_get(void)
|
|||
if (f)
|
||||
{
|
||||
len = fread(buf, 1, sizeof(buf) - 1, f);
|
||||
if (len > 10)
|
||||
if ((len > 10) && (len < 4000))
|
||||
{
|
||||
buf[len] = 0;
|
||||
for (c = buf; *c; c++)
|
||||
|
@ -170,6 +174,14 @@ _update_machid_get(void)
|
|||
break;
|
||||
}
|
||||
}
|
||||
snprintf(buf2, sizeof(buf2), "{{%s}}/{{%s}}", buf, appid);
|
||||
e_sha1_sum((unsigned char *)buf2, strlen(buf2), sha);
|
||||
for (i = 0; i < 20; i++)
|
||||
{
|
||||
buf[(i * 2) + 0] = hex[((sha[i] >> 4) & 0xf)];
|
||||
buf[(i * 2) + 1] = hex[((sha[i] ) & 0xf)];
|
||||
}
|
||||
buf[(i * 2)] = 0;
|
||||
machid = strdup(buf);
|
||||
fclose(f);
|
||||
return;
|
||||
|
@ -187,7 +199,6 @@ _update_machid_get(void)
|
|||
t = ecore_time_unix_get();
|
||||
fprintf(f, "%1.16f-%i-%i\n", t, rand(), rand());
|
||||
fclose(f);
|
||||
_update_machid_get();
|
||||
return;
|
||||
}
|
||||
// this just is all a wash - just use this
|
||||
|
@ -259,6 +270,7 @@ e_update_init(void)
|
|||
_update_timeout_cb(NULL);
|
||||
e_config->update.check = 1;
|
||||
}
|
||||
_update_machid_get();
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -1174,10 +1174,7 @@ e_util_terminal_desktop_get(void)
|
|||
{
|
||||
const char *terms[] =
|
||||
{
|
||||
"terminology.desktop",
|
||||
"rxvt.desktop",
|
||||
"gnome-terminal.desktop",
|
||||
"konsole.desktop",
|
||||
#include "e_inc_terms.h"
|
||||
NULL
|
||||
};
|
||||
const char *s;
|
||||
|
|
|
@ -85,33 +85,33 @@ _resolutions_calc(int w, int h)
|
|||
{
|
||||
int i, j = 0;
|
||||
int nw, nh, pw = 0, ph = 0;
|
||||
Mip *mips = calloc(1, sizeof(Mip) * MAX_RES_NUM);
|
||||
Mip *mips_ = calloc(1, sizeof(Mip) * MAX_RES_NUM);
|
||||
|
||||
if (!mips) return NULL;
|
||||
if (!mips_) return NULL;
|
||||
for (i = 0; resolutions[i]; i += 2)
|
||||
{
|
||||
nh = resolutions[i + 1];
|
||||
nw = (w * nh) / h;
|
||||
if ((nh >= h) || (nw >= w))
|
||||
{
|
||||
mips[j].from_w = pw;
|
||||
mips[j].from_h = ph;
|
||||
mips[j].to_w = 1000000000;
|
||||
mips[j].to_h = 1000000000;
|
||||
mips[j].last = EINA_TRUE;
|
||||
mips_[j].from_w = pw;
|
||||
mips_[j].from_h = ph;
|
||||
mips_[j].to_w = 1000000000;
|
||||
mips_[j].to_h = 1000000000;
|
||||
mips_[j].last = EINA_TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
mips[j].from_w = pw;
|
||||
mips[j].from_h = ph;
|
||||
mips[j].to_w = nw;
|
||||
mips[j].to_h = nh;
|
||||
mips_[j].from_w = pw;
|
||||
mips_[j].from_h = ph;
|
||||
mips_[j].to_w = nw;
|
||||
mips_[j].to_h = nh;
|
||||
|
||||
j++;
|
||||
pw = nw + 1;
|
||||
ph = nh + 1;
|
||||
}
|
||||
return mips;
|
||||
return mips_;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
|
@ -123,7 +123,7 @@ elm_main(int argc, char **argv)
|
|||
int bg_b = 64;
|
||||
char dir_buf[128], img_buf[256], edc_buf[256], cmd_buf[1024], qual_buf[64];
|
||||
const char *dir, *quality_string = NULL, *img_name = NULL;
|
||||
Mip *mips = NULL;
|
||||
Mip *mips_ = NULL;
|
||||
int i, imw, imh, w, h, quality;
|
||||
int ret = 0, mips_num = 0;
|
||||
Eina_Bool alpha;
|
||||
|
@ -207,25 +207,25 @@ elm_main(int argc, char **argv)
|
|||
(!strcmp(mode, "scale_out")) ||
|
||||
(!strcmp(mode, "pan")))
|
||||
{ // need to produce multiple scaled versions
|
||||
mips = _resolutions_calc(w, h);
|
||||
if (!mips) return 6;
|
||||
for (i = 0; mips[i].to_w; i++)
|
||||
mips_ = _resolutions_calc(w, h);
|
||||
if (!mips_) return 6;
|
||||
for (i = 0; mips_[i].to_w; i++)
|
||||
{
|
||||
mips_num++;
|
||||
if (mips[i].last)
|
||||
if (mips_[i].last)
|
||||
{
|
||||
imw = w;
|
||||
imh = h;
|
||||
}
|
||||
else
|
||||
{
|
||||
imw = mips[i].to_w;
|
||||
imh = mips[i].to_h;
|
||||
imw = mips_[i].to_w;
|
||||
imh = mips_[i].to_h;
|
||||
}
|
||||
evas_object_resize(subwin, imw, imh);
|
||||
evas_object_resize(image, imw, imh);
|
||||
elm_win_render(subwin);
|
||||
if (mips[i].last)
|
||||
if (mips_[i].last)
|
||||
snprintf(img_buf, sizeof(img_buf), "%s/img.png",
|
||||
dir);
|
||||
else
|
||||
|
@ -239,7 +239,7 @@ elm_main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
// no multiple resolutions -0 save out original
|
||||
if (!mips)
|
||||
if (!mips_)
|
||||
{
|
||||
evas_object_resize(subwin, w, h);
|
||||
evas_object_resize(image, w, h);
|
||||
|
@ -267,7 +267,7 @@ elm_main(int argc, char **argv)
|
|||
snprintf(edc_buf, sizeof(edc_buf), "%s/bg.edc", dir);
|
||||
f = fopen(edc_buf, "w");
|
||||
if (!f) goto cleanup;
|
||||
if ((mips) && (mips_num > 1))
|
||||
if ((mips_) && (mips_num > 1))
|
||||
{
|
||||
fprintf(f,
|
||||
"images {\n"
|
||||
|
@ -276,7 +276,7 @@ elm_main(int argc, char **argv)
|
|||
{
|
||||
fprintf(f,
|
||||
" image {\n");
|
||||
if (mips[i].last)
|
||||
if (mips_[i].last)
|
||||
{
|
||||
fprintf(f,
|
||||
" image: \"img.png\" %s;\n",
|
||||
|
@ -284,8 +284,8 @@ elm_main(int argc, char **argv)
|
|||
}
|
||||
else
|
||||
{
|
||||
imw = mips[i].to_w;
|
||||
imh = mips[i].to_h;
|
||||
imw = mips_[i].to_w;
|
||||
imh = mips_[i].to_h;
|
||||
fprintf(f,
|
||||
" image: \"img-%ix%i.png\" %s;\n",
|
||||
imw, imh, quality_string);
|
||||
|
@ -293,8 +293,8 @@ elm_main(int argc, char **argv)
|
|||
fprintf(f,
|
||||
" size: %i %i %i %i;\n"
|
||||
" }\n",
|
||||
mips[i].from_w, mips[i].from_h,
|
||||
mips[i].to_w, mips[i].to_h);
|
||||
mips_[i].from_w, mips_[i].from_h,
|
||||
mips_[i].to_w, mips_[i].to_h);
|
||||
}
|
||||
fprintf(f,
|
||||
" }\n"
|
||||
|
@ -489,7 +489,7 @@ elm_main(int argc, char **argv)
|
|||
}
|
||||
ret = system(cmd_buf);
|
||||
cleanup:
|
||||
free(mips);
|
||||
free(mips_);
|
||||
ecore_file_recursive_rm(dir);
|
||||
evas_object_del(win);
|
||||
return ret;
|
||||
|
|
|
@ -8,7 +8,7 @@ static void
|
|||
_cb_watchdog_thread_pingpong_pipe(void *data EINA_UNUSED, void *buf, unsigned int bytes)
|
||||
{
|
||||
unsigned long long *seq = buf;
|
||||
unsigned long long seq_num = bytes / sizeof(int);
|
||||
unsigned long long seq_num = bytes / sizeof(unsigned long long);
|
||||
|
||||
if (seq_num < 1)
|
||||
{
|
||||
|
@ -54,8 +54,9 @@ _cb_watchdog_thread_pingpong(void *data EINA_UNUSED, Ecore_Thread *thread)
|
|||
static void
|
||||
_cb_watchdog_thread_pingpong_reply(void *data EINA_UNUSED, Ecore_Thread *thread EINA_UNUSED, void *msg)
|
||||
{
|
||||
// repluy back to mainloop with same ping number
|
||||
// reply back to mainloop with same ping number
|
||||
unsigned long long *seq = msg;
|
||||
|
||||
ecore_pipe_write(_watchdog_pipe, seq, sizeof(unsigned long long));
|
||||
free(seq);
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ deps_e = [
|
|||
dep_ecore_con,
|
||||
dep_ecore_input,
|
||||
dep_ecore_input_evas,
|
||||
dep_ecore_audio,
|
||||
dep_evas,
|
||||
dep_efreet,
|
||||
dep_efreet_mime,
|
||||
|
@ -59,6 +60,7 @@ requires_e = ' '.join([
|
|||
'ecore-con',
|
||||
'ecore-input',
|
||||
'ecore-input-evas',
|
||||
'ecore-audio',
|
||||
'evas',
|
||||
'efreet',
|
||||
'efreet-mime',
|
||||
|
@ -179,6 +181,7 @@ src = [
|
|||
'e_slidesel.c',
|
||||
'e_spectrum.c',
|
||||
'e_startup.c',
|
||||
'e_state.c',
|
||||
'e_sys.c',
|
||||
'e_system.c',
|
||||
'e_test.c',
|
||||
|
@ -224,6 +227,7 @@ src = [
|
|||
'e_zoomap.c',
|
||||
'e_zone.c',
|
||||
'e_gesture.c',
|
||||
'e_sound.c',
|
||||
'efx/efx_bumpmapping.c',
|
||||
'efx/efx.c',
|
||||
'efx/efx_fade.c',
|
||||
|
@ -358,6 +362,7 @@ hdr = [
|
|||
'e_slidesel.h',
|
||||
'e_spectrum.h',
|
||||
'e_startup.h',
|
||||
'e_state.h',
|
||||
'e_sys.h',
|
||||
'e_system.h',
|
||||
'e_test.h',
|
||||
|
@ -403,7 +408,8 @@ hdr = [
|
|||
'e_xsettings.h',
|
||||
'e_zoomap.h',
|
||||
'e_zone.h',
|
||||
'e_gesture.h'
|
||||
'e_gesture.h',
|
||||
'e_sound.h'
|
||||
]
|
||||
|
||||
if config_h.has('HAVE_WAYLAND') == true
|
||||
|
|
|
@ -246,7 +246,7 @@ _light_device_include(const char *dev)
|
|||
#endif
|
||||
|
||||
static void
|
||||
_light_refresh_devices()
|
||||
_light_refresh_devices(void)
|
||||
{
|
||||
Light *lig;
|
||||
|
||||
|
|
|
@ -304,9 +304,14 @@ err:
|
|||
static Eina_Bool
|
||||
_ddc_init(void)
|
||||
{
|
||||
// .so.3 is ABI compatible twith .so.2 for out uses - see
|
||||
// https://www.ddcutil.com/c_api_99/ for changes between them
|
||||
ddc_lib = dlopen("libddcutil.so.4", RTLD_NOW | RTLD_LOCAL);
|
||||
// .so.[345] are ABI compatible with .so.2 for our uses - see
|
||||
// the changes listed at:
|
||||
// - https://www.ddcutil.com/c_api_99/
|
||||
// - https://www.ddcutil.com/c_api_120/
|
||||
// - https://www.ddcutil.com/c_api_200/
|
||||
ddc_lib = dlopen("libddcutil.so.5", RTLD_NOW | RTLD_LOCAL);
|
||||
if (!ddc_lib)
|
||||
ddc_lib = dlopen("libddcutil.so.4", RTLD_NOW | RTLD_LOCAL);
|
||||
if (!ddc_lib)
|
||||
ddc_lib = dlopen("libddcutil.so.3", RTLD_NOW | RTLD_LOCAL);
|
||||
if (!ddc_lib)
|
||||
|
|
|
@ -90,9 +90,12 @@ _power_suspend_init(void)
|
|||
static void
|
||||
_power_hibernate_init(void)
|
||||
{
|
||||
#if defined (__FreeBSD__) || defined (__OpenBSD__)
|
||||
#if defined (__FreeBSD__)
|
||||
if (ecore_file_app_installed("acpiconf"))
|
||||
_cmd_hibernate = strdup("acpiconf -s4");
|
||||
#elif defined (__OpenBSD__)
|
||||
if (ecore_file_app_installed("ZZZ"))
|
||||
_cmd_suspend = strdup("ZZZ");
|
||||
#else
|
||||
if (ecore_file_app_installed("systemctl"))
|
||||
_cmd_hibernate = strdup("systemctl hibernate");
|
||||
|
@ -106,7 +109,8 @@ _power_hibernate_init(void)
|
|||
_cmd_hibernate = strdup("/etc/acpi/pm-hibernate");
|
||||
#endif
|
||||
// linux systemd: PATH/systemctl hibernate
|
||||
// bsd: acpiconf -s4
|
||||
// FreeBSD: acpiconf -s4
|
||||
// OpenBSD: ZZZ
|
||||
// if exist:
|
||||
// PATH/hibernate.sh
|
||||
// /etc/acpi/hibernate.sh force
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue