patch for gtk+-2.0 : support for new Application Launch Feedback mechanism



hi

Attached is a patch for gtk+-2.0. It ammends gdk_window_new() so that if the 
environmental variable DESKTOP_LAUNCH_ID is set, then the property 
_NET_WM_LAUNCH_ID is set on the new window.

This is necessary for a proposed new application launch feedback mechanism (as 
discussed previously on gnome aliases).  
The gnome implementation of this method is called galf (Gnome Application Launch 
Feedback). Below is an extract from the README to explain again what is 
involved. I have requested a gnome CVS account in order to check in the galf 
code and so make it available for feedback/suggestions/criticism ...


README

Galf is the GNOME implementation of a new Application Launch Feedback 
mechanism.This mechanism requires a toolkit to check if the environmental 
variable DESKTOP_LAUNCH_ID is set, and, if it is, then the property 
_NET_WM_LAUNCH_ID is set on the toplevel window of an application. The value of 
the _NET_WM_LAUNCH_ID 
property is set to the value of the DESKTOP_LAUNCH_ID variable.

HOW GALF WORKS:
Feedback is controlled by an ORBit server, called galf-server, and
an ORBit client, called galf. OAF is used to activate the server. 

Galf acts as a binary wrapper around the application to be launched. 
It sets a new environmental variable, DESKTOP_LAUNCH_ID, with a unique value.

The 2.0 gtk+ library will be updated so that, if the DESKTOP_LAUNCH_ID 
environmental variable is set, then  _NET_WM_LAUNCH_ID property
is set on the toplevel window of the application to be launched.  The value of 
DESKTOP_LAUNCH_ID is assigned as the value of this property. 

Galf also sets a compliance flag to indicate whether the toolkit is 
compliant with DESKTOP_LAUNCH_ID. This flag is a parameter to the remote
methods used. At present compliance is determined by whether the application
has a .desktop file.  This is inadequate, a better solution would be to check
for a flag/field within the application's .desktop file. 

Galf then invokes a remote method to start the feedback display for the 
application to be launched.  
Galf examines the _WIN_CLIENT_LIST property on the root window in order to 
extract a list of currently mapped windows.
It passes this list of currently mapped windows as one of the arguments to 
a oneway remote method, called monitor_new_windows(). This remote method then
monitors the _WIN_CLIENT_LIST property for any newly mapped windows.
Galf then forks and execs the application to be launched.

Once the monitor_new_windows() method detects the creation of a new window, it 
examines the value of the compliance flag:  
1. If the application is compliant, it checks to see if the _NET_WM_LAUNCH_ID 
property has been set and has the correct value.  If it has, then the feedback 
display is stopped. If not then monitor_new_windows() continues to monitor for
new windows. 
2. If the compliance flag is not set, the application may or may not be 
compliant with _NET_WM_LAUNCH_ID (ie it may be possible to have an
application using a compliant toolkit, but which doesn't have a correct
.desktop file ). For this reason a check is done to see if _NET_WM_LAUNCH_ID
has been set.  If the property is set then proceed as above in point no. 1.
If the new window does not have this property then the feedback display is 
stopped (similar to Xalf's mappingmode solution).
The feedback to be displayed is managed via plugins. At present plugins are
located via gnome-config, however this will be updated to integrate with gconf.
One default plugin is included at present, this is the tasklist window (as 
adapted from the Xalf code.)



cheers
Mary Dwyer



~ I speak for myself, not for my employer ~
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Mary Dwyer
Desktop Applications & Middleware Grp
Sun Microsystems Ireland
Tel: +353-1-8199222 (xt 19222)
Fax: +353-1-8199078
email: mary dwyer ireland sun com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Index: gdkwindow-x11.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/x11/gdkwindow-x11.c,v
retrieving revision 1.109
diff -u -r1.109 gdkwindow-x11.c
--- gdkwindow-x11.c	2001/03/05 15:08:36	1.109
+++ gdkwindow-x11.c	2001/03/09 17:11:47
@@ -318,9 +318,9 @@
   XWMHints wm_hints;
   XClassHint *class_hint;
   int x, y, depth;
-  
   unsigned int class;
   char *title;
+  gchar *desktop_launch_id=NULL;  
   int i;
   
   g_return_val_if_fail (attributes != NULL, NULL);
@@ -562,7 +562,22 @@
 	   	   wm_client_leader_atom,
 		   XA_WINDOW, 32, PropModeReplace,
 		   (guchar*) &gdk_leader_window, 1);
-  
+ 
+  /* Needed for Application Launch Feedback mechanism: if
+     the environmental variable DESKTOP_LAUNCH_ID is set,
+     then the property _NET_WM_LAUNCH_ID is set with the 
+     value of DESKTOP_LAUNCH_ID. */
+  desktop_launch_id= g_strdup(getenv("DESKTOP_LAUNCH_ID"));
+  if (desktop_launch_id) {
+	XChangeProperty(GDK_WINDOW_XDISPLAY(window), 
+		 GDK_WINDOW_XID(window),
+		 gdk_atom_intern("_NET_WM_LAUNCH_ID", FALSE),
+		 XA_STRING, 8,
+		 PropModeReplace, (guchar *)desktop_launch_id,
+		 strlen(desktop_launch_id));
+	g_free(desktop_launch_id);
+  }
+ 
   if (attributes_mask & GDK_WA_TITLE)
     title = attributes->title;
   else


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