1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

wmaker: Moved timestamp variable (#2) to the global variable structure

This commit is contained in:
Christophe CURIS
2013-09-29 13:22:53 +02:00
committed by Carlos R. Mafra
parent af6c4ec37f
commit 2c20413831
4 changed files with 6 additions and 7 deletions

View File

@@ -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;

View File

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

View File

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

View File

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