New issue
Advanced search Search tips

Issue 49356 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Aug 2010
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug
M-7

Restricted
  • Only users with EditIssue permission may comment.



Sign in to add a comment

Click-drag-release doesn't work on wrench menu buttons

Project Member Reported by pinkerton@chromium.org, Jul 16 2010

Issue description

- click and hold the wrench menu button
- drag into the menu
- release the mouse over any of the new buttons, like cut/copy/paste or +/-

expected:
- should indicate they're selected somehow and when the mouse is released, they should send their target/action.
- the menu should go away

actual:
- no action is performed
- menu stays around, contrary to any other menu item

Currently, the only way to select any of these new buttons is to click (press/release) move the mouse, then click (press/release) again, which doesn't feel right on Mac.
 

Comment 1 by kerz@chromium.org, Jul 19 2010

Status: Assigned

Comment 2 by rsesek@chromium.org, Jul 21 2010

Status: Started

Comment 3 by rsesek@chromium.org, Jul 21 2010

After lots of investigation, I have a fix that works like butter on 10.6, but 10.5 is a different story. The issue is that |-convertPoint:fromView:nil| does not do the right thing on 10.5 when the receiver is the custom view of the NSMenuItem. This is because the nil parameter in |...fromView:| indicates from window coordinates, which gets screwy because the window backing the menu is different between the two OS versions; 10.6 does the right thing, while 10.5 does not.

Mark had the idea of going through Carbon using this:

  extern MenuRef _NSGetCarbonMenu(NSMenu*);
  MenuRef menu = _NSGetCarbonMenu([[owner_ menuItem] menu]);
  ThemeMenuType menuType;
  GetMenuType(menu, &menuType);
  HIViewRef menuView;
  HIMenuGetContentView(menu, menuType, &menuView);
  Rect windowRect;
  GetWindowBounds(HIViewGetWindow(menuView), kWindowStructureRgn, &windowRect);

Unfortunately, there's not a good way to jump from a screen-coordinate Rect to an NSRect of a subview (menu item content view) of a subview (menu item) of a subview (content view) of the menu window. Therefore, this will remain unfixed on 10.5.
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=54804 

------------------------------------------------------------------------
r54804 | rsesek@chromium.org | 2010-08-03 13:10:41 -0700 (Tue, 03 Aug 2010) | 11 lines
Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/app/nibs/Toolbar.xib?r1=54804&r2=54803
   A http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/cocoa/menu_tracked_button.h
   A http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/cocoa/menu_tracked_button.mm
   A http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/cocoa/menu_tracked_button_unittest.mm
   A http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/cocoa/menu_tracked_root_view.h
   A http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/cocoa/menu_tracked_root_view.mm
   A http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/cocoa/menu_tracked_root_view_unittest.mm
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/cocoa/wrench_menu_controller.h?r1=54804&r2=54803
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/cocoa/wrench_menu_controller.mm?r1=54804&r2=54803
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/cocoa/wrench_menu_controller_unittest.mm?r1=54804&r2=54803
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/chrome_browser.gypi?r1=54804&r2=54803
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/chrome_tests.gypi?r1=54804&r2=54803

[Mac] Enable click-drag-release behavior in the Wrench menu's custom items.

XIB changes:
* Replace the edit item's segmented control with 3 buttons
* Make the root view of both items a MenuTrackedRootView
* Use the custom MenuTrackedButton for all the buttons

BUG= 49356 
TEST=Click open the Wrench menu, hold, and drag over the buttons and they perform their function.

Review URL: http://codereview.chromium.org/3072014
------------------------------------------------------------------------

Labels: -Mstone-6 Mstone-7
Status: Fixed
This was too big for M6; pulling to M7.  I changed my approach so comment 3 is not relevant.  This change works for both 10.5 and 10.6.
Labels: Verifier-Ismail
Verified label updated by AutoAllocator, contact AmolK or KrisR for details

Comment 7 Deleted

Verified on Trunk.

Comment 9 by bugdro...@gmail.com, Aug 10 2010

The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=55633 

------------------------------------------------------------------------
r55633 | jrg@google.com | 2010-08-10 16:21:08 -0700 (Tue, 10 Aug 2010) | 14 lines
Changed paths:
   M http://src.chromium.org/viewvc/chrome/branches/472/src/chrome/app/nibs/Toolbar.xib?r1=55633&r2=55632
   A http://src.chromium.org/viewvc/chrome/branches/472/src/chrome/browser/cocoa/menu_tracked_button.h
   A http://src.chromium.org/viewvc/chrome/branches/472/src/chrome/browser/cocoa/menu_tracked_button.mm
   A http://src.chromium.org/viewvc/chrome/branches/472/src/chrome/browser/cocoa/menu_tracked_button_unittest.mm
   A http://src.chromium.org/viewvc/chrome/branches/472/src/chrome/browser/cocoa/menu_tracked_root_view.h
   A http://src.chromium.org/viewvc/chrome/branches/472/src/chrome/browser/cocoa/menu_tracked_root_view.mm
   A http://src.chromium.org/viewvc/chrome/branches/472/src/chrome/browser/cocoa/menu_tracked_root_view_unittest.mm
   M http://src.chromium.org/viewvc/chrome/branches/472/src/chrome/browser/cocoa/wrench_menu_controller.h?r1=55633&r2=55632
   M http://src.chromium.org/viewvc/chrome/branches/472/src/chrome/browser/cocoa/wrench_menu_controller.mm?r1=55633&r2=55632
   M http://src.chromium.org/viewvc/chrome/branches/472/src/chrome/chrome_browser.gypi?r1=55633&r2=55632
   M http://src.chromium.org/viewvc/chrome/branches/472/src/chrome/chrome_tests.gypi?r1=55633&r2=55632

Merge 54804 - [Mac] Enable click-drag-release behavior in the Wrench menu's custom items.

XIB changes:
* Replace the edit item's segmented control with 3 buttons
* Make the root view of both items a MenuTrackedRootView
* Use the custom MenuTrackedButton for all the buttons

BUG= 49356 
TEST=Click open the Wrench menu, hold, and drag over the buttons and they perform their function.

Review URL: http://codereview.chromium.org/3072014

TBR=rsesek@chromium.org
Review URL: http://codereview.chromium.org/3177001
------------------------------------------------------------------------

Project Member

Comment 10 by bugdroid1@chromium.org, Oct 12 2012

Labels: Restrict-AddIssueComment-Commit
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.
Project Member

Comment 11 by bugdroid1@chromium.org, Mar 10 2013

Labels: -Area-UI -Mstone-7 M-7 Cr-UI
Project Member

Comment 12 by bugdroid1@chromium.org, Mar 13 2013

Labels: -Restrict-AddIssueComment-Commit Restrict-AddIssueComment-EditIssue

Sign in to add a comment