Opened 5 years ago

Closed 5 months ago

#3009 closed defect (fixed)

"Quit GRASS GIS" button only exits GUI

Reported by: cmbarton Owned by: grass-dev@…
Priority: normal Milestone: 7.8.3
Component: wxGUI Version: unspecified
Keywords: "quit grass gis button" Cc:
CPU: Unspecified Platform: MacOSX

Description

For some time, quitting GRASS from the GUI opens a dialog (see attached) with buttons to "Close GUI" and "Quit GRASS GIS".

But both do the same thing: quitting the GUI but not exiting GRASS. At least that is what happens on the Mac. Is this the case on other platforms too?

Attachments (1)

GRASS_quit_dialog.png (22.1 KB) - added by cmbarton 5 years ago.
Quit GRASS dialog

Download all attachments as: .zip

Change History (14)

Changed 5 years ago by cmbarton

Attachment: GRASS_quit_dialog.png added

Quit GRASS dialog

comment:1 Changed 5 years ago by annakrat

Platform: UnspecifiedMacOSX

Yes, other platforms work.

comment:2 Changed 4 years ago by neteler

Milestone: 7.0.57.0.6

comment:3 Changed 3 years ago by neteler

Milestone: 7.0.67.0.7

comment:4 Changed 19 months ago by martinl

Still relevant?

comment:5 Changed 19 months ago by cmbarton

Yes. Quit GRASS button does not work on the Mac

comment:6 Changed 19 months ago by martinl

Milestone: 7.0.77.6.2

comment:7 Changed 9 months ago by nila

This is still an issue with 7.8 branch and master (7.9.dev), with Python 3.8.2 and wxPython 4.0.7.post2.

comment:8 Changed 9 months ago by nila

I believe I have found the cause of this issue.

In gui/wxpython/lmgr/frame.py:2533-2536 GMFrame.OnCloseWindowOrExit():

        if ret != wx.ID_CANCEL:
            self._closeWindow(event)
            if ret == wx.ID_YES:
                self._quitGRASS()

in self._closeWindow self (the GMFrame) will be destroyed and self._quitGRASS will never be reached.

comment:9 Changed 9 months ago by nila

I was wrong in my previous assessment.

Now I found the bug and the PR#408 may fix this issue.

comment:10 in reply to:  8 Changed 8 months ago by annakrat

Replying to nila:

I believe I have found the cause of this issue.

In gui/wxpython/lmgr/frame.py:2533-2536 GMFrame.OnCloseWindowOrExit():

        if ret != wx.ID_CANCEL:
            self._closeWindow(event)
            if ret == wx.ID_YES:
                self._quitGRASS()

in self._closeWindow self (the GMFrame) will be destroyed and self._quitGRASS will never be reached.

Are you sure this is not the case? It seems like that would be a problem. Not sure what the solution would be, perhaps moving the os.kill to the GMApp OnExit? handler.

comment:11 Changed 8 months ago by neteler

Milestone: 7.6.27.8.3

comment:12 Changed 5 months ago by nila

This issue has been solved for bash and zsh terminal with PR722.

The cause of the problem is that some shells often ignore SIGTERM when interactive, which is the case - as it seems - for e.g. mac and FreeBSD shells.

Adding a trap "exit" TERM did the trick.

comment:13 Changed 5 months ago by nila

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.