Merge branch 'backport' into work
[dana/openbox.git] / openbox / mouse.c
index 857f6d0..cd8490f 100644 (file)
 
 #include "openbox.h"
 #include "config.h"
-#include "xerror.h"
 #include "actions.h"
 #include "event.h"
 #include "client.h"
-#include "prop.h"
 #include "grab.h"
 #include "frame.h"
 #include "translate.h"
 #include "mouse.h"
 #include "gettext.h"
+#include "obt/display.h"
 
 #include <glib.h>
 
@@ -38,12 +37,6 @@ typedef struct {
     GSList *actions[OB_NUM_MOUSE_ACTIONS]; /* lists of Action pointers */
 } ObMouseBinding;
 
-#define FRAME_CONTEXT(co, cl) ((cl && cl->type != OB_CLIENT_TYPE_DESKTOP) ? \
-                               co == OB_FRAME_CONTEXT_FRAME : FALSE)
-#define CLIENT_CONTEXT(co, cl) ((cl && cl->type == OB_CLIENT_TYPE_DESKTOP) ? \
-                                co == OB_FRAME_CONTEXT_DESKTOP : \
-                                co == OB_FRAME_CONTEXT_CLIENT)
-
 /* Array of GSList*s of ObMouseBinding*s. */
 static GSList *bound_contexts[OB_FRAME_NUM_CONTEXTS];
 /* TRUE when we have a grab on the pointer and need to replay the pointer event
@@ -203,11 +196,11 @@ static gboolean fire_binding(ObMouseAction a, ObFrameContext context,
     return TRUE;
 }
 
-void mouse_replay_pointer()
+void mouse_replay_pointer(void)
 {
     if (replay_pointer_needed) {
         /* replay the pointer event before any windows move */
-        XAllowEvents(ob_display, ReplayPointer, event_curtime);
+        XAllowEvents(obt_display, ReplayPointer, event_curtime);
         replay_pointer_needed = FALSE;
     }
 }
@@ -287,10 +280,10 @@ void mouse_event(ObClient *client, XEvent *e)
             Window wjunk;
             guint ujunk, b, w, h;
             /* this can cause errors to occur when the window closes */
-            xerror_set_ignore(TRUE);
-            junk1 = XGetGeometry(ob_display, e->xbutton.window,
+            obt_display_ignore_errors(TRUE);
+            junk1 = XGetGeometry(obt_display, e->xbutton.window,
                                  &wjunk, &junk1, &junk2, &w, &h, &b, &ujunk);
-            xerror_set_ignore(FALSE);
+            obt_display_ignore_errors(FALSE);
             if (junk1) {
                 if (e->xbutton.x >= (signed)-b &&
                     e->xbutton.y >= (signed)-b &&