Page 1 of 1

Help modifying code to Disable or Confirm close button

Posted: Wed Feb 29, 2012 5:55 pm
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.

Re: Help modifying code to Disable or Confirm close button

Posted: Fri Mar 02, 2012 5:38 am
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.

Re: Help modifying code to Disable or Confirm close button

Posted: Fri Mar 02, 2012 11:06 pm
by Frank
Great idea. Can you produce a patch against the unmodified lxterminal and upload it somewhere?

Re: Help modifying code to Disable or Confirm close button

Posted: Sat Mar 31, 2012 3:25 pm
by Es Be Ye
I think that confirmation dialog is feature that must be implemented when closing window with multiple tabs