Code review comment for lp:~zsombi/ubuntu-ui-toolkit/textinputs-rightclick

Revision history for this message
Zsombor Egri (zsombi) wrote :

> > > > In the latest revision the selection is cleared when right-clicking
> > outside
> > > of
> > > > the selected text
> > > >
> > > > 1. Select some text
> > > > 2. Right-click somewhere in the unselected area
> > > > 3. Should be able to cut the selected text
> > >
> > > One of the requirements in the bug was that right click must work in the
> > same
> > > way as the pressAndHold does. pressAndHold works in this way even in the
> > > prerequisite.
> >
> > The bug literally says "right-click should trigger long press". It has no
> > description at all. My best guess is that any menu you will trigger via long
> > press should also be invoked via right-click. This is what I would expect.
> I'm
> > doubtful it implies deviating from correct right-click behavior on GTK+
> apps.
> >
> > The behavior is as it was in my last test run, so I'm afraid this is still
> > wrong until we reach a conclusion.
>
> Right click on desktop in QML/toolkit apps should behave like their GTK
> equivalent unless a strong case against it can be made.
> I would even say that the long press on device should mimic what the right
> click does.

I can make it so right click behaves like other GTK+ apps do, however I need to know which one to consider. I tried two apps, gedit and LibreOffice, they both behave differently.

gedit:
- rigth click over text opens the context menu, does not move the cursor
- right click over area where there's no text works the same as previous
- right click over selected text opens context menu
- rigth click anywhere else but selected text opens context menu, preserves selection

LibreOffice write:
- right click over a text selects the word and opens the context menu
- rigth click over area with no text moves the cursor to the closest position in the line, opens context menu
- rigth click over selected text opens context menu
- rigth click anywhere else but selected text clears selection, moves the cursor to the closest place to the click and opens popover

Our logic behaves as LibreOffice. On touch devices it also behaves like this. If I do both desktop and touch to behave the same way, I will introduce a regression, as pressAndHold so far moved the cursor and opened the context menu in place.

Now what?

« Back to merge proposal