From: Christophe CURIS <[email protected]>

---
 src/WindowMaker.h | 3 +++
 src/actions.c     | 5 ++---
 src/event.c       | 1 -
 src/main.c        | 4 +---
 4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 6950a78..7211181 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -469,6 +469,9 @@ extern struct wmaker_global_variables {
                /* ts of the last event we received */
                Time last_event;
 
+               /* ts on the last time we did XSetInputFocus() */
+               Time focus_change;
+
        } timestamp;
 
 } w_global;
diff --git a/src/actions.c b/src/actions.c
index 0b4f450..2cac48b 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -53,7 +53,6 @@
 /****** Global Variables ******/
 
 int ignore_wks_change = 0;
-extern Time LastFocusChange;
 extern Atom _XA_WM_TAKE_FOCUS;
 
 static void find_Maximus_geometry(WWindow *wwin, WArea usableArea, int *new_x, 
int *new_y,
@@ -115,7 +114,7 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin)
        WApplication *oapp = NULL, *napp = NULL;
        int wasfocused;
 
-       if (scr->flags.ignore_focus_events || compareTimes(LastFocusChange, 
timestamp) > 0)
+       if (scr->flags.ignore_focus_events || 
compareTimes(w_global.timestamp.focus_change, timestamp) > 0)
                return;
 
        if (!old_scr)
@@ -123,7 +122,7 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin)
 
        old_focused = old_scr->focused_window;
 
-       LastFocusChange = timestamp;
+       w_global.timestamp.focus_change = timestamp;
 
        if (old_focused)
                oapp = wApplicationOf(old_focused->main_window);
diff --git a/src/event.c b/src/event.c
index aa4c92a..a0ed8f6 100644
--- a/src/event.c
+++ b/src/event.c
@@ -84,7 +84,6 @@ extern Cursor wCursor[WCUR_LAST];
 
 extern WShortKey wKeyBindings[WKBD_LAST];
 extern int wScreenCount;
-extern Time LastFocusChange;
 
 #define MOD_MASK wPreferences.modifier_mask
 
diff --git a/src/main.c b/src/main.c
index 1f75e16..b110d7b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -128,9 +128,6 @@ Atom _XA_WM_IGNORE_FOCUS_EVENTS;
 /* cursors */
 Cursor wCursor[WCUR_LAST];
 
-/* timestamp on the last time we did XSetInputFocus() */
-Time LastFocusChange = CurrentTime;
-
 #ifdef SHAPE
 Bool wShapeSupported;
 int wShapeEventBase;
@@ -595,6 +592,7 @@ int main(int argc, char **argv)
        w_global.program.state = WSTATE_NORMAL;
        w_global.program.signal_state = WSTATE_NORMAL;
        w_global.timestamp.last_event = CurrentTime;
+       w_global.timestamp.focus_change = CurrentTime;
 
        /* setup common stuff for the monitor and wmaker itself */
        WMInitializeApplication("WindowMaker", &argc, argv);
-- 
1.8.4.rc3


-- 
To unsubscribe, send mail to [email protected].

Reply via email to