freebsd-ports/x11-wm/windowmaker/files/patch-src_actions.c
Doug Barton 89da9581eb Add a patch to fix a periodic focus bug
Bump PORTREVISION

PR:		ports/140755
Submitted by:	Dmitry <dmitry2006@yandex.ru>
2009-12-14 21:42:25 +00:00

35 lines
852 B
C

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