Skip to content

Commit

Permalink
Change behavior when tray icon is clicked
Browse files Browse the repository at this point in the history
qBittorrent will be hidden only when it is in focus.
  • Loading branch information
thalieht committed Nov 14, 2023
1 parent 0f40fad commit 8c9ec7e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,23 @@ MainWindow::MainWindow(IGUIApplication *app, WindowState initialState)
if (!isVisible())
activate();
#else
toggleVisibility();
if (isActiveWindow())
{
hide();
}
else
{
if (m_uiLocked && !unlockUI()) // Ask for UI lock password
return;

// Make sure the window is not minimized
setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);

// Then show it
show();
raise();
activateWindow();
}
#endif
});

Expand Down

0 comments on commit 8c9ec7e

Please sign in to comment.