Community
Participate
Working Groups
CQ: WIND00192293 On some Linux systems it can be observed that pasting a text into the terminal control does not work. Sometimes the text can be pasted to an external editor, sometimes not. While debugging the issue on a system where it can be reproduced, it turned out that the "hide menu" event is executed before the action got the chance to perform it's execution logic. run() is therefor never called as the action got disabled already. In this context, the use of the "aboutToShow" parameter to the updateAction(...) method should be reviewed for each terminal action.
This is a regression introduced by the fix for bug 294719, which added an "aboutToShow" check for computing enabled state. Since that fix was introduced after 3.1.1, only 3.2 is affected for now. Correct code should look like this: public void updateAction(boolean aboutToShow) { if(aboutToShow) { ITerminalViewControl target = getTarget(); boolean bEnabled = target != null && target.getClipboard() != null && !target.getClipboard().isDisposed(); if (bEnabled) { String strText = (String) target.getClipboard().getContents( TextTransfer.getInstance()); bEnabled = ((strText != null) && (!strText.equals("")) && (target.getState() == TerminalState.CONNECTED));//$NON-NLS-1$ } setEnabled(bEnabled); } } That is, we only re-compute and re-set enabled state when the menu is about to show. Otherwise, enabled state remains as it was before. Note that respecting "aboutToShow" is only a Performance improvement and could also be omitted completely. In fact omitting it may be necessary to properly handle the retargetable global cut/copy/paste actions eventually as per bug 166150. The same arguments apply to both TerminalActionPaste and TerminalActionCopy.
CQ:WIND00192293
Committed to the 3.2 Stream without the "aboutToShow" performance improvement.