[compiz] Window Focus Changes When Dragging

Elijah Newren
Sun, 14 Jan 2007 22:36:43 -0000

On 1/14/07, Who <mailforwho@googlemail.com> wrote:
> Hi,
>
> Here is a scenario:
> I have two windows (A and B) and I want to drag a file from one to the
other.
>
> I focus window A, browse to the place that I want to drop the file and
> then try and pick up the file from window B, window B gets focused
> when I start to drag the icon
>
> Is there any way to make Compiz only focus a window when I click it
> but not when I click and drag an item on it? (Sometimes, for example,
> Window B will cover up the thing I was trying to drop on window A)
>
> A quick survey:
> Windows: Doesn't change focus on drag
> OSX: Doesn't change focus on drag
> Linux w. Metacity: Does cause focus to change on dragging.
>
> So I don't know whether the precedent is set by the other two OSs or
> by metacity. If it is easy, and it isn't already possible then could
> it be there as an option? :)

There's currently no way for the window manager (metacity or compiz or
any other) to know whether a click started a drag (or might start a
drag, to be more precise) or is some normal click.  Applications need
to provide a hint to the window manager for this.  There have been
various proposals on the wm-spec list for this (and kwin & qt
implemented a hack that the gtk+ devs objected to, IIRC) but we
haven't gotten around to finishing an alternative implementation.
It's actually not a lot of work, I've just been lacking the time to do
it.  I did have a working (but somewhat ugly) gtk+ patch for this and
it's filed somewhere in bugzilla so someone just needs to clean it up
and test it out.  If someone's interested, I can look up the bug
number...

Cheers,
Elijah