]> Dogcows Code - chaz/openbox/blobdiff - otk/display.cc
more deps
[chaz/openbox] / otk / display.cc
index 3720364366341ca383e50a7592a0e0a56a965fc6..77111d3cbb4f5398d5f121ba896c138cc5986053 100644 (file)
 extern "C" {
 #include <X11/keysym.h>
 
+#ifdef    SHAPE
+#include <X11/extensions/shape.h>
+#endif // SHAPE
+
 #ifdef    HAVE_STDIO_H
 #  include <stdio.h>
 #endif // HAVE_STDIO_H
@@ -47,6 +51,7 @@ int  OBDisplay::_xinerama_event_basep = 0;
 unsigned int OBDisplay::_mask_list[8];
 OBDisplay::ScreenInfoList OBDisplay::_screenInfoList;
 BGCCache *OBDisplay::_gccache = (BGCCache*) 0;
+int OBDisplay::_grab_count = 0;
 
 
 int OBDisplay::xerrorHandler(Display *d, XErrorEvent *e)
@@ -54,7 +59,8 @@ int OBDisplay::xerrorHandler(Display *d, XErrorEvent *e)
 #ifdef DEBUG
   char errtxt[128];
 
-  if (e->error_code != BadWindow) {
+  //if (e->error_code != BadWindow)
+  {
     XGetErrorText(d, e->error_code, errtxt, 128);
     printf("X Error: %s\n", errtxt);
   }
@@ -167,6 +173,21 @@ const ScreenInfo* OBDisplay::screenInfo(int snum) {
 }
 
 
+void OBDisplay::grab()
+{
+  if (_grab_count == 0)
+    XGrabServer(display);
+  _grab_count++;
+}
+
+
+void OBDisplay::ungrab()
+{
+  if (_grab_count == 0) return;
+  _grab_count--;
+  if (_grab_count == 0)
+    XUngrabServer(display);
+}
 
 
 
This page took 0.023566 seconds and 4 git commands to generate.