每次复制前先清除剪切板

master
yutent 2023-08-09 20:21:50 +08:00 committed by GitHub
parent bb56aaf274
commit 49f3c0f27c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

3
shotit
View File

@ -10,7 +10,7 @@ gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk, GLib, GdkPixbuf from gi.repository import Gtk, Gdk, GLib, GdkPixbuf
from PIL import Image, ImageFilter, ImageChops from PIL import Image, ImageFilter, ImageChops
app_id = 'fun.wkit.shotme' app_id = 'fun.wkit.shotit'
def pixbuf_to_pil(pixbuf): def pixbuf_to_pil(pixbuf):
@ -69,6 +69,7 @@ class Application(Gtk.Application):
def copy(self, image): def copy(self, image):
# 写图片进剪切板 # 写图片进剪切板
self.clipboard.clear()
self.clipboard.set_image(image) self.clipboard.set_image(image)
self.clipboard.store() self.clipboard.store()