Closed Bug 66120 Opened 24 years ago Closed 17 years ago

Menu items should flash when selected

Categories

(Core Graveyard :: Widget: Mac, defect)

PowerPC
macOS
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED WORKSFORME
Future

People

(Reporter: mpt, Assigned: jaas)

Details

(Keywords: platform-parity)

Attachments

(2 files)

Build: 2001011912, Mac OS 9.0

To reproduce:
* Select any item from an XP Toolkit menu (e.g. the Bookmarks menu in the Personal
  Toolbar, or any context menu).

What should happen:
* The selected item flashes three times, then the menu disappears.

What actually happens:
* The menu disappears.
It should only flash as many times as is specified in the preferences in MacOS.
Also, this shouldn't be Mac System 9.x but rather Mac System 7, since menu's
flashing there too.

OS -> Mac System 7
OS: Mac System 9.x → Mac System 7
By the way, if this will be fixed. Then bug 59797 should also be fixed, which is
about common mac-menu behaviour (as this one).

Should we follow the mac menu behaviour in mac and thus being inconsistent in
the XPinterface behaviour?
Keywords: pp
--> later
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.1
nominating for dogfood (from sdagley's list of bugs that are good candidates for 
our next release) 
Keywords: nsdogfood
Keywords: nsCatFood
Keywords: nsdogfood
see also Bug 50590
Keywords: access, correctness
I was bored and the basketball game wasn't interesting me.  I've got something 
hooked up for this in my tree.  It does it everytime a menu item is executed, 
whether it be with the mouse or the keyboard.  Is that the correct behavior?
Oh, but just the basic flashing.  I don't have this hooked up to any system 
setting.  Ideally the number of times to flash and the delay would come from 
nsILookAndFeel instead of being encased in #ifdefs.  If there's no flashing or 
delay, the menu gets executed immediately.
I hooked this up to nsILookAndFeel.  Patches coming for critique.  Could be the 
complete wrong way of doing this, but hopefully it's at least a start.
Attached patch nsILookAndFeel.hSplinter Review
Cool!

> It does it everytime a menu item is executed, whether it be with the mouse or
> the keyboard.  Is that the correct behavior?

Well ... Menu items other than those in the top-level menu bar generally don't 
respond to the keyboard -- and the top-level menu bar is native, so it has this 
behavior already. But I don't see the need to special-case the keyboard out of 
this behavior; if there are XP menu items anywhere in Mozilla which can be 
activated from the keyboard in Mac OS, that's probably a UI bug.
I'd be able to write code that's a lot more straight-forward if I had something 
like an xp Sleep() function, instead of using timers.  Is there such a thing?
Gee, maybe PR_Sleep()?  Whole new patch coming in a bit.
Hrm... maybe not.  SelectMenu() doesn't seem to have any effect when I'm using 
PR_Sleep().  It does when I do it in a timer, though.  Crappy.
Ugh.  Neither does mMenuParent->SetCurrentMenuItem(nsnull).  I must be missing 
something obvious.
use a timer ;)
OK, then.  How's the code in my patch look, then?  I was thinking of adding code
to not execute the menu if it's on the menu bar, for that bug about flashing the
appropriate menu when a shortcut key is pressed.
Flashing menu items isn't good for access, it's actually a bad thing. Have an
option to turn it off please.
Keywords: access
It should only flash on mac when that pref in the OS is set, so there is already
an "option to turn it off".
Correct.  That's where nsILookAndFeel comes in.
where does widget obtain a value from the OS for this particular metric? I don't
see code that does it...
No idea.  I was going to leave that up to someone with a make to add
eMetric_MenuSelectionFlashCount and eMetric_MenuSelectionFlashDelay to Mac's
nsLookAndFeel.cpp.
I've tried to get an answer from hyatt as to why SelectMenu() doesn't update
when it's not called within a loop.  Anyone have any ideas?  Here's my thoughts...

I need SetAttribute to take effect, because I need to use GetAttribute to
retrieve it the next time through my loop.  I tried using both
nsFrame::Invalidate and nsIPresShell::FlushPendingNotifications to force the
SetAttribute to take effect, but it's not working.  Is there a different
FlushPendingNotifications that I should be calling?  nsIPresShell is used
elsewhere in nsMenuFrame.cpp.

  for (i = 0; i < aFlashCount * 2; i++) {
    // aFlashCount is in milliseconds
    PR_Sleep(aFlashDelay);

    mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive,
active);
    if (active.Equals(NS_LITERAL_STRING("true")))
        ^^^^^^^^^^^^^^^^^^^^^ this is "true" everytime through the loop
      // Menu is highlighted - unhighlight it
      SelectMenu(PR_FALSE);
      ^^^^^^^^^^^^^^^^^^^^^ this should set the attribute to "false"
    else
      // Menu is not hightlighted - highlight it
      SelectMenu(PR_TRUE);

    // force the SetAttribute(), in SelectMenu(), to take effect
    // XXX this doesn't work
    nsCOMPtr<nsIPresShell> shell;
    mPresContext->GetShell(getter_AddRefs(shell));
    shell->FlushPendingNotifications();
  }

[the first version of macos that mozilla supports is 8.5]
OS: Mac System 7 → Mac System 8.5
fffffffuture
Target Milestone: mozilla1.1alpha → Future
Since we don't do development for Mac OS 9 or earlier anymore, and this
behaviour is not valid anymore in Mac OS X (there are no falshes anymore),
should we change this to WONTFIX or WORKSFORME ?
Sorry, I was a bit wrong. What I wanted to say is that it isn't possible anymore
to configure them in OS X, so people might be less annoyed when the flashing
isn't exactly like they configured themselves..

There are still flashes, but much faster. But they're often invisible, for
instance when trying to switch between the different views in the System
Preferences. It looks to me that it's related to the /size/ of the pulldownmenu.
Dissolving the menu in the background takes a long time for me (iBook 300 Mhz
with simple Rage video), so it's possible that this makes the flashing invisible
(when flashing is faster than the actual menu dissolve). Since I've never read
about this, I don't think that anyone cares anymore.
This bug is targeted at a Mac classic platform/OS, which is no longer supported
by mozilla.org. Please re-target it to another platform/OS if this bug applies
there as well or resolve this bug.

I will resolve this bug as WONTFIX in four weeks if no action has been taken.
To filter this and similar messages out, please filter for "mac_cla_reorg".
OS: Mac System 8.5 → MacOS X
*** Bug 341179 has been marked as a duplicate of this bug. ***
mumble SetMenuFlashCount mumble
Component: XP Toolkit/Widgets: Menus → Widget: Mac
Target Milestone: Future → mozilla1.8.1beta2
oops, this isn't about native menus
Target Milestone: mozilla1.8.1beta2 → Future
Has this been fixed with the move to Cocoa?
Assignee: mikepinkerton → joshmoz
Status: ASSIGNED → NEW
QA Contact: jrgmorrison → mac
Whiteboard: CLOSEME - 06/26 (WFM?)
(In reply to comment #32)
> Has this been fixed with the move to Cocoa?

This bug was pretty OS 9-specific, but yeah - menuitems definitely flash as they should AFAICS in the new Cocoa world.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
Product: Core → Core Graveyard
Whiteboard: CLOSEME - 06/26 (WFM?)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: