]> git.neil.brown.name Git - edlib.git/commitdiff
Move root popups to the tile-root.
authorNeilBrown <neil@brown.name>
Wed, 2 Dec 2015 01:05:06 +0000 (12:05 +1100)
committerNeilBrown <neil@brown.name>
Wed, 2 Dec 2015 01:05:06 +0000 (12:05 +1100)
Having popups always attached to tiles seems clean and will make
pane-movement easier.

Signed-off-by: NeilBrown <neil@brown.name>
lib-keymap.c
lib-popup.c
lib-tile.c

index 7d996b8467b675fdd3587b32668b0d8bab396d41..1aae71da49fbd2f7456f4902bd5f24f463bd2691 100644 (file)
@@ -55,10 +55,6 @@ DEF_CMD(keymap_handle)
                return 1;
        }
 
-       if (kd->global && strcmp(ci->key, "global-key-root") == 0) {
-               ci->focus = ci->home;
-               return 1;
-       }
        if (kd->global && strncmp(ci->key, "local-", 6) == 0) {
                if (strcmp(ci->key, "local-set-key") == 0 ||
                    strcmp(ci->key, "local-add-keymap") == 0 ||
index 40d018c8543d7eb326ce3ffcae6775fc3a5a8cf1..8b04d8fd4588832462e80af056864413a1b8aea8 100644 (file)
@@ -140,7 +140,7 @@ DEF_CMD(popup_attach)
        if (strchr(style, 'D')) {
                int x = 0, y = 0;
                pane_to_root(ci->focus, &x, &y, &z, NULL, NULL);
-               root = call_pane("global-key-root", ci->focus, 0, NULL, 0);
+               root = call_pane("RootPane", ci->focus, 0, NULL, 0);
        } else
                root = call_pane("ThisPane", ci->focus, 0, NULL, 0);
        if (!root)
index e71e5c26235c232ef1cf86576ae1c65855d78162..34afbf68f2a0ee576d5c9d6e9392d492d75440df 100644 (file)
@@ -578,6 +578,18 @@ DEF_CMD(tile_this)
        return 1;
 }
 
+DEF_CMD(tile_root)
+{
+       struct pane *p = ci->home;
+       struct tileinfo *ti = p->data;
+       while (ti->direction != Neither) {
+               p = p->parent;
+               ti = p->data;
+       }
+       ci->focus = p;
+       return 1;
+}
+
 void edlib_init(struct editor *ed)
 {
        tile_map = key_alloc();
@@ -585,6 +597,7 @@ void edlib_init(struct editor *ed)
        key_add(tile_map, "WindowOP", &tile_command);
        key_add(tile_map, "OtherPane", &tile_other);
        key_add(tile_map, "ThisPane", &tile_this);
+       key_add(tile_map, "RootPane", &tile_root);
 
        key_add(ed->commands, "attach-tile", &tile_attach);
 }