2009/3/24 John Abd-El-Malek <[email protected]>:
>> If I remember right when I looked at some of this, the Windows code uses
>> the process filter as a hook to scan the windows to find a running Chromium
>> and send it a message.  So that whole functionality should be re-abstracted,
>> if needed, instead of making it have to work by walking a process list.
>
> Right, this is used so that if the user starts Chrome a second time, it
> tells the currently running exe to open a new tab.  This is the standard way
> of doing it on Windows, but I don't know how Mac/Linux apps enforce
> single-instance semantics.

FWIW, here's how iceweasel does it when using X:

http://www.google.com/codesearch/p?hl=en#coP3VhWcvX0/widget/src/xremoteclient/XRemoteClient.cpp&q=XRemoteClient&exact_package=svn://svn.debian.org/pkg-mozilla/iceweasel/trunk&l=452

 // Get a list of the children of the root window, walk the list
 // looking for the best window that fits the criteria.
 if (!XQueryTree(mDisplay, root, &root2, &parent, &kids, &nkids)) {
 ...
 }

 // We'll walk the list of windows looking for a window that best
 // fits the criteria here.

 for (i=nkids-1; i >= 0; i--) {
   Atom type;
   int format;
   unsigned long nitems, bytesafter;
   unsigned char *data_return = 0;
   Window w;
   w = kids[i];
   // find the inner window with WM_STATE on it
   w = CheckWindow(w);

   int status = XGetWindowProperty(mDisplay, w, mMozVersionAtom,
                                   0, (65536 / sizeof (long)),
                                   False, XA_STRING,
                                   &type, &format, &nitems, &bytesafter,
                                   &data_return);
...

i.e. it doesn't look at processes at all.

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to