Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Nov 2009 16:20:19 GMT
From:      Dmitry <dmitry2006@yandex.ru>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/140755: x11-wm/windowmaker Fix periodic focus bug [PATCH]
Message-ID:  <200911211620.nALGKJSO021010@www.freebsd.org>
Resent-Message-ID: <200911211630.nALGU1ps077638@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911211620.nALGKJSO021010>