[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: new
Priority: normal | Milestone:
Component: meek | Version:
Resolution: | Keywords:
Actual Points: | Parent ID:
Points: |
------------------------+-----------------
Comment (by dcf):
Replying to [comment:8 lunar]:
> Other examples: [https://github.com/albertz/google-books-
export/blob/master/google-books-export.py#L188 `hideMacDockIcon()` in
Python], [https://github.com/albertz/google-books-export/blob/master
/google-books-export.py#L164 `showMacDockIcon()` in Python]
>
> The following piece of code is absolutely untested but should help:
Thanks for this code. I had to made these changes to get it to run:
{{{
--- main.js.orig 2014-05-24 10:09:42.000000000 -0700
+++ main.js 2014-05-24 10:10:16.000000000 -0700
@@ -63,7 +63,7 @@
var carbon =
ctypes.open("/System/Library/Frameworks/Carbon.framework/Carbon");
/* MacTypes.h */
-var OSStatus = ctypes.c_int32;
+var OSStatus = ctypes.int32_t;
/* Processes.h
*
@@ -80,9 +80,8 @@
*/
var ProcessSerialNumber = ctypes.StructType("ProcessSerialNumber",
- [ { "highLongOfPSN":
ctypes.unsigned_long,
- "lowLongOfPSN":
ctypes.unsigned_long,
- } ]);
+ [ { "highLongOfPSN":
ctypes.unsigned_long },
+ { "lowLongOfPSN":
ctypes.unsigned_long } ]);
var kCurrentProcess = 2;
/* Processes.h
@@ -115,8 +114,8 @@
psn.highLongOfPSN = 0;
psn.lowLongOfPSN = kCurrentProcess;
-r = TransformProcessType(psn, kProcessTransformToUIElementApplication)
-console.log("TransformProcessType returned " + r);
+r = TransformProcessType(psn.address(),
kProcessTransformToUIElementApplication);
+dump("TransformProcessType returned " + r + "\n");
carbon.close();
}}}
The code works to disable the icon, but the problem is that the icon has
already started appearing by the time the code starts to hide it. It's not
always as obvious as this animation shows it; sometimes it only gets a few
pixels wide before it disappears. (Here's I'm starting the meek-http-
helper profile manually; normally there would be another Tor Browser icon
to the left of the one that appears and disappears.)
[[Image(meek-http-helper-ctypes-icon.gif)]]
I think I'll try the Info.plist approach, so the icon is hidden from
startup. Something similar is going on, apart from the meek helper, in
#12121.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/11429#comment:9>
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