Re: Idea

On Wed, Mar 22, 2000 at 01:40:24PM +0000, Michael ROGERS wrote:
> >What about adding following feature to gnome...
> > if you click with the right mouse button onto the icon of a window
> > in the tasklist, a popupmenu will apear with features like 
> > close app, kill app,....
> I think the old pager already did this? (At least I think it had close 
> window, kill app's X connection.)

I know. That was'nt the idea.
This is the Idea:
> > Now what about allowing an application to add own entries to this
> > popup menus, thus it is possible to use gtcd (cd player) without 
> > displaying it on the desktop.
> > then gtcd can make entries like "next title",....
> Panel applets provide this possibility. I think it would be difficult to 
> add a similar capability to the tasklist, because the tasklist would have to 
> contact the app and ask for the contents of a menu when it received a right 
> click, then contact the app again if a menu item was selected...
> I guess you could use CORBA for this (the tasklist has an interface for 
> registering listeners, the app registers itself as a listener, the listener 
> interface includes the functions char ** get_menu_contents () and void 
> menu_item_selected (int index)).
> I don't fancy coding it though (what if a listener dies, what if no tasklist 
> can be found, etc?). And all of that has to be filtered through some kind of 
> X property --> PID lookup, because the tasklist only knows the X window ID 
> and the tasklist will (presumably?) need the process ID or some other unique 
> application ID in order to contact the correct listener.
> In fact, it might be neater to use X properties/client messages for 
> everything. The app would set a property on its top-level window which was an
> array of strings (the menu contents), plus maybe some flags to indicate
> whether menu items should be highlighted or insensitive. You could even
> attach icons. The tasklist (or pager, window manager or whoever else wanted 
> to display the menu) would read this property and build a menu out of it in 
> its own unique graphical style. When a menu item was selected, the 
> pager/tasklist/window manager would send a client message to the app 
> identifying the selected item.
> Of course you would want to hide this inside the toolkit, so the application
> programmer would just create a gnome_window_menu and attach callbacks to the 
> menu items.
> Any thoughts? Would this work?

Yes it works. 

I wrote such kind of client - listener communiction support.

I used the X properties/client messages to support that feature.
It uses XAtoms and shared memory to communicate.

How it works:
 The "client" application has a function which can be called from any
 other application. To register this function an XAtom message is
 send through the XServer.
 All aplications which want to use the function are getting a
 structure with the pointer to a shared memory where the name
 of the function is stored; and a callback function.
 If the callbackfunction is called a X-message is sent
 back to the client application where the real callbackfunction
 will called.
I attached a well working example with that message...

Can that be a gnome feature? Is that the right way?

Any thoughts?


Gruß King Leo

| (__)    (__)    (__) |   
| ( oo    (oo)    oo ) |           
| /\_|    /\/\    |_/\ |           
|  The Cow is with me  |


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]