Context menu and sidebar sometimes populated incorrectly
Open, Needs TriagePublic

Description

Opening the context menu for an image in Browse mode works only after the second click.

I can't replicate this :(

Try deselecting the image first, either by clicking on the hover button or by clicking in the empty area to the right of the viewport.

There's another problem for the Operations sidebar and the toolbar too: Even after the second click, i.e. when context menu finally appears, Image Operations is still empty and the Rotate toolbar buttons are disabled. It never occurred to me before, but now I realize that perhaps this is connected to the issue.

rkflx created this task.Mar 1 2018, 10:46 PM
huoni added a comment.EditedMar 2 2018, 12:00 AM

Okay so I can replicate the first issue - when right clicking an image with no image currently selected, you get an unpopulated context menu. It seems perhaps the context menu is populated before the selection changes.

However I can't replicate the second issue - as soon as I right click an image as above, the Operations are populated and toolbar rotate buttons enabled. In other words, I cannot get to a state where an image is selected but the operations are missing/greyed.
EDIT: I take some of that back. I can get into this state by starting with no image selected and clicking the selection hover button.

huoni added a comment.EditedMar 2 2018, 12:16 AM

Seems pretty inconsistent to me actually. Sometimes right click enables operations, sometimes not. Can't figure out exactly what it is.

huoni added a comment.Mar 3 2018, 11:12 AM

Some progress in debugging this!

When right clicking a thumbnail, the context menu is displayed before the actions are updated. This is only noticeable when no image is selected before right clicking, but in fact is in effect whenever you you right click an image you don't already have selected.

The reason this happens is because ContextManager queues signals, including the selectionChanged signal (see contextmanager.cpp:250). Seemingly, it's this queuing which delays the actions updating until after the context menu is displayed.

Now regarding the second issue mentioned, I haven't figured this one out yet, but it's something to do with the selectionDataChanged signal firing or not firing.

I just noticed another related issue.
In View Mode showing multiple images the Image Operations menu is not updated on changing selection to another image type (raster/vector).