Turn off close window in Gnome 2.22.3
I'm using Gnome. I wrote a program with ncurses that runs in a terminal. Currently I'm running it from gnome-terminal.
It's important for the program to exit properly, so I wrote some functions that force the program to exit cleanly. For example, if the user chooses to exit or hits Ctrl-C, then a function gets called that cleans everything up and exits properly. Yesterday someone came along and without even knowing what the program was, hit the X (close window) button and that was the end of that. I guess I should have seen that one coming.
A simple solution to that problem if it exists could be to just get rid of the close window option when calling the instance of gnome-terminal that will run my program. Since the program is started rarely and runs continuously most of the time, this would be a good solution for me.
Typically the close window command is available by clicking the X at the top right of the window, or by using alt-(right button) to get a menu, or by alt-f4. I already call gnome-terminal with option "--hide-menubar" to get rid of the ability to close it via the menu bar. I realize it's not the desktop's job to make up for my lack of foresight, but if it is possible to open a window with such properties, then I would appreciate knowing how it's done. Back in the days of fvwm this would have almost definitely been possible, but I'm not sure how to do it in Gnome. Also, if it's possible to just eliminate the X button but not the other things, then that might go far enough to fixing the problem.
I'm working in Gnome version 2.22.3 with build date 07/01/2008 (not sure if that means July or January). It's a bit of an old version since I'm using some special hardware that only has drivers that work with certain kernels, and since the system is currently working with all of the hardware, I don't want to upgrade the system.
By the way, I prefer not to use the /apps/gnome-terminal/global/confirm_window_close option of gconftool-2 since if that is set then someone might just decide to unset it since it would be applied to all instances of gnome-terminal, not just the ones I want it to apply to. Also, the command:
gconftool-2 --type bool --set /apps/gnome-terminal/global/confirm_window_close "true"
actually doesn't seem to work for my setup anyway. Maybe that option doesn't exist in my version of Gnome or maybe the syntax is different.
Last edited by chadwick; 03-15-2011 at 01:25 AM.
|