block task gadget refills while a drag is active
authorMike Blumenkrantz <zmike@osg.samsung.com>
Thu, 19 Nov 2015 20:34:19 +0000 (15:34 -0500)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Thu, 19 Nov 2015 20:34:19 +0000 (15:34 -0500)
it's impossible to use a pager effectively with a task gadget due to
the constant resizing of the tasks gadget during any kind of window move

src/modules/tasks/e_mod_main.c

index 045f968..cbe69a9 100644 (file)
@@ -91,6 +91,8 @@ static Eina_Bool    _tasks_cb_event_client_urgent_change(void *data, int type, v
 static E_Config_DD *conf_edd = NULL;
 static E_Config_DD *conf_item_edd = NULL;
 
+static Ecore_Timer *task_refill_timer;
+
 Config *tasks_config = NULL;
 
 /* module setup */
@@ -439,12 +441,31 @@ _tasks_refill(Tasks *tasks)
      e_gadcon_client_min_size_set(tasks->gcc, 0, 0);
 }
 
+static Eina_Bool
+_refill_timer(void *d EINA_UNUSED)
+{
+   if (e_drag_current_get()) return EINA_TRUE;
+
+   _tasks_refill_all();
+   task_refill_timer = NULL;
+   return EINA_FALSE;
+}
+
 static void
 _tasks_refill_all(void)
 {
    const Eina_List *l;
    Tasks *tasks;
 
+   if (e_drag_current_get())
+     {
+        if (task_refill_timer)
+          ecore_timer_reset(task_refill_timer);
+        else
+          task_refill_timer = ecore_timer_add(0.5, _refill_timer, NULL);
+        return;
+     }
+
    EINA_LIST_FOREACH(tasks_config->tasks, l, tasks)
      {
         _tasks_refill(tasks);