Comments (4)
Thanks. Works like a charm!
// Test is done on i3wm on Xorg.
from emacs.
I confirmed org-download-clipboard works on pgtk emacs.
I executed wl-copy -t image/png < test2.png
on a terminal, and
did M-x org-download-clipboard on pgtk emacs.
from emacs.
My fault. I only tested the telega
method, and thought org-download-clipboard
would have the same problem. After checking the code, it turns out org-download
uses shell command (wl-paste/xclip/convert/pngpaste) to get the clipboard. On the other hand, telega-chatbuf-attach-clipboard
uses gui-get-selection
provided by Emacs with the following code snippet:
(defun telega-chatbuf-attach-clipboard (doc-p)
"Attach clipboard image to the chatbuf as photo.
If `\\[universal-argument]' is given, then attach clipboard as document."
(interactive "P")
(let* ((selection-coding-system 'no-conversion) ;for rawdata
(temporary-file-directory telega-temp-dir)
(tmpfile (telega-temp-name "clipboard" ".png"))
(coding-system-for-write 'binary))
(if (eq system-type 'darwin)
(progn
;; NOTE: On MacOS, try extracting clipboard using pngpaste
(unless (executable-find "pngpaste")
(error "Please install pngpaste to paste images"))
(unless (= 0 (telega-screenshot-with-pngpaste tmpfile))
(error "No image in CLIPBOARD")))
(write-region (or (gui-get-selection 'CLIPBOARD 'image/png)
(error "No image in CLIPBOARD"))
nil tmpfile nil 'quiet))
(telega-chatbuf--attach-tmp-photo tmpfile doc-p)))
On a normal Emacs branch, when there is image in the clipboard, (gui-get-selection 'CLIPBOARD 'image/png)
would return a string of the image. But on pgtk emacs, it returns nil
.
BTW, a quick ripgrep shows this also affects emacs-slack.
from emacs.
I fixed on feature/pgtk in savannah. Please test it.
from emacs.
Related Issues (20)
- Sometimes segmentation fault when using selectrum-mode HOT 2
- Failed to compile when enable PGTK_DEBUG HOT 3
- Emacs daemon crash after several Sway reloads HOT 8
- Super key problem HOT 2
- org-roam-mode+marginalia-mode hangs `C-h v` HOT 3
- Empty new frame after disabled menu/scroll/tool bar HOT 5
- "top" and "left" frame parameters HOT 1
- Shift-space not registering HOT 7
- Cannot scroll with xterm-mouse-mode HOT 1
- Segfault in pgtk_mouse_position HOT 2
- child frame focus issue HOT 4
- C-= does not register HOT 2
- compilation error due to empty last case in switch HOT 1
- emacs cannot paste unicode characters correctly HOT 21
- Is pgtk fork suppose to support macOS? HOT 23
- Scrollbars do not have hover/pressed colors HOT 3
- Touchscreen input support? HOT 7
- Clipboard not working with other apps when launched with systemd after reboot HOT 6
- Minibuffer feels frozen when using straight.el's `straight-rebuild-all` HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emacs.