qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
27.48k stars 3.9k forks source link

Ability to hide dock icon and minimize to menu bar on macos #10088

Open evansan opened 5 years ago

evansan commented 5 years ago

If I just need to leave qbtorrent open for seeding, staying on the menu bar instead of dock in much less distracting.

adamkdean commented 5 years ago

I agree with this. I know that it was removed a while back but I there should at least be an option for me to display an icon in the menu bar. The dock on MacOS is pretty much useless and hidden.

brianbauer42 commented 5 years ago

I was just looking for a way to do this.. I guess it doesn't exist.

ghost commented 4 years ago

Same. I don't like having what I consider "service" applications just sitting in my app bar.

Apps like qBittorrent and Background Music count as a service app to me.

iulian0512 commented 2 years ago

+1 very useful feature it would be.

zur4ik commented 1 year ago

+1 for this feature. I have running app almost all time as I'm seeding and keeping app icon in dock is disturbing.

drabidea commented 11 months ago

Looks like this issue hasn't been fixed for 4 years now?? Is there some major problem for adding this?

thalieht commented 11 months ago

Looks like this issue hasn't been fixed for 4 years now?? Is there some major problem for adding this?

No Mac developers.

luzpaz commented 11 months ago

Maybe @Kolcha ?

Kolcha commented 11 months ago

I'm not Mac developer either :) but since I have MacBook from the office and can use it almost as personal one, I can do many things. will look into this issue during this week or weekend. I also interested in this particular feature for my own application which will be published soon. I know how to hide dock icon using some trick in Info.plist, but have no idea how to do this programmatically. this should be not a big issue I think, the case is very common. the only issue I'm worrying about, this is macOS itself - nowadays there are a lot of unnecessary restrictions, and you should expect the unexpected issues when calling system Objective-C API from C/C++. again, this is just an observation, I'm not a macOS/Apple developer, and don't want to be, just have to deal with it from time to time.

luzpaz commented 11 months ago

Understood @Kolcha, thank you so much for your contributions and efforts :pray:

Kolcha commented 11 months ago

related issue #18762

Kolcha commented 11 months ago

so, here are some updates from my side:

now about issues. I have ideas how to fix them, but this requires some time-consuming refactoring and slightly deeper understanding of affected code.

so, a lot of work must be done to get something usable, not "just working"

Kolcha commented 11 months ago

another update from my side, but this is a piece of sad news... I have no proper and clean solutions for the issues above, for some even hacky. some details are below:

so, I will not implement it, sorry...

QuantumRoseinAmethystVase commented 11 months ago

Here is the method I used to completely hide qBittorrent in the Dock bar by modifying the plist file in the qBittorrent package:

  1. Firstly, locate qBittorrent in the Finder application on macOS. Right-click and select "Show Package Contents" > "Contents" > Open "Info.plist".
  2. To modify the LSUIElement key, you will need to add a specific key-value pair to the Info.plist file:
    <key>LSUIElement</key>
    <string>1</string>

    That is to add the Key "LSUIElement", Class is string, Value is 1. Just like this ↓

    image
  3. Save the .plist file and close the editor.
  4. To apply the changes, you need to restart qBittorrent.
  5. Enjoy it. ^_^
vuhe commented 11 months ago

another update from my side, but this is a piece of sad news... I have no proper and clean solutions for the issues above, for some even hacky. some details are below:

  • tray icon behavior on macOS is different (menu is always shown regardless of what mouse button is clicked) compared to other systems, but qBittorrent highly relies on "standard" behavior. I found no hack to work around it.
  • there is no easy and clean way to set another menu for dock icon to avoid unnecessary menu items duplication. qBittorrent implements DesktopIntegration component for tray/dock integration, it assumes some single context menu for that purpose, and this menu is created outside it. maintaining another "special" almost the same menu outside this component will require code/logic duplication and is just very ugly.
  • sync system "Show/Hide" menu item with the item in tray menu requires very tricky Objective-C code (you need to handle some platform-specific events) and what is worst is that potential event handlers for them also may trigger the same events. so, some hack is required to distinguish events that are result of clicking the item in dock menu from those "side effects".
  • close and minimize actions also seem to be handled in special way on macOS. to get work "Hidden" window on startup some hacks are required. even just re-enabling tray icon breaks some other existing logic in qBittorrent, and removing platform-specific macros (to make logic the same for all platforms) doesn't solve the issue.

so, I will not implement it, sorry...

Can we use only the menu bar mode without using the GUI and only provide webUI, and the menu bar only provides exit options.

luzpaz commented 10 months ago

bumping

arrpt commented 1 month ago

bumping