eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
19.94k stars 2.49k forks source link

TreeWidget: Ensure globalSelection is correctly set when opening context menu #13710

Closed jonah-iden closed 4 months ago

jonah-iden commented 4 months ago

What it does

Closes #12937

This ensures the globalSelection is set correctly when focusing a tree widget. There are cases where when restoring the layout the global selection is not set because the widget is not yet active and when opening the context menu there is no selection changed event so the global selection stays at the old value. See the linked issue

How to test

Taken from the linked issue

  1. Open a file
  2. Click in the Navigator to give it focus (this is actually optional as long as the navigator is open)
  3. Reload the window
  4. Open the context menu for the already preselected file in the navigator widget

Follow-ups

Review checklist

Reminder for reviewers