linuxmint / xed

X-Apps [Text] Editor (Cross-DE, backward-compatible, GTK3, traditional UI)
GNU General Public License v2.0
445 stars 84 forks source link

added auto close setting to close window when that last tab is closed #613

Closed tlemy closed 6 months ago

tlemy commented 9 months ago

Once enabled this new setting will close the window when closing the last tab.

Here is a picture: Screenshot from 2023-12-11 13-13-05

Correcting issue #612

The new setting was added to the UI of the preferences. A condition in the close tab command checks if the number of tabs is 0. If yes, another condition will check if this setting is enabled before closing the window. It won't close the whole app if there are multiple windows, but only the targeted window.

tlemy commented 8 months ago

Hi, this is a reminder :wink:

tlemy commented 8 months ago

Ping @clefebvre @mtwebster.

mtwebster commented 7 months ago

Hi, I don't have an issue with the feature, but I'm wondering if everything you're doing is necessary:

But adding a listener to xed-settings.c, and applying the value to gsettings for each window isn't needed.

These settings are application-wide, and the setting you're adding is controlled entirely by g_settings_bind() - the GET/SET flags mean if you flip the switch, the setting is automatically updated, and vice-versa.

It's also basically a passive setting - nothing needs to be done if the value changes, it's just checked any time a tab is closed. The xed-settings.c and xed-window.c and xed-window.h changes aren't necessary.

tlemy commented 7 months ago

@mtwebster removed the unnecessary changes