From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Nov 21 16:30:02 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C8F21065670 for ; Sat, 21 Nov 2009 16:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 00E6C8FC18 for ; Sat, 21 Nov 2009 16:30:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id nALGU1a3077649 for ; Sat, 21 Nov 2009 16:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id nALGU1ps077638; Sat, 21 Nov 2009 16:30:01 GMT (envelope-from gnats) Resent-Date: Sat, 21 Nov 2009 16:30:01 GMT Resent-Message-Id: <200911211630.nALGU1ps077638@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dmitry Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 625271065670 for ; Sat, 21 Nov 2009 16:20:20 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 51D6D8FC1D for ; Sat, 21 Nov 2009 16:20:20 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id nALGKJ2L021012 for ; Sat, 21 Nov 2009 16:20:19 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id nALGKJSO021010; Sat, 21 Nov 2009 16:20:19 GMT (envelope-from nobody) Message-Id: <200911211620.nALGKJSO021010@www.freebsd.org> Date: Sat, 21 Nov 2009 16:20:19 GMT From: Dmitry To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/140755: x11-wm/windowmaker Fix periodic focus bug [PATCH] X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Nov 2009 16:30:02 -0000 >Number: 140755 >Category: ports >Synopsis: x11-wm/windowmaker Fix periodic focus bug [PATCH] >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Nov 21 16:30:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Dmitry >Release: 8.0-PRERELEASE >Organization: >Environment: FreeBSD *** 8.0-PRERELEASE FreeBSD 8.0-PRERELEASE #0: Wed Nov 18 23:50:05 YEKT 2009 root@***:/usr/obj/usr/src/sys/GENERIC_ amd64 >Description: sometimes cannot click in window to focus window http://repo.or.cz/w/wmaker-crm.git/commit/c91bb1ba http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=102314 >How-To-Repeat: >Fix: Patch attached with submission follows: --- src/actions.c.orig +++ src/actions.c @@ -78,6 +78,16 @@ #define SHADE_STEPS shadePars[(int)wPreferences.shade_speed].steps #define SHADE_DELAY shadePars[(int)wPreferences.shade_speed].delay +static int +compareTimes(Time t1, Time t2) +{ + Time diff; + + if (t1 == t2) + return 0; + diff = t1 - t2; + return (diff < 60000) ? 1 : -1; +} /* *---------------------------------------------------------------------- @@ -99,11 +109,11 @@ WWindow *old_focused; WWindow *focused=scr->focused_window; - int timestamp=LastTimestamp; + Time timestamp=LastTimestamp; WApplication *oapp=NULL, *napp=NULL; int wasfocused; - if (scr->flags.ignore_focus_events || LastFocusChange > timestamp) + if (scr->flags.ignore_focus_events || compareTimes(LastFocusChange, timestamp) > 0) return; if (!old_scr) >Release-Note: >Audit-Trail: >Unformatted: