]> git.neil.brown.name Git - edlib.git/commitdiff
Move attach-x11selection out of display attachment
authorNeilBrown <neil@brown.name>
Sat, 26 Jun 2021 05:59:21 +0000 (15:59 +1000)
committerNeilBrown <neil@brown.name>
Sat, 26 Jun 2021 05:59:21 +0000 (15:59 +1000)
Rather than the display pane auto-attaching x11selection, do that when
putting an initial pane stack together.

Signed-off-by: NeilBrown <neil@brown.name>
display-ncurses.c
edlib.c
python/display-pygtk.py
python/lib-server.py

index 9e4b4ce7dde8a4552565702de36a67cd81dc3ab6..92a08ba4b853cdd073f21aca88294a2b9e37e861 100644 (file)
@@ -1361,12 +1361,9 @@ DEF_CMD(display_ncurses)
                term = "xterm-256color";
 
        p = ncurses_init(ci->focus, tty, term);
-       if (p) {
-               struct pane *p2 = call_ret(pane, "attach-x11selection", p);
-               if (p2)
-                       p = p2;
+       if (p)
                return comm_call(ci->comm2, "callback:display", p);
-       }
+
        return Efail;
 }
 
diff --git a/edlib.c b/edlib.c
index 8c6666233484b41ca43316a5071cda8449b8339d..a7dbfb8fb5cfb3248a776968f175924097380a59 100644 (file)
--- a/edlib.c
+++ b/edlib.c
@@ -50,6 +50,8 @@ static char shortopt[] = "gt";
 
 static struct pane *make_stack(struct pane *p, struct pane *doc)
 {
+       if (p)
+               p = call_ret(pane, "attach-x11selection", p);
        if (p)
                p = call_ret(pane, "attach-messageline", p);
        if (p)
index 916af0694ef1ae1746e5fcd82270e48519d22fe3..173c370caed7ff6b11888916f74fdd6cebfa3522 100644 (file)
@@ -669,10 +669,7 @@ def new_display(key, focus, comm2, str1, **a):
         s.set_long_property("Gtk-xft-dpi",sc*Pango.SCALE, "code")
 
     disp = EdDisplay(focus, str1)
-    p = disp.call("attach-x11selection", ret='pane')
-    if not p:
-        p = disp
-    comm2('callback', p)
+    comm2('callback', disp)
     return 1
 
 def new_display2(key, focus, **a):
@@ -706,4 +703,3 @@ def new_display2(key, focus, **a):
 
 editor.call("global-set-command", "attach-display-pygtk", new_display)
 editor.call("global-set-command", "interactive-cmd-x11window", new_display2)
-
index 7cc0d032cf6ebf6cb0848a1b701cf31c7d4f209e..7606dc26f465af49f6790b4c4a34607313fc1fff 100755 (executable)
@@ -118,6 +118,7 @@ try:
                     for v in env:
                         p[v] = env[v]
                     self.disp = p
+                    p = p.call("attach-x11selection", ret='pane')
                     p = p.call("attach-messageline", ret='pane')
                     p = p.call("attach-global-keymap", ret='pane')
                     p.call("attach-mode-emacs")