From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 26 11:16:39 2006 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E8DA716A420; Sun, 26 Mar 2006 11:16:39 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 93C7D43D45; Sun, 26 Mar 2006 11:16:37 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 47EE146B9E; Sun, 26 Mar 2006 06:16:36 -0500 (EST) Date: Sun, 26 Mar 2006 11:16:36 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Peter Jeremy In-Reply-To: <20060326081719.GB753@turion.vk2pj.dyndns.org> Message-ID: <20060326111317.V35431@fledge.watson.org> References: <20060326072009.GL25392@wantadilla.lemis.com> <20060326081719.GB753@turion.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Greg 'groggy' Lehey , FreeBSD Hackers Subject: Re: Programs not accepting input? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2006 11:16:40 -0000 On Sun, 26 Mar 2006, Peter Jeremy wrote: > On Sun, 2006-Mar-26 17:50:09 +1030, Greg 'groggy' Lehey wrote: >> In the last month or two I've seen increasing occurrences of programs >> refusing keyboard input after they've been running for a while >> (between hours and days). They still respond to the mouse. At first >> I thought it was hardware, but it happens on a number of different >> machines, and only with certain programs, all of them X clients. >> Here's an overview (system names are simply to show that they're >> different machines). > > Is the problem that the clients aren't taking focus or have focus but aren't > accepting keyboard input? > > My work system runs separate X servers on two heads (rather than ximerama) > and I have problems with windows occasionally refusing to accept focus after > I move the pointer from screen to screen (though I can get an alternative > window to accept focus and then switch back to the window I originally > wanted). This started after an X.org upgrade but I'm not sure which one. I've noticed that KDE's window manager, especially the version currently in ports, seems to occasionally have focus management problems. If I use ctrl-alt-tab to manually switch the focus, keyboard and some mouse input works properly, and after a program exits, things start working right. I think what's going on is that the window manager becomes confused as the mouse passes over the panel or interacts with the panel, as at that point the focus gets "stuck". Probably because mouse input events have been grabbed and not released, which is not an unusual X window manager application bug. Once the grab has happened without a release, the mouse remains grabbed until that application exits or releases it, so that would be consistent with my triggering a release by the window manager through exiting another program and then triggering the bug again by passing over the panel (or whatever). So I'd almost certainly put this down to an X11 application bug, possibly in the window manager. The "grab" behavior is one of the more unfortunate ones in X11, since it allows an application to very trivially interfere with the operation of the window server as a whole, and it's an easy bug to implement (just like leaking memory -- you have an error path and forget to release all resources). Robert N M Watson