Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WM_CLASS for TF2 Linux #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Tiagoquix
Copy link

This closes #37.

@BlueManCZ
Copy link
Owner

I'm afraid we cannot add a second identical WM_CLASS to the database. It already belongs to Half-Life 2. That would cause problems if we had installed Half-Life 2 and Team Fortress 2 together, as the desktop manager wouldn't know which one of these two .desktop files to use (since WM_CLASS should be unique to properly link running instances and their .desktop files).

To actually fix and close #37 and #41 we need to figure out why the fix-wm-class.sh script is not finding windows correctly in your case and therefore not exiting itself and hanging Steam in running state as well.

Can you please try to follow these steps and report your observations?

  1. Remove this new WM_CLASS from the database.
  2. Make sure the file ~/.local/share/applications/steam-icons-fixed/Team-Fortress-2.desktop exists and contains StartupWMClass=Team Fortress 2 - OpenGL line.
  3. Run Team Fortress 2 without launch options and minimize it. It should have the default icon.
  4. Execute xdotool search --sync --name "Team Fortress 2 - OpenGL" set_window --classname "Team Fortress 2 - OpenGL" --class "Team Fortress 2 - OpenGL" %@ and watch if it exits and fixes the icon.

@Tiagoquix
Copy link
Author

Tiagoquix commented Mar 11, 2024

Hello there. The xdotool command you provided does nothing.

I've also tried to replaced the Team Fortress 2 - OpenGL with hl2_linux for the last two ones (since they require the WM_CLASS attribute) but it didn't work.

@Tiagoquix
Copy link
Author

Also, the script doesn't continue and gets stuck on the terminal.

@Tiagoquix
Copy link
Author

Tiagoquix commented Mar 11, 2024

By the way, previously, when adding a second hl2_linux to the databases file, the script would not be able to add the launch options automatically. So, yeah, it's not desirable to do it.

@BlueManCZ
Copy link
Owner

BlueManCZ commented Mar 11, 2024

The xdotool command you provided does nothing. Also, the script doesn't continue and gets stuck on the terminal

This is weird. It means it cannot find a window with name "Team Fortress 2 - OpenGL". But it should. At least it does in my case. Can you share xprop output after clicking on the Team Fortress 2 window?

To explain to you what this xdotool command does (and the fix-wm-class.sh script):

  • When the window has missing WM_CLASS or multiple windows have the same WM_CLASS (like this hl2_linux - Half-Life 2, Team Fortress 2, Portal 2 and other games share the same), we need to manually set/change this wrong WM_CLASS to something else.
  • To do this, we use WM_NAME to find the correct window (first part of the command: xdotool search --sync --name "Team Fortress 2 - OpenGL") and set the WM_CLASS (it has two parts - classname and class) to whatever we want (second part of the command: ... set_window --classname "Team Fortress 2 - OpenGL" --class "Team Fortress 2 - OpenGL" %@)

By the way, previously, when adding a second hl2_linux to the databases file, the script would not be able to add the launch options automatically. So, yeah, it's not desirable to do it.

Also to clarify, we add launch options only if there is something wrong with the game's WM_CLASS. That means if it is missing or is not unique.

@Tiagoquix
Copy link
Author

Hello. Thanks for the explanation.

Here's the xprop output: https://0.jaegers.net/?1f63abf0c0e6a13f#5sHwrYSC6vc8AsRuLa8f2hh6AgPJ3E6XgovetNEeZaGJ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not work on Fedora 39 KDE
2 participants