Nux

Code review comment for lp:~nick-dedekind/nux/lp1057995.mouse-drag-delta

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

And it's always a good idea to ask the author or the last person that worked on the code you're changing (me! :) ) for a review, when viable. They usually have a good understanding of that code and therefore might come up with good suggestions and approaches.

In this case, for instance:

* mouse_position_on_owner_ is used only to come up with the delta for the mouse drag signal in line 358. There's no point in filling it up as you did on line 601 as there can't be an upcoming drag if the mouse is not pressed (and therefore there's no owner).

* mouse_position_on_owner_ should be updated and used only inside WindowCompositor::TrackMouseMovement() (check commments in MouseEventCycle). In the refactoring I tried to split responsibilities between methods to keeps things more manageable. Here you're starting to mix them again.

* This bug has show that line 310 is likely never called (the cause of the bug). A proper fix would have taken care of that. This is one just turned it into dead code, making the logic misleading.

« Back to merge proposal