]> Dogcows Code - chaz/openbox/blobdiff - otk/display.cc
dont build the otk wrappers for now
[chaz/openbox] / otk / display.cc
index 3a15ff22ecb16b05a30fee590047b359ce108759..5bd282e6c66a5f434394f81bf5e46f6b7cb79473 100644 (file)
 extern "C" {
 #include <X11/keysym.h>
 
+#ifdef    XKB
+#include <X11/XKBlib.h>
+#endif // XKB
+
 #ifdef    SHAPE
 #include <X11/extensions/shape.h>
 #endif // SHAPE
@@ -44,6 +48,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,6 +71,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();
   }
 #else
   (void)d;
@@ -105,6 +113,11 @@ line argument.\n\n"));
   }
   
   // 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
@@ -176,6 +189,16 @@ const ScreenInfo* OBDisplay::screenInfo(int snum) {
 }
 
 
+const ScreenInfo* OBDisplay::findScreen(Window root)
+{
+  ScreenInfoList::iterator it, end = _screenInfoList.end();
+  for (it = _screenInfoList.begin(); it != end; ++it)
+    if (it->rootWindow() == root)
+      return &(*it);
+  return 0;
+}
+
+
 void OBDisplay::grab()
 {
   if (_grab_count == 0)
This page took 0.021288 seconds and 4 git commands to generate.