Skip to content

Commit

Permalink
Fix bug with backwards clipboard compatibility
Browse files Browse the repository at this point in the history
Check if metadata file is not stale when copying/pasting
from global clipboard instead of using it blindly.
Also fixed a minor name bug.
  • Loading branch information
marmarta committed Nov 6, 2024
1 parent 6a10776 commit e7c183f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions qui/clipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ def process_IN_CLOSE_WRITE(self, _unused=None):
''' Reacts to modifications of the FROM file '''
metadata = {}
with appviewer_lock():
if os.path.isfile(METADATA):
if (os.path.isfile(METADATA) and
os.path.getmtime(METADATA) >= os.path.getmtime(DATA)):
# parse JSON .metadata file if qubes-guid protocol 1.8 or newer
try:
with open(METADATA, 'r', encoding='ascii') as metadata_file:
Expand All @@ -196,7 +197,7 @@ def process_IN_CLOSE_WRITE(self, _unused=None):
metadata["sent_size"] = 0

metadata["cleared"] = metadata["sent_size"] == 0
metadata["qrexec_request"] = False
metadata["qrexec_clipboard"] = False
metadata["malformed_request"] = False
metadata["oversized_request"] = metadata["sent_size"] >= 65000
metadata["buffer_size"] = 65000
Expand Down

0 comments on commit e7c183f

Please sign in to comment.