Closing Discord with X Button & ALT+F4


23 kommentarer

  • kyoko

    I am pretty sure thats how applications react on windows to that shortcut. i dont think you can change that


    My other applications, such as Steam, Origin etc. have also an option "Minimize on close", just like Discord has.

    Thing is, when I ALT+F4 (with a custom macro mouse button) all my other applications minimize to the system tray just like they should, only Discord closes completely the process, even if the option "Minimize on close" is checked.

    So, I am pretty sure it's not a Windows thing. It's Discord. I have sent a ticket about it. They said that they unfortunately can't fix that right now, but "anything can happen in the future".

  • mkcoldwolf

    ALT+F4 is just designed to exit the app completely, you shouldn't use that anyway if u are not trying to exist a program.....

  • ArkiTechyDaddy

    This was mentioned here as well:

    ALT+F4 is for closing windows or exiting a program.  ALT+[space] then N will minimize a window (but in this case minimize sends discord to task bar instead of system tray)   Some mouse software use a "window close" command which is normally included in some mouse software key assignments but it seems Discord takes it as a "close application" command so there is something wrong.  Discord developers really should fix the close window/app issue.

    Try using the key combo ALT+[space] then C to close a window vs ALT+F4 which closes windows but normally exits the program.


    "Try using the key combo ALT+[space] then C to close a window vs ALT+F4 which closes windows but normally exits the program."

    This actually works for Discord, but not for all applications. For example, it doesn't work for MSI Dragon Center, because the application is not programmed to have a file menu, so you cannot hit CTRL+SPACE to pull it down, then hit C to close it. And for the apps where this works, there is always this fraction of a second where you see the menu dropping down while the app is closing. Not a big deal, but worth a mention.

    Who doesn't care for other apps it's a good workaround until they fix the standard ALT+F4 command.

  • Merona

    I think this is happening because of how Discord is built. Discord uses Electron to act as a normal application and to support shortcuts like toggling mute and deafen. ALT+F4 is "Exit Application" in Electron and if I'm correct you can't change this easily in code.

  • 13

    Yes, please add the ability to minimize it to tray on ALT+F4

  • gyaani_guy

    In my experience Alt+F4 -> minimize happens with every application that supports close to tray option, - skype, irc clients , torrent clients, steam, search apps like 'Everything' , xampp, etc.


  • FlameFrost

    Responding to "Discord uses Electron" comment above, there are other apps which are also built using Electron (Slack, for example) and these do minimize to systray when closed with Alt + F4 or "x".

    Also, there are some comments incorrectly suggesting as to how Alt + F4 is meant for shutting applications. I disagree. Microsoft's own application, Outlook, minimizes to systray (if the option is enabled) irrespective of how the window is closed, using X or Alt + F4.


    Clearly, it's a problem with Discord.

  • Vlad

    Since discord clearly will never bother to do something about this issue, is there any way to fix this behavior via other means?

  • djmaher

    Lots of helpful souls chiming in on this thread with no knowledge of the Win32 API :)

    The Alt+F4 keystroke is the default keybinding for destroying the window currently in focus - whether the application thread stops running or not is completely at the application developer's discretion. Vast majority of Windows apps minimise on Alt+F4 but do not close; this is completely standard behaviour.

    Anyway, some nice chap found a way to do this and posted it on Reddit:


  • asheroto

    Since they probably won't fix this, I created a simple solution:

  • Nol Fran Shee

    ALT+F4 is a Windows top level macro that explicitly means EXIT the application.  If you want to minimize the app, go right ahead and minimize it.

    Having a custom minimize function that places an icon in the task tray instead of minimizing to the task bar is a common feature of many apps.  Having the option to do either/or is fantastic.  But for the love of all that is holy do not screw with the exit function.

    The X button and ALT+F4 mean EXIT on every standard Windows program.

  • Vlad

    @Nol Fran She have you ever actually used any program that is expected to run in the background?

    Like literally any cloud storage/torrent client/messaging app/game store (eg: Steam)/wallpaper engine or other desktop overlay?

    There's a point where you should stop blindly abiding by outdated conventions which were not even meant for such apps in the first place, and notice from "field experience" that it's a better UX overall when done this way.

  • Nol Fran Shee

    I do.  And I minimize them to put them there.  When I close a program I expect it to stop running. Most of teh ones that do stay active synchronization tasks or event triggers.

    To use your own argument, forcing an aging UI into a new task for which it is ill suited is a losing game - make a new paradigm.  do you remember when Stardock WindowBlinds was the newest thing - way back in XP days?  You could "roll up" windows you were not using actively.  It was very innovative.  And totally useless.  Before that was a Terminate and Stay Resident (TSR) model where you'd run a program and it would end, giving you the command prompt back.  But a piece of it stayed running in memory and would watch for some set of hot-keys to be pressed and pop their UI into the front.  that was a pretty useful model because it didn't waste screen real estate at all.

    There might be an actual use case for some kind of app dashboard that is always visible - perhaps even an overlay.  Most folks want the toolbar to go away ever since 16:9 replaced 4:3 we've lost some vertical real estate.

    Discord solved it by making it optional so you can have the standard action or you can have your favorite non-standard action.  But don't wreck it for the 90% of normal users for some niche use case.

  • skst

    Discord solved it by making it optional so you can have the standard action or you can have your favorite non-standard action.  But don't wreck it for the 90% of normal users for some niche use case.

    Exactly! That is what we are discussing in this thread. I think you may be under the impression that people are asking for Discord to always minimize to the tray when ALT+F4. That is not the case.

    When the Minimize to Tray option is enabled in Discord's Windows Settings, so that the System > Close command minimizes the Discord window to the tray (instead of exiting the application), we would like the Windows shortcut for that same command to do the same thing (minimize instead of exiting). In other words, we would like the shortcut for our "favorite non-standard action" to do the same non-standard action that has been specified in the options--not the original "standard action."

  • Vlad

    @Nol Fran Shee then how do you feel about all the other aforementioned apps that handle alt+f4 the way mentioned by me and OP? I don't know how can you call this a "niche use case" given that 90% of them do in fact, work that way.

    Ultimately I think we can all agree having an option to toggle the functionality is the objectively best way to address this for everyone, and i think we can also agree that it will most likely never happen given discord's overall disinterest in such technicalities. No need for us to fight over it.


    ALT+F4 should completely terminate any application.

    But if the same application has a "Close command minimizes the app" toggle option in their settings, than the X and ALT+F4 should actually behave like this, and minimize the app.

    It's just a line of code done the wrong way by Discord.

  • Nol Fran Shee

    Ah yes, I think you spotted it.  I was reading this as a request to always do this.  My bad, thanks for pointing that out!


    The option is the right way to handle it.

  • Vlad

    I mean, if i had to pick just one behavior, I'd pick minimize without skipping a beat. It is very frustrating to accommodate for inconsistencies between background apps like these. An option to toggle would just be the actual proper fix for this issue.

  • Regnareb

    The option has been there for the longest time in the preferences, it is just very buggy.
    The Discord team has a habit of not fixing some bugs sadly.

  • langdonx

    This is extremely annoying and let me to believe Discord was just crashing in the background for so long.

    If you're running AutoHotkey already, this will sort you out:

    #IfWinActive ahk_exe Discord.exe

    Surely a company as large as Discord can use their muscle to work with Electron to fix this?  The fact that this menu (see the recommended shortcut) doesn't exit the application is proof enough that it's a bug:


Log ind for at efterlade en kommentar.