Properly handle mouse in read-only mode
ClosedPublic

Authored by mglb on Mar 28 2018, 2:48 AM.

Details

Summary
  • Do not send mouse events and emulated up/down keys to programs when read-only mode is enabled.
  • Set the currentTerminalDisplay before sending key events, like in keyPressEvent.
  • wheelEvent code is restructured a bit to easily separate code not allowed in read-only mode.
Test Plan
  • Start Konsole
  • Run man man, do not press any key after enter
  • Turn on read only mode
  • Try to scroll using mouse wheel.
  • Expected result: scrolling does not work in read-only mode
  • Actual result: scrolling works in read only mode (but only when no key has been pressed before on 2nd terminal screen)
  • Start konsole
  • Run a program which uses mouse events, e.g. vim (enable mouse with :set mouse=a)
  • Make the program state suitable for using mouse events, e.g. enter a few lines of text
  • Confirm that mouse events (clicks, selection, wheel) work in the program
  • Turn on read-only mode
  • Try:
    • Click (left/right/middle button), double click
    • Mouse wheel
    • Click and move (selecting)
  • Expected result: mouse events are not passed to the program in read-only mode; nothing happens
  • Actual result: mouse events are passed to the program

Diff Detail

Repository
R319 Konsole
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mglb created this revision.Mar 28 2018, 2:48 AM
Restricted Application added a project: Konsole. · View Herald TranscriptMar 28 2018, 2:48 AM
mglb requested review of this revision.Mar 28 2018, 2:48 AM

To be clear the "test" area is after applying the patch correct? I can't tell the difference following those steps

mglb updated this revision to Diff 30818.Mar 28 2018, 10:45 PM
mglb retitled this revision from Properly handle wheel in read-only mode to Properly handle mouse in read-only mode.
mglb edited the summary of this revision. (Show Details)
mglb edited the test plan for this revision. (Show Details)
mglb removed a subscriber: hindenburg.
  • Removed tests for things fixed in latest commits and added one new test
  • Added proper mouse clicks handling in programs with mouse support in read-only mode

To be clear the "test" area is after applying the patch correct? I can't tell the difference following those steps

Yes, tests should work after patching. You are partially right, 1st and 3rd test did show something that was fixed in latest commits. I fixed the tests and description.

hindenburg accepted this revision.Mar 31 2018, 12:48 AM
This revision is now accepted and ready to land.Mar 31 2018, 12:48 AM
hindenburg edited the summary of this revision. (Show Details)Mar 31 2018, 12:59 AM
hindenburg edited the test plan for this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.