summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-11-26 18:28:39 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-11-26 18:28:39 +0000
commiteeb015c0b972b6aa7322b21425077083df2be76b (patch)
tree75c597317802f43c6d0c582ec1780d40b36b8014
parente87ee674d3d5c04f1d168234d4fd2c5b430ab011 (diff)
downloadenlightenment-eeb015c0b972b6aa7322b21425077083df2be76b.tar.gz
e comp devices - dont try apply input dev settings if looks the same
if the list of device names is the same with a devices update event then assume its the same as before and dont go probing all their properties which takes time and round-trips which is not good.
-rw-r--r--src/bin/e_comp_x_devices.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/bin/e_comp_x_devices.c b/src/bin/e_comp_x_devices.c
index d273fc4196..1ddc82c774 100644
--- a/src/bin/e_comp_x_devices.c
+++ b/src/bin/e_comp_x_devices.c
@@ -8,6 +8,8 @@ typedef enum
DEVICE_FLAG_TOUCHPAD
} Device_Flags;
+static char *devstring = NULL;
+
static void
_handle_dev_prop(int dev_slot, const char *dev, const char *prop, Device_Flags dev_flags)
{
@@ -393,9 +395,25 @@ e_comp_x_devices_config_apply(void)
Eina_Bool driver_evdev = EINA_FALSE;
Eina_Bool driver_libinput = EINA_FALSE;
Eina_Bool driver_synaptics = EINA_FALSE;
+ Eina_Strbuf *sbuf;
+ Eina_Bool changed = EINA_TRUE;
num_devs = ecore_x_input_device_num_get();
- printf("DEV: CHANGES ... have %i devices\n", num_devs);
+ sbuf = eina_strbuf_new();
+ if (!sbuf) return;
+ for (i = 0; i < num_devs; i++)
+ {
+ eina_strbuf_append(sbuf, ecore_x_input_device_name_get(i));
+ }
+ if ((devstring) && (!strcmp(devstring, eina_strbuf_string_get(sbuf))))
+ changed = EINA_FALSE;
+ else
+ {
+ free(devstring);
+ devstring = eina_strbuf_string_steal(sbuf);
+ }
+ eina_strbuf_free(sbuf);
+ printf("DEV: CHANGES ... have %i devices, changed=%i\n", num_devs, changed);
for (i = 0; i < num_devs; i++)
{
const char *name;