You are not logged in.

#1 2017-06-22 01:00:01

drtebi
Member
Registered: 2013-02-09
Posts: 126

How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

Hello,

I have Whatsapp Desktop installed successfully, works just fine.

However, it's doesn't "shut down".

I suppose it is programmed to linger in the system tray, from which I suppose it can be closed for good.

I don't have a system tray (Enlightenment), neither do I want one. I don't want programs to linger around.

How can I close Whatsapp for good?

I am thinking of writing a little shell script for it, but maybe there is a setting or something else I have overlooked?

Last edited by drtebi (2018-03-26 19:29:43)

Offline

#2 2017-06-22 02:09:41

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

pkill whatsapp?

Offline

#3 2017-06-22 02:57:56

drtebi
Member
Registered: 2013-02-09
Posts: 126

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

HiImTye wrote:

pkill whatsapp?

Yes, sure, that would work.

But I am looking for a "seamless" solution. E.g. a startup script that will start Whatsapp, and when Whatsapp is closed, will kill all its remaining processes... something like that.

Offline

#4 2017-06-22 03:01:40

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

I am not using whatsapp-desktop, but if there is an option to avoid "minimize to system-tray" it can help. If there is no such option you can make a feature request on their github page.

Offline

#5 2017-06-22 06:03:26

drtebi
Member
Registered: 2013-02-09
Posts: 126

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

Docbroke wrote:

I am not using whatsapp-desktop, but if there is an option to avoid "minimize to system-tray" it can help. If there is no such option you can make a feature request on their github page.

There does not appear to be that option.

I guess a feature request is a good idea.

But if I just wanted to do it with a script... has anyone tried something similar?

Offline

#6 2017-06-22 06:27:14

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

Have you tried the usual keyboard combos, such as:

Ctrl + W
Ctrl + Q
Alt + F4

Offline

#7 2017-06-22 07:02:39

drtebi
Member
Registered: 2013-02-09
Posts: 126

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

x33a wrote:

Have you tried the usual keyboard combos, such as:

Ctrl + W
Ctrl + Q
Alt + F4

Yes, I have. The program window closes, but when you check the running processes, Whatsapp is still running. And if someone sends a message, it pops up... that is intentional I suppose, but an option to actually shut it all down is missing.

Offline

#8 2017-06-22 07:05:15

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

Well, in that case, a wrapper script seems to be the way out.

Offline

#9 2017-07-05 10:10:23

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

something like

ps -C whatsapp | grep -v PID && pkill whatsapp && notify-send closed whatsapp || whatsapp

or to just kill it and start it again

pkill whatsapp; whatsapp

Offline

#10 2018-03-26 19:29:14

drtebi
Member
Registered: 2013-02-09
Posts: 126

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

I just realized that the problem only exists if you have your window manager setup to use CTRL+Q to close windows.

While that works with every other program, whatsapp desktop does not close completely with that shortcut, it only closes the window, four other processes stay open. It does however close as expected, if I do File -> Quit.

That is a bit irritating, especially since the default shortcut to close Whatsapp Desktop is also CTRL+Q.

I must assume that this is some kind of bug in the application, or possibly the framework they are using. The window manager short cut should propagate to the app...

Anyway, for now it will be File -> Quit instead of CTRL+Q.

Offline

#11 2018-03-26 19:47:54

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

No, that's definitely not a client bug.  It sounds like bad behavior of the window manager - whether or not it is a WM "bug" depends on whether the WM authors intended for it to be so badly behaved or not.

What WM is this?

WMs generally use the Mod4 (aka "Windows" or "Super" button) for bindings.  Occasionally some other modifiers are bound by the WM, but binding Ctrl-anything sounds like a bad idea for a WM.  Most clients expect to be able to handle Ctrl-key combinations themselves.

Last edited by Trilby (2018-03-26 19:50:32)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#12 2018-03-27 17:58:47

drtebi
Member
Registered: 2013-02-09
Posts: 126

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

The window manager I am using is Enlightenment. It has quite an extensive list of options for key bindings. I have used it for years, and always used Ctrl+Q to close a window—this is not a problem in any other application, whatsapp-desktop is the only one I know of that doesn't play along with it.

As far as I understand from my own programming with Qt, a "close event" should implement whatever is necessary to do when the window (through whatever means) is closed. And my assumption here is, that whatsapp-desktop doesn't have this implemented.

