Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Fix #16538: Middle-click pastes into read only editor on Linux #16611

Merged
merged 1 commit into from
Jan 23, 2018

Conversation

daviwil
Copy link
Contributor

@daviwil daviwil commented Jan 23, 2018

This change fixes an issue where users on Linux are able to paste into
read only TextEditors by clicking the middle mouse button. The fix is
to check for whether the TextEditorComponent's isInputEnabled method
returns true before pasting with middle click on Linux.

Verification Process

On Linux:

  1. Copy text from an open buffer in Atom
  2. Create a new editor with Ctrl+N
  3. Drop into DevTools console and execute atom.workspace.getActiveTextEditor().setReadOnly(true)
  4. Click the middle mouse button in the editor, verify that no text was pasted
  5. Back in the DevTools console, execute atom.workspace.getActiveTextEditor().setReadOnly(false)
  6. Click the middle mouse button in the editor, verify that the expected text was pasted

This change fixes an issue where users on Linux are able to paste into
read only TextEditors by clicking the middle mouse button.  The fix is
to check for whether the TextEditorComponent's isInputEnabled method
returns true before pasting with middle click on Linux.
Copy link
Contributor

@jasonrudolph jasonrudolph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daviwil: The diff looks good. 👍

Can I talk you into summarizing the verification steps?

@daviwil
Copy link
Contributor Author

daviwil commented Jan 23, 2018

Sure! Added it to the PR description.

Copy link
Contributor

@nathansobo nathansobo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks excellent from a code perspective. If it actually works, which I'll have trust you on, 🚢 .

@daviwil
Copy link
Contributor Author

daviwil commented Jan 23, 2018

Definitely works :) Thanks all!

@daviwil daviwil merged commit 7cbca54 into master Jan 23, 2018
@daviwil daviwil deleted the dw-fix-16538 branch January 23, 2018 15:41
@jasonrudolph
Copy link
Contributor

Added it to the PR description.

Nice. Thanks, @daviwil! Those verification steps look great. ⚡

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants