mate-desktop / mate-terminal

The MATE Terminal Emulator
http://www.mate-desktop.org
GNU General Public License v3.0
133 stars 73 forks source link

terminal-screen: Fix warning when closing window #317

Closed sc0w closed 4 years ago

sc0w commented 4 years ago

Fixes the warning:

** (mate-terminal:45473): CRITICAL **: 01:32:55.425: terminal_window_remove_screen: assertion 'gtk_widget_get_toplevel (GTK_WIDGET (screen)) == GTK_WIDGET (window)' failed

I just added the same changes of https://github.com/mate-desktop/mate-terminal/pull/316 in other place, to fix the warnings.

@rbuj please test / review

cwendling commented 4 years ago

Looks like the check should be moved out of the switch to the to of the function then, shouldn't it?

sc0w commented 4 years ago

In my tests the change is needed inside "case TERMINAL_EXIT_CLOSE" and "case TERMINAL_EXIT_HOLD", but it isn't needed inside "case TERMINAL_EXIT_RESTART"

raveit65 commented 4 years ago

I can confirm that the warning only occurs when TERMINAL_EXIT_CLOSE is selected, tested with master branch.

rbuj commented 4 years ago

@sc0w Does it only happen, if mate-terminal was launched from another application window such as xterm, and/or running mate-terminal --disable-factory? If that were the case, then you can expand the commit message.

sc0w commented 4 years ago

@rbuj

Is now better the commit message?

You can see the warning running mate-terminal inside other terminal, with $ mate-terminal

I have tested in xterm, but I think you can use other

rbuj commented 4 years ago

@rbuj

Is now better the commit message?

You can see the warning running mate-terminal inside other terminal, with $ mate-terminal

I have tested in xterm, but I think you can use other

It removes this warning after closing mate-terminal when TERMINAL_EXIT_CLOSE is selected, and mate-terminal was launched from another terminal, or with --disable-factory option.

raveit65 commented 4 years ago

As a side effect we don't have any open bash process any more after closing all terminals :) This was always a problem with released mate-terminal versions.