Offline

#13 2018-03-27 18:09:04

seth
Member
Registered: 2012-09-03
Posts: 51,213

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

As far as I understand from my own programming with Qt, a "close event" should implement whatever is necessary to do
when the window (through whatever means) is closed.

Yes. And since when does a closing window mean the process has to terminate?
Using Ctrl+Q as window closing shortcut is just a bad idea, sorry.

The WM will catch the event and yes, close the window.
But the client won't see the event and therefore not quit.

Ctrl+Q is a pretty much default quitting shortcut, closing windows is "traditionally" (at least in the windows world) done vial Alt+F4.
Closing windows and quitting a program is NOT the same.

Offline

#14 2018-03-27 18:16:35

drtebi
Member
Registered: 2013-02-09
Posts: 126

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

I am not sure what you refer to when you say "client". If you mean the application, then that would mean that all the applications that I close with Ctrl+Q would still be open, but without a window displaying—this is not the case. All other applications, as mentioned, do close the window and terminate the application.

I don't disagree regarding quitting and closing not being the same. But I don't have Ctrl+Q mapped to "terminate application", but to "close window", which is exactly the same as mapping Alt+F4 to that event.

So I don't see why this should be a wrong idea, after all I am just remapping a key (if we take Alt+F4 as the traditional mapping).

And, again, why does it work in every other application, but not whatsapp-desktop?

Offline

#15 2018-03-27 18:22:36

seth
Member
Registered: 2012-09-03
Posts: 51,213

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

Graphical "applications" are "clients" to the "display server". What a client does if you close one of its windows is completely up to the client and its implementation. Apparently WhatsApp follows an SDI model and therefore does not terminate if you close one of its windows. That this has not happened with random other clients you've been using in the past is meaningless.

Ctrl+Q is traditionally interpreted by clients (to "quit" the process) and Alt+F4 by the window manager (to close the active window)
You can use Ctrl+Q for the latter, but that will prohibit the client handling of the shortcut.

So what you see is completely expectable and nomal and ok - it's just a stupid configuration.

Offline

#16 2018-03-27 18:32:28

drtebi
Member
Registered: 2013-02-09
Posts: 126

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

seth wrote:

Graphical "applications" are "clients" to the "display server". What a client does if you close one of its windows is completely up to the client and its implementation. Apparently WhatsApp follows an SDI model and therefore does not terminate if you close one of its windows. That this has not happened with random other clients you've been using in the past is meaningless.

I agree and understand this. And it was also my assumption; after all, whatsapp-desktop may have been designed to stay open without a window, so that messages can be received even when the user decided he just doesn't want the window open.

seth wrote:

Ctrl+Q is traditionally interpreted by clients (to "quit" the process) and Alt+F4 by the window manager (to close the active window)
You can use Ctrl+Q for the latter, but that will prohibit the client handling of the shortcut.

... assuming the client has Ctrl+Q implemented, and actually does something with it other than quitting the application.

seth wrote:

So what you see is completely expectable and nomal and ok - it's just a stupid configuration.

Now let's be nice here please, and rephrase that to "does not make sense, could cause problems"

Offline

#17 2018-03-27 19:49:53

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

There are many de-facto standards.  `Ctrl-Q` is a common key for quitting a program.  This is both reflected by and reinforced by some toolkits (e.g. Qt) using it as a default for many applications.  If you write a Qt program, you certainly can chose not to use Ctrl-Q for "quit", you could use Ctrl-H if you wanted, or Ctrl-Shift-Space-F3-Y if you want to appeal to emacs users tongue  But Ctrl-Q is a de-facto standard client / application bound key.  This is why it is a bad idea for a window manager to bind that key as it will result in clients never detecting the key press.

For very similar reasons, clients (i.e. applications) generally do not bind Mod4 key combinations.  There certainly are exceptions, but it is generally expected that Mod4 key combinations are for WMs and Ctrl key combinations are for clients (as are most Alt/Shift combinations unless they are paired with Mod4).

This is not - as far as I know - formalized anywhere in any binding protocol, but going against such widely used convention is bound to cause problems.  You are running into one of those problems now.

