bakkeby / dwm-flexipatch

A dwm build with preprocessor directives to decide which patches to include during build time
MIT License
1.15k stars 230 forks source link

Steam patch: `killclient` keyboard shortcut terminates Steam process entirely #210

Closed 62832 closed 2 years ago

62832 commented 2 years ago

I wanted to ask about this since I'm not sure whether or not it's a bug, but I noticed that Steam can be closed to run purely in the background just fine when clicking X to close on the window itself. However, in dwm, when using the keyboard shortcut for killclient to close a Steam-related window (when only one remains present), the entire Steam process will simply terminate instead of still running in the background. This is in contrast to other applications like Discord, which will run in the background upon being closed both with a mouse pointer or the keyboard.

Is this an issue with dwm or the steam patch itself (i.e. could this be fixed in any way with an enhancement to the patch) or just really inconsistent behaviour between different software?

bakkeby commented 2 years ago

or just really inconsistent behaviour between different software?

This.

When you click on the x in the top right corner what happens next is entirely up to the program itself as that is what interprets those button clicks (like everything else in the program window). For example you may notice that the minimize and maximize buttons do nothing, and this is because the client window will send client messages asking the window manager to maximize horizontally and vertically, but dwm does not handle these by default.

When you hit the keybinding for killclient then dwm will first send a message / event to the client asking it to terminate, and if that message is not acknowledged by the client then the window will be forcefully killed.

Upon receipt of this message it is up to the client window what to do with this information. In this case Discord decides to hide away in the systray while Steam respects the decision to exit and does so.

This is easily demonstrated by opening gedit, kwrite, kate or most graphical editors, typing something then hit the keybinding for killclient. What you tend to get is instead of the application being terminated you get a dialog box saying that you have unsaved changes and whether you want to save or discard them. Often you have a cancel option which leaves the application as-is, despite the window manager having asked the application to terminate.