diff options
author | Tim Wiederhake <twied@gmx.net> | 2024-01-20 16:07:00 +0100 |
---|---|---|
committer | Tim Wiederhake <twied@gmx.net> | 2024-01-20 16:07:00 +0100 |
commit | cf9a35db8381f9b809465306aec3bcfe3bc1dc0d (patch) | |
tree | f41f5a0eb446920daf5cc1bab4f1d54626727493 | |
parent | d812d0884c926be4088a4e636807509e05d77a5f (diff) |
Make appContext a local variable
Signed-off-by: Tim Wiederhake <twied@gmx.net>
-rw-r--r-- | src/events.c | 2 | ||||
-rw-r--r-- | src/events.h | 2 | ||||
-rw-r--r-- | src/session.c | 2 | ||||
-rw-r--r-- | src/session.h | 2 | ||||
-rw-r--r-- | src/twm.c | 6 | ||||
-rw-r--r-- | src/twm.h | 1 |
6 files changed, 7 insertions, 8 deletions
diff --git a/src/events.c b/src/events.c index 299ad56..a8c8fec 100644 --- a/src/events.c +++ b/src/events.c @@ -344,7 +344,7 @@ DispatchEvent(void) * handle X events */ void -HandleEvents(void) +HandleEvents(XtAppContext appContext) { while (TRUE) { if (enter_flag && !QLength(dpy)) { diff --git a/src/events.h b/src/events.h index cbe2d2d..8e3b806 100644 --- a/src/events.h +++ b/src/events.h @@ -76,7 +76,7 @@ extern Bool StashEventTime(XEvent *ev); extern Window WindowOfEvent(XEvent *e); extern Bool DispatchEvent2(void); extern Bool DispatchEvent(void); -extern void HandleEvents(void) _X_NORETURN; +extern void HandleEvents(XtAppContext) _X_NORETURN; extern void HandleColormapNotify(void); extern void HandleVisibilityNotify(void); extern void HandleKeyPress(void); diff --git a/src/session.c b/src/session.c index 94b4d63..2c2787a 100644 --- a/src/session.c +++ b/src/session.c @@ -878,7 +878,7 @@ ProcessIceMsgProc(XtPointer client_data, int *source _X_UNUSED, } void -ConnectToSessionManager(char *previous_id) +ConnectToSessionManager(char *previous_id, XtAppContext appContext) { char errorMsg[256]; unsigned long mask; diff --git a/src/session.h b/src/session.h index a76c52f..df91469 100644 --- a/src/session.h +++ b/src/session.h @@ -30,7 +30,7 @@ #include <X11/SM/SMlib.h> -extern void ConnectToSessionManager(char *previous_id); +extern void ConnectToSessionManager(char *previous_id, XtAppContext appContext); extern int GetWindowConfig(TwmWindow *theWindow, short *x, short *y, unsigned short *width, unsigned short *height, Bool *iconified, Bool *icon_info_present, @@ -90,7 +90,6 @@ in this Software without prior written authorization from The Open Group. static void InitVariables(void); -XtAppContext appContext; /* Xt application context */ XtSignalId si; Display *dpy = NULL; /* which display are we talking to */ @@ -219,6 +218,7 @@ main(int argc, char *argv[]) char *loc; int MultiScreen = TRUE; /* try for more than one screen? */ char *InitFile = NULL; + XtAppContext appContext; /* Xt application context */ ProgramName = argv[0]; Argc = argc; @@ -645,12 +645,12 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - (void) ConnectToSessionManager(client_id); + (void) ConnectToSessionManager(client_id, appContext); RestartPreviousState = False; HandlingEvents = TRUE; InitEvents(); - HandleEvents(); + HandleEvents(appContext); exit(EXIT_SUCCESS); } @@ -343,7 +343,6 @@ extern void ComputeWindowTitleOffsets(TwmWindow *tmp_win, int width, Bool squeeze); extern char *ProgramName; extern Display *dpy; -extern XtAppContext appContext; extern Window ResizeWindow; /* the window we are resizing */ extern int HasShape; /* this server supports Shape extension */ extern int HasSync; /* this server supports SYNC extension */ |