My favorites | Sign in
Logo
                
Search
for
Updated Nov 08, 2009 by rainwoodman
Labels: Phase-Requirements
GlobalMenuSpecification  
the Global Menu Specification

Global Menu Specification

Author: Yu Feng (rainwoodman)


Table of Contents


Introduction

Although there are implications to specific implementations, this document should be considered as a requirement document.

Implmentations are listed in the appendix.

Global Menu Specifications

Definations

Extensions to EWMH Protocol

Atoms

XML Representation of Menu Context

FIXME: DTD

Element Tags and Attributes

Root Element

The root element of the XML is menu. The root elment has an extra attribute:

Identifying an Element: Path

Path is a string to locate an element in the document tree. In a path:

Examples of valid paths:

Client

A Client is a Window with menu context. It receives XPropertyNotify notifications for _NET_GLOBALMENU_MENU_EVENT, and changes _NET_GLOBALMENU_MENU_CONTEXT. To support the specification more efficiently, a map from Path to real actions should be implementated

The _NET_GLOBALMENU_MENU_EVENT property on the Client is changed by the Server if an Menu Event occurs. The expected behavior of a Client upon receiving the notification is

Whether the property is immediately deleted is undefined.

_NET_GLOBALMENU_MENU_SELECT property on the Client is triggered when a menu item is highlighted. (NOTE: on GTK highlighted == selected.)

_NET_GLOBALMENU_MENU_DESELECT property on the Client is triggered when a menu item is highlighted. (NOTE: on GTK highlighted == selected.)

When the Menu Context of a Client changes, the Client should change the _NET_GLOBALMENU_MENU_CONTEXT property on its window. The Client should make efforts to reduce the number of changes because:

  • Writing to an Window Property a huge amount of text is slow.
  • The server will possibly take the new property and rebuild an entire menu upon each newly arrived Menu Context.

Server

A Server carries the Representation for the current Menu Context for the active window on the active viewport of the active workspace of the current display. Server on multihead displays is undefined. The Representation carried by a Server is totally implementation dependent. All following examples are valid implementations:

The specification does not require the Server to cache the Representation for Menu Context of any non-active window.

EHWM and X Window Manager Protocol implement the mechanisms for active window determination. Refer to the documentation for

  • _NET_ACTIVE_WINDOW and
  • WM_TRANSIENT_FOR
Other higher-level apis are available,
  • libwnck-1.0

The Server captures events in which the user activates a representation of an Item in the representation of the Menu Context. After that the server should find the Path for the activated Item and write that Path to the _NET_GLOBALMENU_MENU_EVENT property of the corresponding Client as a Menu Event. Note: The window whose property is changed is not neccasary the active window, since the active window may have changed after the user activates the representation of the Item.

Settings

Settings shared by all Clients on the same screen are stored under _NET_GLOBAL_MENU_SETTINGS property of the root window of the screen.

Clients should watch the changes of the settings and promptly update their state according to the new settings.

Settings:

Limitations

Multiply Menu per Client

The specification only supports one menu per Client. Possible workarounds for a Client implementation are:

Gap between Client and Server

As mentioned in previous sections, there is a gap between the client and the server if the revision of the Path in the Menu Event is differnt from the one in the Menu Context of the client. Consider the following scenario:

The specification captures this gap but does not define the default behavior of the Client. The invalid Path is still possibly containing suffiecient information for the client to determine which action should be invoked, if the client is implemented in a specific way.

Multihead

Undefined.

Application Compatibility Guidelines

Refer to Application Guildlines

Acknowledgements

Appendix A : GTK Implementation

GTK Plug-in Module

GNOME Panel Applet

libgnomenu


Comment by herzberg.sven, Sep 03, 2009

So, this spec tells people exactly what to do to get a global menu.

But how is the application supposed to find out whether it makes sense at all (so it can fall back to non-global menu).


Sign in to add a comment
Hosted by Google Code