So, in short, you certianly may use a non-convential key binding scheme for your WM.  But if you do, you really can't expect all programs to behave nicely with it.  The fact that some do is just dumb luck.

You could bind Ctrl-Q in your WM to XKillClient rather than XDestroyWindow and it should then do what you want for Whatsapp, but this still doesn't seem like a good idea to me.

Last edited by Trilby (2018-03-27 19:52:45)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#18 2018-03-27 20:24:13

drtebi
Member
Registered: 2013-02-09
Posts: 126

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

Using the mod4 key (usually the "Windows" key if I understand correctly) for WM key bindings is certainly the way to go. As a matter of fact, I have set up most of the Enlightenment keybindings with the mod4 key. So if I want to stick with 'Q', I should probably configure mod4+Q to close windows.

I realized today that whatsapp-desktop actually stays open if you close the window via its "X" from the window, as in the X icon of the window bar. So this just confirms that the idea of the whatsapp-desktop developers was to keep whatsapp running in the background, so that you can receive messages even if the window is closed.

Is it correct then, that the XDestroyWindow event is actually the same as clicking the X in the window title bar? If so... then isn't it true that by binding Ctrl+Q to XDestroyWindow only has the disadvantage that any client's Ctrl+Q key mappings are not being triggered? I mean... after all, all I am trying to do is close a window with a shortcut rather than having to use the mouse and click that X in the window title bar.

BTW, this is an interesting article regarding the history of the "Quit" command:
https://design.canonical.com/2011/03/quit/

Offline

#19 2018-03-27 20:36:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

drtebi wrote:

Is it correct then, that the XDestroyWindow event is actually the same as clicking the X in the window title bar?

This depends on the WM, but generally yes.

drtebi wrote:

If so... then isn't it true that by binding Ctrl+Q to XDestroyWindow only has the disadvantage that any client's Ctrl+Q key mappings are not being triggered?

Yes.  And this is precisely the problem you are concerned about in this thread.  Ctrl-Q when bound by the client generally means "quit", and you've stated that when you use Whatsapp's Quit menu entry it does indeed fully shut down.

drtebi wrote:

all I am trying to do is close a window...

This is clearly not true.  You want the program to end, otherwise what are we talking about in this thread?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#20 2018-03-27 21:25:27

drtebi
Member
Registered: 2013-02-09
Posts: 126

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

Trilby wrote:
drtebi wrote:

all I am trying to do is close a window...

This is clearly not true.  You want the program to end, otherwise what are we talking about in this thread?

Well, I have changed my mind, since I now understand why whatsapp-desktop is not quitting when I close the window. And I don't see this as a problem anymore... rather, I understand the issue now.

I do want a window to close, not quit an application... for example, when using firefox, the Quit command from the file menu (or the shortcut Ctrl+Q, if it wasn't reconfigured as in my case), would close all firefox windows, e.g. quit firefox entirely. That is not what I would want. I may have two firefox windows open, but just want to close one of those windows.

I know I am doing things the unconventional way by saying "in my life quit is close", but as long as I know what I am doing, I think I will be fine.

Offline

#21 2018-03-28 07:44:53

seth
Member
Registered: 2012-09-03
Posts: 51,213

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

Trilby wrote:

You could bind Ctrl-Q in your WM to XKillClient rather than XDestroyWindow and it should then do what you want for Whatsapp, but this still doesn't seem like a good idea to me.

Sidenote: this /is/ not a good idea.
It basically pulls away the X server under the client. Clients traditionally use this as occasion for an unclean exit (aka "crash") - XKillClient is more of a server-side last resort™.

Offline

#22 2020-12-17 06:52:20

Hargreavs
Member
Registered: 2020-12-17
Posts: 1
Website

Re: How to close Whatsapp completely ('have no systray) [SOMEWHAT SOLVED]

To shut down Whatsapp from the desktop you have to do this.

Open WhatsApp on your phone, tap on Menu, then WhatsApp Web. That will show you all your WhatsApp web active sessions with last active time. All you need to do is to tap on Log out from all computer. That will logout from all the active sessions of your WhatsApp web from all the devices you were logged in.

If this doesn't work with the official whatsapp then you can login with the different number into this GBWhatsapp Apk (https://gbapps.net/gbwhatsapp-apk/) which is a modified version of Whatsapp and have to do this.

Offline

Board footer

Powered by FluxBB