There is no way for the embedders to get notified about selection changes

RESOLVED INCOMPLETE

Status

()

Core
Embedding: APIs
RESOLVED INCOMPLETE
15 years ago
2 years ago

People

(Reporter: Marco Pesenti Gritti, Assigned: Adam Lock)

Tracking

({topembed})

Trunk
x86
Linux
topembed
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

15 years ago
Updating sensitivity of menus like Edit->Copy and Edit->Clut requires a way to
be notified on selection changes.
nsICommandManager->addCommandObserver ("cmd_cut"); would look like the proper
way to do it, but unfortunately it doesnt appear to work (no notifications at all).

In mozilla this is done with XULCommandDispatcher.
(Reporter)

Comment 1

15 years ago
The same is true for focus and undo/redo. The problem is that in
nsGlobalWindow.cpp XULDispatcher is used to notify about action changes instead
of CommandManager API.
All that I've been able to find about Command manager / XULDispatcher relation is:
http://www.mozilla.org/projects/embedding/commandhandling.html.
Am I getting it wrong or we are supposed to abandon the use of XULDispatcher for
CommandManager ? Are there bugs opened about it ?
(Reporter)

Updated

15 years ago
Keywords: topembed

Comment 2

15 years ago
The command observer stuff only works in composer right now.

There are ways to do what you want using non-frozen APIs. Look at the Camino
source code for examples.
(Reporter)

Comment 3

15 years ago
I've seen Camino code. Though unfortunately not all toolkits have a
validateMenuItem api. In gtk the only way I found to make it work is to update
sensitivity on menu showing and to reenable all items on menu hide (so that
accellerators still works when there will be changes on the state of the command). 
That's just a bad hack, I'm not even sure it fully works :/

Can you explain which is the frozen api you are talking about ? The command api
supports observers already ...
Is there a plan to move using the commands api in mozilla browser too and any
bug opened about it ?

Comment 4

10 years ago
Just to comment that the mozilla-based browser that OLPC uses needs this functionality.
QA Contact: carosendahl → apis

Comment 5

2 years ago
Marking a bunch of bugs in the "Embedding: APIs" component INCOMPLETE in preparation to archive that component. If I have done this incorrectly, please reopen the bugs and move them to a more correct component as we don't have "embedding" APIs any more.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.