|
|
Created:
6 years, 7 months ago by varkha Modified:
6 years, 7 months ago CC:
chromium-reviews, tfarina, ben+corewm_chromium.org Base URL:
svn://svn.chromium.org/chrome/trunk/src Visibility:
Public. |
DescriptionIgnores mouse motion events when mouse is pressed or drag and drop is in progress in TooltipController to prevent scroll jankiness. The tooltip should be hidden in those cases anyway and we can skip early.
This improves scrolling and dragging content, notably with sites like Google maps or sites that use pointer lock such as http://media.tojicode.com/q3bsp/.
It also seems to fix laggy text selection in omnibox (tried before and after the patch.
BUG=370255, 364677
TEST=Follow steps in the bug (drag http://maps.google.com)
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=272272
Patch Set 1 #
Total comments: 8
Patch Set 2 : Ignore mouse motion events when mouse is pressed or drag and drop is in progress #
Total comments: 2
Patch Set 3 : Ignores mouse motion events when mouse is pressed or drag and drop is in progress (comments) #Patch Set 4 : Ignores mouse motion events when mouse is pressed or drag and drop is in progress (comment) #Messages
Total messages: 46 (0 generated)
erg@, can you please take a look? I am not sure if I saw the worst of maps dragging to begin with but the occasional hiccups seem to be gone with the patch. Shamelessly stealing your idea from https://codereview.chromium.org/56053005. Thanks!
+erg@
https://codereview.chromium.org/274753002/diff/1/ui/views/corewm/tooltip_cont... File ui/views/corewm/tooltip_controller.cc (right): https://codereview.chromium.org/274753002/diff/1/ui/views/corewm/tooltip_cont... ui/views/corewm/tooltip_controller.cc:102: if (!IsValidTarget(event_target, screen_target)) Idea: It might be useful to check whether there are any valid targets before calling GetWindowAtScreenPoint() (I do not think there is a Windows of version of DesktopWindowTreeHostX11::GetAllOpenWindows() though) In a separate CL it might also be useful to rename GetWindowAtScreenPoint() to GetWindowAtScreenPointSlow() (and add a comment in GetWindowAtScreenPointSlow() as to when it is slow)
https://codereview.chromium.org/274753002/diff/1/ui/views/corewm/tooltip_cont... File ui/views/corewm/tooltip_controller.cc (right): https://codereview.chromium.org/274753002/diff/1/ui/views/corewm/tooltip_cont... ui/views/corewm/tooltip_controller.cc:102: if (!IsValidTarget(event_target, screen_target)) On 2014/05/07 22:45:08, pkotwicz wrote: > Idea: It might be useful to check whether there are any valid targets before > calling GetWindowAtScreenPoint() (I do not think there is a Windows of version > of DesktopWindowTreeHostX11::GetAllOpenWindows() though) This may speed this method but with the throttling in place it would not change much since we are effectively calling this method only once and after the mouse is steady. > In a separate CL it might also be useful to rename GetWindowAtScreenPoint() to > GetWindowAtScreenPointSlow() (and add a comment in GetWindowAtScreenPointSlow() > as to when it is slow) I agree. I'll post that once this gets through review.
lgtm
The CQ bit was checked by varkha@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/varkha@chromium.org/274753002/1
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are real, and report flakes to chrome-troopers@google.com. The failing builders are: chromium_presubmit on tryserver.chromium linux_chromium_chromeos_rel on tryserver.chromium win_chromium_x64_rel on tryserver.chromium
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium
+sky@ for OWNERS.
This seems like a total hack to me. What is causing the slow down?
On 2014/05/08 16:02:30, sky wrote: > This seems like a total hack to me. What is causing the slow down? Repeated X11 calls on mouse movement in absense of caching of windows tree including coordinates and stacking order. We may be able to remove this once we have this caching in place.
For discussion: I am unsure as to WHEN we should cache the X11 window tree. We probably should when dragging tabs. However, caching the window tree while dragging tabs does not fix slowness in the TooltipController. I want to avoid needing to always have the entire X11 window tree cached.
https://codereview.chromium.org/274753002/diff/1/ui/views/corewm/tooltip_cont... File ui/views/corewm/tooltip_controller.cc (right): https://codereview.chromium.org/274753002/diff/1/ui/views/corewm/tooltip_cont... ui/views/corewm/tooltip_controller.cc:197: base::Bind(&TooltipController::DispatchMouseEvent, What happens if we enter some sort of nested message loop that prevents this from executing? https://codereview.chromium.org/274753002/diff/1/ui/views/corewm/tooltip_cont... ui/views/corewm/tooltip_controller.cc:200: static_cast<aura::Window*>(event->target()))); What if window is destroyed between now and when this is processed? https://codereview.chromium.org/274753002/diff/1/ui/views/corewm/tooltip_cont... ui/views/corewm/tooltip_controller.cc:204: if ((event->flags() & ui::EF_IS_NON_CLIENT) == 0) { If you process the above async and this (and whell) sync doesn't that lead to out of order processing?
sky@, do you think the issues with this CL are resolvable? I think they are (see comments) and the tooltip handling is naturally driven by timers so maybe this is not completely alien. It seems having this safety valve in place will be helpful if we can make it safe. https://codereview.chromium.org/274753002/diff/1/ui/views/corewm/tooltip_cont... File ui/views/corewm/tooltip_controller.cc (right): https://codereview.chromium.org/274753002/diff/1/ui/views/corewm/tooltip_cont... ui/views/corewm/tooltip_controller.cc:197: base::Bind(&TooltipController::DispatchMouseEvent, On 2014/05/08 19:05:55, sky wrote: > What happens if we enter some sort of nested message loop that prevents this > from executing? We would need to synchronously process any pending mouse move before going into a nested loop. We could trigger it in DesktopNativeWidgetAura::RunMoveLoop(). https://codereview.chromium.org/274753002/diff/1/ui/views/corewm/tooltip_cont... ui/views/corewm/tooltip_controller.cc:200: static_cast<aura::Window*>(event->target()))); On 2014/05/08 19:05:55, sky wrote: > What if window is destroyed between now and when this is processed? We could maintain a set of windows for which we have a pending dispatch, watch for them being destroyed and check if a window is still in the set when doing dispatch. I cannot think of a degenerate case where this set would be significantly long. Does this seem like a right approach to you? https://codereview.chromium.org/274753002/diff/1/ui/views/corewm/tooltip_cont... ui/views/corewm/tooltip_controller.cc:204: if ((event->flags() & ui::EF_IS_NON_CLIENT) == 0) { On 2014/05/08 19:05:55, sky wrote: > If you process the above async and this (and wheel) sync doesn't that lead to > out of order processing? It could. It should be easy to just call a sync dispatch here and stop the timer if we have mouse_event_timer_ running.
As I said before, all of this is a total hack. I would prefer you don't touch TooltipController (well, only minimally). If we want to delay processing for some amount of time that should be done in a separate object that feeds into TooltipController. That other object can have all the logic that I mention as needed here. I would prefer the throttling to sit in front of TooltipController, but it may be easier for TooltipController to own the throttler. On Tue, May 13, 2014 at 12:30 PM, <varkha@chromium.org> wrote: > sky@, do you think the issues with this CL are resolvable? I think they are > (see > comments) and the tooltip handling is naturally driven by timers so maybe > this > is not completely alien. It seems having this safety valve in place will be > helpful if we can make it safe. > > > > https://codereview.chromium.org/274753002/diff/1/ui/views/corewm/tooltip_cont... > File ui/views/corewm/tooltip_controller.cc (right): > > https://codereview.chromium.org/274753002/diff/1/ui/views/corewm/tooltip_cont... > ui/views/corewm/tooltip_controller.cc:197: > base::Bind(&TooltipController::DispatchMouseEvent, > On 2014/05/08 19:05:55, sky wrote: >> >> What happens if we enter some sort of nested message loop that > > prevents this >> >> from executing? > > > We would need to synchronously process any pending mouse move before > going into a nested loop. We could trigger it in > DesktopNativeWidgetAura::RunMoveLoop(). > > > https://codereview.chromium.org/274753002/diff/1/ui/views/corewm/tooltip_cont... > ui/views/corewm/tooltip_controller.cc:200: > static_cast<aura::Window*>(event->target()))); > On 2014/05/08 19:05:55, sky wrote: >> >> What if window is destroyed between now and when this is processed? > > > We could maintain a set of windows for which we have a pending dispatch, > watch for them being destroyed and check if a window is still in the set > when doing dispatch. I cannot think of a degenerate case where this set > would be significantly long. Does this seem like a right approach to > you? > > > https://codereview.chromium.org/274753002/diff/1/ui/views/corewm/tooltip_cont... > ui/views/corewm/tooltip_controller.cc:204: if ((event->flags() & > ui::EF_IS_NON_CLIENT) == 0) { > On 2014/05/08 19:05:55, sky wrote: >> >> If you process the above async and this (and wheel) sync doesn't that > > lead to >> >> out of order processing? > > > It could. It should be easy to just call a sync dispatch here and stop > the timer if we have mouse_event_timer_ running. > > https://codereview.chromium.org/274753002/ To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
Maybe we don't need to process the mouse movement events when we know that TooltipController::UpdateIfRequired() will return early (when tooltips are disabled or when a drag operation is in progress). Can you please take a look?
https://codereview.chromium.org/274753002/diff/20001/ui/views/corewm/tooltip_... File ui/views/corewm/tooltip_controller.cc (right): https://codereview.chromium.org/274753002/diff/20001/ui/views/corewm/tooltip_... ui/views/corewm/tooltip_controller.cc:188: if (!tooltips_enabled_ || I think this early out is too early. You still want to hide the tooltip, stop the timer and other stuff.
PTAL. https://codereview.chromium.org/274753002/diff/20001/ui/views/corewm/tooltip_... File ui/views/corewm/tooltip_controller.cc (right): https://codereview.chromium.org/274753002/diff/20001/ui/views/corewm/tooltip_... ui/views/corewm/tooltip_controller.cc:188: if (!tooltips_enabled_ || On 2014/05/20 20:43:22, sky wrote: > I think this early out is too early. You still want to hide the tooltip, stop > the timer and other stuff. You are right - for the capture changes and mouse exits this needs to be done here.
LGTM
Valery, before committing can you please update the CL description?
On 2014/05/21 00:34:14, pkotwicz wrote: > Valery, before committing can you please update the CL description? Done. I have also added a comment in code about why we want to do this.
The CQ bit was checked by varkha@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/varkha@chromium.org/274753002/70001
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are real, and report flakes to chrome-troopers@google.com. The failing builders are: win_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu_triggered...)
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu_triggered...)
The CQ bit was checked by varkha@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/varkha@chromium.org/274753002/70001
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are real, and report flakes to chrome-troopers@google.com. The failing builders are: win_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu_triggered...)
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu_triggered...)
The CQ bit was checked by varkha@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/varkha@chromium.org/274753002/70001
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are real, and report flakes to chrome-troopers@google.com. The failing builders are: win_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu_triggered...)
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu_triggered...)
The CQ bit was checked by varkha@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/varkha@chromium.org/274753002/70001
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are real, and report flakes to chrome-troopers@google.com. The failing builders are: win_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu_triggered...)
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu_triggered...)
The CQ bit was checked by varkha@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/varkha@chromium.org/274753002/70001
Message was sent while issue was closed.
Change committed as 272272 |