Summary: | Ktorrent no longer starts hidden in tray | ||
---|---|---|---|
Product: | [Applications] ktorrent | Reporter: | Matt Scheirer <matt.scheirer> |
Component: | general | Assignee: | Joris Guisson <joris.guisson> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | andysem, ashark, aspotashev, contact, diazona, kikox1, kzeidler, matt.scheirer, miniopl, xerusx |
Priority: | NOR | ||
Version: | 5.0 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | one liner fix |
Description
Matt Scheirer
2016-06-02 18:17:06 UTC
I'm experiencing the same issue, that KTorrent always starts up with a full window, whereas I'd like it to start minimized in the tray. Unfortunately I'm not familiar with the code base so I'm unlikely to be of much help fixing the bug, but I suppose this is some kind of independent confirmation that it does happen. Happens to me as well on Kubuntu 17.10, Ktorrent 5.1.0. This is still happening! It bugs me that a KTorrent window opens every single time upon startup. I might stop it from autostarting due to that, which means I'd stop seeding. I don'T want to do that, but why is such a seemingly simple issue still not fixed? I'm also experiencing this. Kubuntu 18.04, Ktorrent 5.1.0. Oddly, attempts to activate the window elicit a stale notification warning about attempting to add a duplicate torrent. When I asked Kubuntu not to notify me of those events, it started warning me instead that "preferences" is a malformed URL. It also keeps sending erroneous notifications that a particular large file I'm downloading (70GB) is finished downloading. Strange stuff. Seems like it's having trouble transitioning out of error states, like it didn't release a warning it broadcast earlier to ibus so every interaction it thinks is an error condition. As a partial workaround, I have done the following: Right click on the window title -> More Actions -> Special Application Settings... New window will appear. Go to "Size & Position" tab and enable checkbox "Minimized", choose "Apply Initially" and enable "yes" radio button. Then press OK button. Now KTorrent window will be minimized in task manager every startup. But still it will not be completely hidden in system tray and you need to close minimized window by right clicking in task manager. At least this workaround makes your desktop less cluttered at startup (which is especially annoying when you reboot often). Why there is no such option to start KTorrent in tray? For example, in Kopete there is checkbox "Start with hidden main window" in Behavior settings. I would like to see the same checkbox in KTorrent. I have also found Bug 251864, but they suggested that ktorrent was double starting and because of that its window appeared (second calling of ktorrent just showed ktorrent window of already running application instead of launching second instance of application). It is not a case for me, because I do not have ktorrent in autostart applications, so it is starting once when session is restoring after login in kde. I have found a better workaround. You can download my script at https://github.com/Ashark/Ashark-bin/blob/master/ktorrent-window-closer and set kde to autostart it. The main idea is to run wmctrl -x -c "ktorrent" command, which closes ktorrent window. Now it behaves exactly as expected: no window at startup (at all, not minimized to task manager), but still running in tray. In debian 10 the problem persist. In this link (https://forum.manjaro.org/t/how-to-start-programs-minimized-to-system-tray/48159/6) I found an workarround In application settings for it (in Window Rules) (click right buttom in title bar of ktorrent) Size & Position: minimized - apply initially Arrangement & Access: skip taskbar - apply initially (In reply to kikox1 from comment #8) > I found an workarround > > In application settings for it (in Window Rules) (click right buttom in > title bar of ktorrent) > > Size & Position: minimized - apply initially > Arrangement & Access: skip taskbar - apply initially This doesn't work as intended. After these steps Ktorrent never appears in the taskbar, neither after start, nor after minimizing and restoring. Size & Position workaround has the tendency to affect other Ktorrent windows beside the main window. For example, the dialog for adding a new torrent gets created minimized. You have to create a very specific rule to match just the main window (in my case, I have to match the window title, and I'm not sure how stable the title is). Oh, and Size & Position is also applied when Ktorrent gets restored from the tray icon, which means it always gets restored minimized. (In reply to Lastique from comment #9) > (In reply to kikox1 from comment #8) > > I found an workarround > > > > In application settings for it (in Window Rules) (click right buttom in > > title bar of ktorrent) > > > > Size & Position: minimized - apply initially > > Arrangement & Access: skip taskbar - apply initially > > This doesn't work as intended. After these steps Ktorrent never appears in > the taskbar, neither after start, nor after minimizing and restoring. > > Size & Position workaround has the tendency to affect other Ktorrent windows > beside the main window. For example, the dialog for adding a new torrent > gets created minimized. You have to create a very specific rule to match > just the main window (in my case, I have to match the window title, and I'm > not sure how stable the title is). Yes it works for me like this: Ktorrent never appears on the taskbar, either after startup, or after minimizing and restoring. It only appears in the tray. When restoring the window opens and does not appear in the taskbar. If the dialog is opened from the application menu when the window is open, it looks good if it opens with the menu that appears by pressing the right mouse button on the tray icon, the dialogs appear minimized. What you get is that it does not appear open when you start the pc What you get is that it never appears on the taskbar Skip taskbar Toggle whether to display the window in the taskbar. *** Bug 395495 has been marked as a duplicate of this bug. *** Created attachment 128536 [details]
one liner fix
Were coming on the four year mark that I reported this and nobody ever fixed it, so heres the fix after an hour counting show() calls on GUI to make sure I wasn't missing something obvious with a one liner fix like this. main doesn't need to show the GUI because GUI::loadState will already show the window whenever its appropriate on startup. This redundant call after constructing GUI just means the window always shows and happens after the check to start in the tray. Removing it means the logic in loadState actually dictates if the window is shown on startup or not. Tested it with all the combinations of options - works as intended from what I can see. Could you please submit your patch for review by our developers? See https://community.kde.org/Get_Involved/development#Submit_a_patch I did go and make a pull request on Invent for the fix @ https://invent.kde.org/network/ktorrent/-/merge_requests/1. Don't think anyone with access is paying attention to Gitlab yet. Fix from comment 16 got merged. |