Bug Description

Since the new 0.98 I experience a bug in on my laptop and my PC. I have in both cases XUbuntu 14.04 LTE and use the 3.13.0-66-generic kernel. The problem is the following:
After opening one terminator window (CRTL+ALT+T) and maximizing it, as soon as I want to open another new terminal window it is always behind the maximized window, except I already opened several windows, which are all put in the background of the maximized one, I somehow obtain a window which appears in the foreground.

Additionally if I open a terminal on one of the workspaces and maximize it, then switch to a different workspace and try to open a new terminal window, it sometimes happens that I get switched to the maximized windows workspace, but the new terminal is opened in the other one, too :(

I use xfce with the default windows compositor and the GTK2 version of terminator.

Personally it is a very annoying little bug, I hope it can be fixed/ figured out what is wrong.

So I had a quick play. I can reproduce. It seems to be specific to when the DBus is used to open a new window. Ctrl+Shift+I is OK. The problem only occurs when you use the main menu to open a new window.

By the way, it is not necessarily only when the first window is maximised.

A temporary workaround is to disable the DBus interface. This can either be done in the Terminator preferences in the Global tab, or by adding the option "-u" to the launcher in the system menu editor. Note that this will increase resource consumption, because now, each time you use the launcher you will get a whole new process. It is better to use the shortcut for an attached instance generally if you want to keep resource usage low.

But there is something peculiar going on with xfce then with new windows. I'll set this to Triaged till I (or some other interested party) find the time to investigate further.

I'm on Debian Testing too, but use Openbox and see the same new behavior. After
some digging into the 1.90 source, I think I have an idea where the problem is.
However, I'm not very experienced with GUI toolkits or GUI programming, so take
this with a grain of salt.

In terminator.py, there is a loop (at line 365, method layout_done) that goes
through windows and calls show() on the window that's marked as
last_active_window:

for window in self.windows:
if window.uuid == self.last_active_window: window.show()

The last_active_window is set when the "focus-in-event" happens.

Looks like things go like this:

1. First window is created.

2. Method layout_done (in terminator.py) is called, but last_active_window
is still empty so that window.show() line shown above does not get called.

2. The window gets a focus event as it has just been made visible, bringing it
to foreground, so on_focus_in() (in window.py) gets almost immediately
called, and the window gets marked as the last active window.

3. The second window is created, and I believe the the focus-in-event already
gets posted into the application's event queue before layout_done is called.
(There is a window.show() in terminator.py, method new_window, maybe it's
the place that practically speaking triggers the focus event?) However, the
event is not yet processed - on_focus_in is not yet called for the window.

4. Now layout_done is called again. The first window is still the one active
according to last_active_window, so its window.show() is called in the
loop I copy-pasted above. This call causes it to get focus again. Another
focus event is queued.

5. Now that the window has been created and dbus method has completed, the
events are handled in order, first the new window's on_focus_in is called
and it is set as the last active window, but the next event right after it
in the queue gets processed, and the first window's on_focus_in gets called
too, and it overwrites the last_active_window and the same course of events
can happen again from the point 3 onwards with other new windows.

I tested this by opening xterm, runnin terminator from it (with the DBus server setting enabled), then opening another xterm and executing terminator from it too. A new window opens, but the one opened first one gets brought to foreground.

1715 is actually quite out of date :-) I committed a fix there (rev. 1744) which I think fixes the background window issue, and only very occasionally focuses the wrong window. I haven't figured out the corner-case so far. Please check with that, as I'm fairly certain that will fix it for you.