[dev] [tabbed] changeset 132 (last viewed tab remembering)

From: anonymous <aim0shei_AT_lavabit.com>
Date: Thu, 21 Jan 2010 00:44:51 +0300

This changeset is not released, but it introduced a bug and it have not
fixed for a month.

The problem is that when you call `focus(lastsel)` from `unmanage`
there is a possibility that lastsel is NULL. In this case `focus` first
first checks `if (!c)` on line 390 and sets `c` to `sel` (line 391).
Then it sets `sel` to `c` (line 404 (YARLY)). So after `focus` exits,
`sel` is the window we have just unmanaged, so if you press C-q again,
XKillClient will try to remove window again and fail. Even worse,
`sel` is already freed.

I have tried to fix it by removing
if (!c)
        c = sel ? sel : clients;
but it fails.

if (!lastsel)
        sel = NULL;
before `focus(lastsel)` fixes the problem but it is still buggy.

So I want to ask: what should focus(NULL) do? What it means? I can
search where it is called, but I can't understand what it means.
"Focus selected client if something is selected of first client if
nothing is selected or don't focus anything if there is no clients"
don't sound simple.
Received on Wed Jan 20 2010 - 21:44:51 UTC

This archive was generated by hypermail 2.2.0 : Wed Jan 20 2010 - 21:48:02 UTC