Workaround broken popup on Terminology
authorIván Briano <ivan.briano@intel.com>
Mon, 31 Mar 2014 17:50:53 +0000 (14:50 -0300)
committerIván Briano <ivan.briano@intel.com>
Mon, 31 Mar 2014 17:50:53 +0000 (14:50 -0300)
As the comment in the code explains, when ctxpopup is shown, it's giving
focus to the inner list, which immediately decides to select the first
of its items, calling, in the process, its selection callback. This has
the very unfortunate, annoying and uselessly broken effect of making the
popup never showing up, and instead triggering the first action in it.

Since this behavior of "select first item on focus" seems to be the path
taken in other places, I'm letting the people that know what they want
to do about that figure out how to fix it properly.

src/lib/elc_ctxpopup.c

index 89626965594082886f675e50f9e01c725b95c33c..ef339a3914ba826de8efc38985ba5c989067d7aa 100644 (file)
@@ -927,7 +927,16 @@ _on_show(void *data EINA_UNUSED,
      {
         elm_list_go(sd->list);
         sd->visible = EINA_TRUE;
-        elm_object_focus_set(sd->list, EINA_TRUE);
+        /*
+         * XXX: Giving focus to the list when it has nothing selected makes
+         * it select the first of its items, which makes the popup in
+         * Terminology never open and instead just trigger the first option.
+         * I'll let as an excercise to the reader to figure out why that
+         * is so fucking annoying. Extra points for noting why this is my
+         * choice of a "fix" instead of fixing the actual focus/select issue
+         * that seems to be spread all over Elementary.
+         */
+        //elm_object_focus_set(sd->list, EINA_TRUE);
         return;
      }