Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(720)

Issue 109403008: Disables showing tooltips while a system menu is showing on windows (Closed)

Created:
6 years, 11 months ago by sky
Modified:
6 years, 11 months ago
Reviewers:
varunjain
CC:
chromium-reviews, joi+watch-content_chromium.org, ben+aura_chromium.org, yusukes+watch_chromium.org, yukishiino+watch_chromium.org, tfarina, jam, penghuang+watch_chromium.org, sadrul, sievers+watch_chromium.org, jbauman+watch_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, kalyank, piman+watch_chromium.org, danakj+watch_chromium.org, James Su, ben+views_chromium.org, ben+corewm_chromium.org, miu+watch_chromium.org
Visibility:
Public.

Description

Disables showing tooltips while a system menu is showing on windows When a system menu is showing we continue to get and receive mouse events while the mouse is over the menu. The tooltip code thinks the mouse is over the aura::Window and will then show the tooltip. The fix is to disable tooltips while system menus are showing. I'm also making the only way to enable/disable tooltips be by way of a scoper. This should hopefully be less error prone. BUG=327970 TEST=none R=varunjain@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=243350

Patch Set 1 #

Patch Set 2 : cleanup #

Patch Set 3 : move resetting #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+141 lines, -6 lines) Patch
M content/browser/renderer_host/render_widget_host_view_aura.h View 2 chunks +5 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.cc View 1 2 3 chunks +4 lines, -5 lines 0 comments Download
M ui/aura/aura.gyp View 1 chunk +2 lines, -0 lines 0 comments Download
A ui/aura/client/scoped_tooltip_disabler.h View 1 1 chunk +39 lines, -0 lines 0 comments Download
A ui/aura/client/scoped_tooltip_disabler.cc View 1 1 chunk +43 lines, -0 lines 0 comments Download
M ui/aura/client/tooltip_client.h View 2 chunks +8 lines, -1 line 3 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host_win.h View 3 chunks +4 lines, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host_win.cc View 2 chunks +10 lines, -0 lines 0 comments Download
M ui/views/widget/native_widget_win.h View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/native_widget_win.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M ui/views/win/hwnd_message_handler.h View 1 3 chunks +7 lines, -0 lines 0 comments Download
M ui/views/win/hwnd_message_handler.cc View 1 3 chunks +12 lines, -0 lines 0 comments Download
M ui/views/win/hwnd_message_handler_delegate.h View 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
sky
6 years, 11 months ago (2014-01-06 22:38:56 UTC) #1
varunjain
LGTM https://codereview.chromium.org/109403008/diff/50001/ui/aura/client/tooltip_client.h File ui/aura/client/tooltip_client.h (right): https://codereview.chromium.org/109403008/diff/50001/ui/aura/client/tooltip_client.h#newcode27 ui/aura/client/tooltip_client.h:27: // Enables/Disables tooltips. This is treated as a ...
6 years, 11 months ago (2014-01-07 05:07:05 UTC) #2
sky
https://codereview.chromium.org/109403008/diff/50001/ui/aura/client/tooltip_client.h File ui/aura/client/tooltip_client.h (right): https://codereview.chromium.org/109403008/diff/50001/ui/aura/client/tooltip_client.h#newcode27 ui/aura/client/tooltip_client.h:27: // Enables/Disables tooltips. This is treated as a reference ...
6 years, 11 months ago (2014-01-07 16:52:02 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sky@chromium.org/109403008/50001
6 years, 11 months ago (2014-01-07 16:53:57 UTC) #4
commit-bot: I haz the power
Change committed as 243350
6 years, 11 months ago (2014-01-07 19:24:10 UTC) #5
varunjain
https://codereview.chromium.org/109403008/diff/50001/ui/aura/client/tooltip_client.h File ui/aura/client/tooltip_client.h (right): https://codereview.chromium.org/109403008/diff/50001/ui/aura/client/tooltip_client.h#newcode27 ui/aura/client/tooltip_client.h:27: // Enables/Disables tooltips. This is treated as a reference ...
6 years, 11 months ago (2014-01-08 15:43:08 UTC) #6
sky
6 years, 11 months ago (2014-01-08 15:53:35 UTC) #7
On Wed, Jan 8, 2014 at 7:43 AM,  <varunjain@chromium.org> wrote:
>
>
https://codereview.chromium.org/109403008/diff/50001/ui/aura/client/tooltip_c...
> File ui/aura/client/tooltip_client.h (right):
>
>
https://codereview.chromium.org/109403008/diff/50001/ui/aura/client/tooltip_c...
> ui/aura/client/tooltip_client.h:27: // Enables/Disables tooltips. This
> is treated as a reference count. Consumers
> On 2014/01/07 16:52:03, sky wrote:
>>
>> On 2014/01/07 05:07:06, varunjain wrote:
>> > I am not sure how much the ScopedDisabler buys. I am not opposed to
>
> to it, but
>>
>> I
>> > would have just created a static void SetTooltipsEnabled(Window*
>
> window, bool
>>
>> > enable), same as Set/GetTooltipText() below. That way, you do not
>
> need to add
>>
>> an
>> > observer.
>> > I think I am not sure what sort of errors are you trying to protect
>
> against.
>>
>> Are
>> > you worried that the root window might change between a disable and
>
> enable? If
>>
>> > so, first, I do not see what situation that could happen in and
>
> second, even
>>
>> if
>> > it happens, ScopedDisabler in its current form is not set up to
>
> re-enable the
>>
>> > tooltip of the old root window and disable for the new root.
>
>
>> RWHVA may move between root windows. You are correct that
>
> ScopedDisabler doesn't
>>
>> entirely deal with this situation, but at least it does not have the
>
> possibility
>>
>> of disabling on one and then reenabling on the wrong root.
>
>
> But in that case, the ScopedDisabler is even more incorrect. Consider
> for example, two roots R1 and R2 with RWHV1 and RWHV2 respectively. Both
> use scoped disabler to disable tooltips. Now both switch root windows so
> RWHV1 is in R2 and RWHV2 is in R1. Now if say RWHV1 tries to enable
> tooltips by resetting scoped disabler, it will enable R1's tooltips.

That's the desired outcome though, right? Otherwise we've left
tooltips disabled on R1 and they'll never be reenabled.

  -Scott

>
>
>
>> My assumption here is that if you've moving the window to a different
>
> root
>>
>> you'll recreate the scoper. But worse case you don't, the code won't
>
> cause any
>>
>> problems.
>
>
> The code will cause the problem I described above (although arguably its
> a degenerate case). Previous code would have just enabled the tooltip in
> the right root window.
>
> https://codereview.chromium.org/109403008/

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698