r/LogitechG • • 24d ago

Logitech G Support G Hub - Auto switching profiles not working on Valorant

Did anyone else got the problem with the G Hub not switching to the Valorant profile when you open the game?

The strange fact is that if I just Alt+Tab once once the game opened G Hub detect the game and change the profile correctly, it's just at the opening of the game that it doesn't work.

Any ideas?

Info about it:
G Hub release: 2026.7.1011216 but I have the problem since a couple of releases
OS: Windows 11 updated

Test I already tried:

I already tried to delete all the settings of G Hub but nothing.

I already added to the Valorant profile all the possible exe that could trigger the switch in the profiles but nothing.

1 Upvotes

2 comments sorted by

1

u/Luggruff 21d ago edited 21d ago

Yup, same here. Just tested my browser profile, but it is not sticking. Noticed that every time I open the software (when it's running, in the taskbar), it re-initializes. So it's like it is completely unloading when it is not in focus. Edit: This has NEVER happened before, so someone clearly f-ed up the latest update.

Edit 2, solved it:
Cause: G HUB saves the last process ID (PID) each app ran under in `%LOCALAPPDATA%\LGHUB\settings.db`, and never clears it. Windows reuses PIDs. In my case Zen's main process got PID 16288, which G HUB still had saved for GTA5_Enhanced (a disabled app). So when Zen got focus, G HUB thought it was GTA, saw that app was disabled, and fell back to Desktop. It never even checked Zen's path.

Quick fix (may work): fully close the affected app, with no processes left in Task Manager, and reopen it. In my case that fixed it, but a reboot earlier did not, so if it doesn't help, use one of the fixes below.

Clear all saved PIDs (Python):

  1. Quit G HUB from the tray, and check Task Manager that `lghub.exe`, `lghub_agent.exe` and `lghub_system_tray.exe` are gone.
  2. Back up `%LOCALAPPDATA%\LGHUB\settings.db` (plus any `settings.db-wal` and `settings.db-shm` files next to it).
  3. Save this as `clearpid.py` and run `python clearpid.py`:
import sqlite3, json, os
db = os.path.expandvars(r"%LOCALAPPDATA%\LGHUB\settings.db")
c = sqlite3.connect(db)
rid, blob = c.execute("select _id,file from data order by _id desc limit 1").fetchone()
d = json.loads(blob)
n = sum(a.pop("processId", None) is not None for a in d["applications"]["applications"])
c.execute("update data set file=? where _id=?", (json.dumps(d).encode(), rid))
c.commit(); c.execute("pragma wal_checkpoint(TRUNCATE)"); c.close()
print("cleared", n)

4. Start G HUB again.

Alternative: no Python, a PowerShell script

Download: https://byadrian.app/ghub-fix/Clear-GHubProcessIds.zip

It closes G HUB, backs up your settings, clears the saved PIDs, checks the database and restarts G HUB. It uses the SQLite library built into Windows, so nothing needs installing. Step-by-step instructions are in `instructions.txt` in the zip. Short version: extract it, open PowerShell in that folder and run:

powershell -ExecutionPolicy Bypass -File .\Clear-GHubProcessIds.ps1

Read the script before running it. It's short and commented.

Note: G HUB saves new PIDs as apps run, so this can happen again by chance. If it does, restart the app or rerun the fix.

1

u/Toplin1 21d ago

Nice catch, unfortunately it didn't solve it to me, but it was a nice try. Thank you.