<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -26,11 +26,17 @@ const Handler = {
 
         if(uri || cmdLine.handleFlag('sameplace', false)) {
             var windowWatcher = Cc['@mozilla.org/embedcomp/window-watcher;1']
-            .getService(Ci.nsIWindowWatcher);
-
-            windowWatcher.openWindow(
-                null, 'chrome://sameplace/content/standalone.xul',
-                'SamePlace:Contacts', 'chrome,toolbar=no', null)
+                .getService(Ci.nsIWindowWatcher);
+            var windowMediator = Cc['@mozilla.org/appshell/window-mediator;1']
+                .getService(Ci.nsIWindowMediator)
+
+            var window = windowMediator.getMostRecentWindow('SamePlace');
+            if(window)
+                window.focus();
+            else
+                windowWatcher.openWindow(
+                    null, 'chrome://sameplace/content/standalone.xul',
+                    'SamePlace', 'chrome,toolbar=no', null)
 
             cmdLine.preventDefault = true;
         }</diff>
      <filename>components/CommandLine.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>67fea31c0cf6036fdf48ae47a0c4bc1d8368f920</id>
    </parent>
  </parents>
  <author>
    <name>Massimiliano Mirra</name>
    <email>bard@hyperstruct.net</email>
  </author>
  <url>http://github.com/bard/sameplace/commit/3e946d5699d871c9c08dddc0ba02baa7f966b6d8</url>
  <id>3e946d5699d871c9c08dddc0ba02baa7f966b6d8</id>
  <committed-date>2009-03-25T09:32:07-07:00</committed-date>
  <authored-date>2009-03-25T09:32:07-07:00</authored-date>
  <message>Command line flag handler: handle case where SamePlace is already open - just focus it. (Thanks Sonny!)</message>
  <tree>ea27476a1f5b2b6171490523cc52ec21e718c77c</tree>
  <committer>
    <name>Massimiliano Mirra</name>
    <email>bard@hyperstruct.net</email>
  </committer>
</commit>
