Skip to content

Commit 84fbc0a

Browse files
committed
Fix clipboard on my wayland installation
1 parent 9551195 commit 84fbc0a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

gui/utils/clipboard.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def toClipboard(text):
1414
1515
See: https://discuss.wxpython.org/t/wx-theclipboard-pasting-different-content-on-every-second-paste/35361
1616
"""
17-
clipboard = wx.Clipboard()
17+
clipboard = wx.TheClipboard
1818
try:
1919
# Explicitly use CLIPBOARD selection, not PRIMARY selection
2020
# This prevents X11 confusion between the two clipboard types
@@ -24,7 +24,6 @@ def toClipboard(text):
2424
try:
2525
data = wx.TextDataObject(text)
2626
clipboard.SetData(data)
27-
clipboard.Flush() # Ensure clipboard manager gets the data
2827
return True
2928
finally:
3029
clipboard.Close()
@@ -45,7 +44,7 @@ def fromClipboard():
4544
4645
See: https://discuss.wxpython.org/t/wx-theclipboard-pasting-different-content-on-every-second-paste/35361
4746
"""
48-
clipboard = wx.Clipboard()
47+
clipboard = wx.TheClipboard
4948
try:
5049
# Explicitly use CLIPBOARD selection, not PRIMARY selection
5150
# This prevents X11 confusion between the two clipboard types

0 commit comments

Comments
 (0)