[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #11429 [meek]: meek-http-helper opens up a second dock icon
#11429: meek-http-helper opens up a second dock icon
------------------------+--------------------------
Reporter: dcf | Owner: dcf
Type: defect | Status: needs_review
Priority: normal | Milestone:
Component: meek | Version:
Resolution: | Keywords:
Actual Points: | Parent ID:
Points: |
------------------------+--------------------------
Changes (by dcf):
* status: new => needs_review
Comment:
Here's a proposed patch that works. I invite comment on it.
* Make an iconless shallow copy of TorBrowser.app.\\
https://gitweb.torproject.org/user/dcf/tor-browser-
bundle.git/commitdiff/b266960a94f8a75835ebc6bc32f44f027503f957
I'll copy the commit log here.
This is an implementation of the icon-hiding idea from
https://trac.torproject.org/projects/tor/ticket/11429#comment:5. The
Info.plist file enables us to control whether an icon appears, but I could
find no way to override the values we need at run time. So instead we
create a copy of the original bundle directory, with the only difference
being the contents of Info.plist. (The "copy" is actually a few symlinks,
so it doesn't take much space.)
The shallow directory copy is in a directory named TorBrowser.app.meek-
http-helper. I made the name not end in ".app" so that you can't open it
as a bundle by accident from the Finder. I put a README in the bundle
directory explaining why the directory exists.
There's a new build helper, background-plist.py, which deletes the
LSUIElement key (if present) and sets LSBackgroundOnly=true. This is more
robust than a sed script that inserts a LSBackgroundOnly key somewhere in
the XML, because the same key could be already set, or LSUIElement have a
contradictory value, elsewhere in the file.
I chose to set the key LSBackgroundOnly, rather than the LSUIElement
we've discussed so far, though both of them work in terms of hiding the
icon. I made this decision based only on the documentation for the two
keys, which makes LSBackgroundOnly sound more background-y.
[https://developer.apple.com/library/mac/documentation/general/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/20001431-108256
LSUIElement]
LSUIElement specifies whether the app runs as an agent app. If this
key is set to â1â, Launch Services runs the app as an agent app. Agent
apps do not appear in the Dock or in the Force Quit window. Although they
typically run as background apps, they can come to the foreground to
present a user interface if desired. A click on a window belonging to an
agent app brings that app forward to handle events.
[https://developer.apple.com/library/mac/documentation/general/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/20001431-109268
LSBackgroundOnly]
LSBackgroundOnly specifies whether this app runs only in the
background. If this key exists and is set to â1â, Launch Services runs the
app in the background only. You can use this key to create faceless
background apps. You should also use this key if your app uses higher-
level frameworks that connect to the window server, but are not intended
to be visible to users. Background apps must be compiled as Mach-O
executables.
The patch adds exactly these new files to the mac bundle:
{{{
$ ls -lR Contents/MacOS/TorBrowser.app.meek-http-helper
total 8
drwxr-x---@ 6 david staff 204 May 24 16:04 Contents
-rw-r-----@ 1 david staff 672 Dec 31 1999 README
Contents/MacOS/TorBrowser.app.meek-http-helper/Contents:
total 40
-rw-r-----@ 1 david staff 5563 Dec 31 1999 Info.plist
lr-xr-xr-x 1 david staff 35 Dec 31 1999 MacOS ->
../../TorBrowser.app/Contents/MacOS
lr-xr-xr-x 1 david staff 37 Dec 31 1999 PkgInfo ->
../../TorBrowser.app/Contents/PkgInfo
lr-xr-xr-x 1 david staff 39 Dec 31 1999 Resources ->
../../TorBrowser.app/Contents/Resources
}}}
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/11429#comment:10>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs