|
|
Created:
6 years, 7 months ago by jianli Modified:
6 years, 7 months ago Reviewers:
Dmitry Titov CC:
chromium-reviews, jennb, dcheng Base URL:
svn://svn.chromium.org/chrome/trunk/src Visibility:
Public. |
DescriptionFix the bug that minimized panel window might steal focus on Mac
This is caused by the problem that the minimized panel could still become a key window. We found out a way to deactivate a NSWindow correctly.
BUG=365758
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=272420
Patch Set 1 #
Total comments: 2
Patch Set 2 : Change the way to deactivate a window #Patch Set 3 : Fix stacked panels #Patch Set 4 : Fix trybots #Messages
Total messages: 16 (0 generated)
As I understand, you are removing resizable mask because a window w/o resizable or title masks can not take focus : https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Applica... However, I don't think I understand the early return in windowDidBecomeKey , could you clarify? https://codereview.chromium.org/275693002/diff/1/chrome/browser/ui/cocoa/pane... File chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm (right): https://codereview.chromium.org/275693002/diff/1/chrome/browser/ui/cocoa/pane... chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm:591: // Prevent the minimized panel from invoking any activation logic. This is I'm not sure I understand the change being made. If the window is receiving "didBecomeKey", doesn't it mean the OS already has transferred focus to it? Would it work if we implement -(BOOL)canBecomeKeyWindow and return NO if it is minimized? If you are trying to avoid setting a resizable window mask when the window is minimized, then perhaps this return should be moved to later in this function. It feels strange not to activate RWHV on windowDidBecomeKey...
https://codereview.chromium.org/275693002/diff/1/chrome/browser/ui/cocoa/pane... File chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm (right): https://codereview.chromium.org/275693002/diff/1/chrome/browser/ui/cocoa/pane... chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm:591: // Prevent the minimized panel from invoking any activation logic. This is On 2014/05/16 16:37:38, Dmitry Titov wrote: > I'm not sure I understand the change being made. If the window is receiving > "didBecomeKey", doesn't it mean the OS already has transferred focus to it? > Would it work if we implement -(BOOL)canBecomeKeyWindow and return NO if it is > minimized? > > If you are trying to avoid setting a resizable window mask when the window is > minimized, then perhaps this return should be moved to later in this function. > It feels strange not to activate RWHV on windowDidBecomeKey... We do instruct canBecomeKeyWindow to return NO but it is never called by the system when the window is already a key window. I found another way to deactivate a NSWindow programatically.
reluctant lgtm. Please give it a lot of manual testing, since other behavior may be broken... - with and w/o Chrome windows - more then on Chrome window - more then one panel - panel with focus closed - last Chrome window with focus closed - with both docked and stacked panels I have vague recollection we already did orderOut/orderFront and for some reason we ended up not using it. Lets give it a lot of test...
On 2014/05/20 01:35:32, Dmitry Titov wrote: > reluctant lgtm. > > Please give it a lot of manual testing, since other behavior may be broken... > - with and w/o Chrome windows > - more then on Chrome window > - more then one panel > - panel with focus closed > - last Chrome window with focus closed > - with both docked and stacked panels > > I have vague recollection we already did orderOut/orderFront and for some reason > we ended up not using it. Lets give it a lot of test... I will do more manual testing on this. I just checked revision history. It seemed that http://src.chromium.org/viewvc/chrome?view=revision&revision=106832 was the first version to introduce the logic to deactivate the app. Probably orderOut/orderFront was used for other scenarios, like fullscreen mode support.
Did a lot of manual testings to make sure everything works all right. Found only one problem with collapsing a stacked panel and got the fix for it. Dimich, could you please review again? Thanks.
lgtm, thanks for testing it!
The CQ bit was checked by jianli@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jianli@chromium.org/275693002/40001
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: android_dbg_triggered_tests on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_dbg_triggered...) mac_chromium_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/mac_chromium_rel/buil...)
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: android_dbg_triggered_tests on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_dbg_triggered...)
The CQ bit was checked by jianli@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jianli@chromium.org/275693002/60001
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: mac_chromium_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/mac_chromium_rel/buil...)
Message was sent while issue was closed.
Change committed as 272420 |