Move some event initialisation to events.c.

SVN revision: 8931
This commit is contained in:
Kim Woelders 2004-02-10 18:29:46 +00:00
parent 65c0c8ef4f
commit cb7ba13e28
4 changed files with 47 additions and 37 deletions

View File

@ -1683,6 +1683,7 @@ void PasteMask(Display * d, Drawable w, Pixmap p, int x, int y,
int wd, int ht);
/* events.c */
void EventsInit(void);
void CheckEvent(void);
void WaitEvent(void);
void EventDebugInit(const char *s);
@ -2715,7 +2716,6 @@ extern Imlib_Context *prImlib_Context;
extern FnlibData *pFnlibData;
#endif
extern List *lists;
extern int event_base_shape;
extern Root root;
extern EConf conf;
extern EMode mode;

View File

@ -33,6 +33,8 @@
static int EventDebug(unsigned int type);
#endif
static int event_base_shape = 0;
char throw_move_events_away = 0;
static char diddeskaccount = 1;
@ -51,6 +53,46 @@ DeskAccountTimeout(int val, void *data)
EDBUG_RETURN_;
}
void
EventsInit(void)
{
int shape_event_base, shape_error_base;
/* Check for the Shape Extension */
if (!XShapeQueryExtension(disp, &shape_event_base, &shape_error_base))
{
ASSIGN_ALERT(_("X server setup error"), "", "",
_("Quit Enlightenment"));
Alert(_
("FATAL ERROR:\n" "\n"
"This Xserver does not support the Shape extension.\n"
"This is required for Enlightenment to run.\n" "\n"
"Your Xserver probably is too old or mis-configured.\n" "\n"
"Exiting.\n"));
RESET_ALERT;
EExit((void *)1);
}
event_base_shape = shape_event_base;
/* check for the XTEST extension */
/*
* if (XTestQueryExtension(disp, &test_event_base, &test_error_base, &test_v1, &test_v2))
* {
* XTestGrabControl(disp, True);
* }
* else
* Alert("WARNING:\n"
* "This Xserver does not support the XTest extension.\n"
* "This is required for Enlightenment to run properly.\n"
* "Enlightenment will continue to run, but parts may not.\n"
* "Work correctly.\n"
* "Please contact your system administrator, or see the manuals\n"
* "For your XServer to find out how to enable the XTest\n"
* "Extension\n");
*/
/* record the event base for shape change events */
}
char *
NukeBoringevents(XEvent * ev, int num)
{

View File

@ -47,7 +47,6 @@ FnlibData *pFnlibData;
#endif
List *lists;
Root root;
int event_base_shape;
EConf conf;
EMode mode;
Desktops desks;

View File

@ -112,11 +112,8 @@ MapUnmap(int start)
void
SetupX()
{
/* This function sets up all of our connections to X */
int shape_event_base, shape_error_base;
EDBUG(6, "SetupX");
/* In case we are going to fork, set up the master pid */
@ -195,42 +192,14 @@ SetupX()
}
}
}
/* set up an error handler for then E would normally have fatal X errors */
XSetErrorHandler((XErrorHandler) EHandleXError);
/* set up a handler for when the X Connection goes down */
XSetIOErrorHandler((XIOErrorHandler) HandleXIOError);
/* Check for the Shape Extension */
if (!XShapeQueryExtension(disp, &shape_event_base, &shape_error_base))
{
ASSIGN_ALERT(_("X server setup error"), "", "",
_("Quit Enlightenment"));
Alert(_
("FATAL ERROR:\n" "\n"
"This Xserver does not support the Shape extension.\n"
"This is required for Enlightenment to run.\n" "\n"
"Your Xserver probably is too old or mis-configured.\n" "\n"
"Exiting.\n"));
RESET_ALERT;
EExit((void *)1);
}
/* check for the XTEST extension */
/*
* if (XTestQueryExtension(disp, &test_event_base, &test_error_base, &test_v1, &test_v2))
* {
* XTestGrabControl(disp, True);
* }
* else
* Alert("WARNING:\n"
* "This Xserver does not support the XTest extension.\n"
* "This is required for Enlightenment to run properly.\n"
* "Enlightenment will continue to run, but parts may not.\n"
* "Work correctly.\n"
* "Please contact your system administrator, or see the manuals\n"
* "For your XServer to find out how to enable the XTest\n"
* "Extension\n");
*/
/* record the event base for shape change events */
event_base_shape = shape_event_base;
/* initialise event handling */
EventsInit();
/* initialise imlib */
#if USE_IMLIB2