X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=otk%2Fdisplay.cc;h=98288bd02dcdf54990437673a55fb1e9d14264f4;hb=7d3b12d931ed48d3577b92ba3c246e76f7a881e7;hp=32674be9736787564ebb6799f33976a325741aca;hpb=a2de94e91e1c0e7775c97745ae11d14e5c5f5659;p=chaz%2Fopenbox diff --git a/otk/display.cc b/otk/display.cc index 32674be9..98288bd0 100644 --- a/otk/display.cc +++ b/otk/display.cc @@ -7,22 +7,27 @@ #include "display.hh" #include "screeninfo.hh" #include "gccache.hh" +#include "util.hh" extern "C" { #include +#ifdef XKB +#include +#endif // XKB + #ifdef SHAPE #include #endif // SHAPE +#ifdef XINERAMA +#include +#endif // XINERAMA + #ifdef HAVE_STDIO_H # include #endif // HAVE_STDIO_H -#ifdef HAVE_STDLIB_H -# include -#endif // HAVE_STDLIB_H - #ifdef HAVE_SIGNAL_H # include #endif // HAVE_SIGNAL_H @@ -44,6 +49,8 @@ namespace otk { Display *OBDisplay::display = (Display*) 0; +bool OBDisplay::_xkb = false; +int OBDisplay::_xkb_event_basep = 0; bool OBDisplay::_shape = false; int OBDisplay::_shape_event_basep = 0; bool OBDisplay::_xinerama = false; @@ -65,8 +72,8 @@ int OBDisplay::xerrorHandler(Display *d, XErrorEvent *e) { XGetErrorText(d, e->error_code, errtxt, 128); printf("X Error: %s\n", errtxt); -// if (e->error_code != BadWindow) -// abort(); + if (e->error_code != BadWindow) + abort(); } #else (void)d; @@ -100,13 +107,14 @@ line argument.\n\n")); // set the DISPLAY environment variable for any lauched children, to the // display we're using, so they open in the right place. // XXX rm -> std::string dtmp = "DISPLAY=" + DisplayString(display); - if (putenv(const_cast((std::string("DISPLAY=") + - DisplayString(display)).c_str()))) { - printf(_("warning: couldn't set environment variable 'DISPLAY'\n")); - perror("putenv()"); - } + putenv(std::string("DISPLAY=") + DisplayString(display)); // find the availability of X extensions we like to use +#ifdef XKB + _xkb = XkbQueryExtension(display, &junk, &_xkb_event_basep, &junk, NULL, + NULL); +#endif + #ifdef SHAPE _shape = XShapeQueryExtension(display, &_shape_event_basep, &junk); #endif