Help modifying code to Disable or Confirm close button

LXTerminal is the standard terminal emulator of LXDE - http://wiki.lxde.org/en/LXTerminal
Locked
jsedwards
Posts: 3
Joined: Fri Jul 29, 2011 4:19 am

Help modifying code to Disable or Confirm close button

Post by jsedwards »

I have a handicap now and don't have fine motor control of my fingers. Accidentally middle clicking on the middle button and closing tabs was a problem so I got the source code and fixed it so that if the tabs didn't have a close button they wouldn't close with a middle click either.

Then a couple of days ago I accidentally clicked on the window close button and lost all of the tabs :cry:

I've been trying to fix that and I am having trouble. First I tried adding a dialog that pops up when I hit the close button to confirm. But it seg faulted when I did the call to gtk_message_dialog_new to create the dialog to confirm the close.

Then I discovered I could just add the following line and then the close button just didn't function at all, and that would work for me:

Code: Select all

g_signal_connect(G_OBJECT(terminal->window), "delete-event", G_CALLBACK(gtk_true), terminal);
But then I discoved that only worked okay if I always started new LXTerminal windows from the menu of a running window. If I tried to start a new LXTerminal from the start menu or command line it crashes ALL the running LXTerminal windows.

Can anybody point me in the right direction?

Thanks,
-Scott

P.S. if anyone is interested in the patch to disable the middle click from closing tabs if they don't have a close button please let me know.
jsedwards
Posts: 3
Joined: Fri Jul 29, 2011 4:19 am

Re: Help modifying code to Disable or Confirm close button

Post by jsedwards »

I spent more time trying to fix either the window close confirmation dialog or the crash when starting more than one window with no success. I finally decided the best solution for me was to just eliminate the one LXTerminal process handling all windows. So now when I start two LXTerminals running I have two processes. They don't seem to use that much memory, so I don't think that will be a big problem for me.
Frank
Posts: 28
Joined: Sat Sep 27, 2008 4:42 pm

Re: Help modifying code to Disable or Confirm close button

Post by Frank »

Great idea. Can you produce a patch against the unmodified lxterminal and upload it somewhere?
Es Be Ye
Posts: 1
Joined: Sat Mar 31, 2012 3:17 pm

Re: Help modifying code to Disable or Confirm close button

Post by Es Be Ye »

I think that confirmation dialog is feature that must be implemented when closing window with multiple tabs
Locked