From nobody@FreeBSD.org  Sat Nov 21 16:20:20 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 625271065670
	for <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <dmitry2006@yandex.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: x11-wm/windowmaker Fix periodic focus bug [PATCH]
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         140755
>Category:       ports
>Synopsis:       x11-wm/windowmaker Fix periodic focus bug [PATCH]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 21 16:30:01 UTC 2009
>Closed-Date:    Mon Dec 14 21:43:00 UTC 2009
>Last-Modified:  Mon Dec 14 21:50:01 UTC 2009
>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:
Responsible-Changed-From-To: freebsd-ports-bugs->dougb 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Nov 21 16:30:12 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=140755 
State-Changed-From-To: open->closed 
State-Changed-By: dougb 
State-Changed-When: Mon Dec 14 21:42:45 UTC 2009 
State-Changed-Why:  

Patch applied, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=140755 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/140755: commit references a PR
Date: Mon, 14 Dec 2009 21:42:39 +0000 (UTC)

 dougb       2009-12-14 21:42:25 UTC
 
   FreeBSD ports repository
 
   Modified files:
     x11-wm/windowmaker   Makefile 
   Added files:
     x11-wm/windowmaker/files patch-src_actions.c 
   Log:
   Add a patch to fix a periodic focus bug
   
   Bump PORTREVISION
   
   PR:             ports/140755
   Submitted by:   Dmitry <dmitry2006@yandex.ru>
   
   Revision  Changes    Path
   1.146     +1 -1      ports/x11-wm/windowmaker/Makefile
   1.1       +35 -0     ports/x11-wm/windowmaker/files/patch-src_actions.c (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
