move the code for tracking what extensions are available on the display into the...
[dana/openbox.git] / openbox / moveresize.c
index 8dc122c..ed70899 100644 (file)
 #include "frame.h"
 #include "openbox.h"
 #include "resist.h"
-#include "mainloop.h"
 #include "modkeys.h"
 #include "popup.h"
 #include "moveresize.h"
 #include "config.h"
 #include "event.h"
 #include "debug.h"
-#include "extensions.h"
 #include "render/render.h"
 #include "render/theme.h"
+#include "obt/display.h"
 
 #include <X11/Xlib.h>
 #include <glib.h>
@@ -126,7 +125,7 @@ static void popup_coords(ObClient *c, const gchar *format, gint a, gint b)
 
         y = config_resize_popup_fixed.y.pos;
         if (config_resize_popup_fixed.y.center)
-            y = area->y + area->width/2;
+            y = area->y + area->height/2;
         else if (config_resize_popup_fixed.y.opposite)
             y = RECT_RIGHT(*area) - y;
         else
@@ -251,7 +250,7 @@ void moveresize_start(ObClient *c, gint x, gint y, guint b, guint32 cnr)
     moveresize_in_progress = TRUE;
 
 #ifdef SYNC
-    if (config_resize_redraw && !moving && extensions_sync &&
+    if (config_resize_redraw && !moving && obt_display_extension_sync &&
         moveresize_client->sync_request && moveresize_client->sync_counter)
     {
         /* Initialize values for the resize syncing, and create an alarm for
@@ -311,7 +310,7 @@ void moveresize_end(gboolean cancel)
             moveresize_alarm = None;
         }
 
-        ob_main_loop_timeout_remove(ob_main_loop, sync_timeout_func);
+        obt_main_loop_timeout_remove(ob_main_loop, sync_timeout_func);
 #endif
 
         client_configure(moveresize_client,
@@ -366,7 +365,7 @@ static void do_resize(void)
     }
 
 #ifdef SYNC
-    if (config_resize_redraw && extensions_sync &&
+    if (config_resize_redraw && obt_display_extension_sync &&
         moveresize_client->sync_request && moveresize_client->sync_counter)
     {
         XEvent ce;
@@ -396,10 +395,10 @@ static void do_resize(void)
 
         waiting_for_sync = TRUE;
 
-        ob_main_loop_timeout_remove(ob_main_loop, sync_timeout_func);
-        ob_main_loop_timeout_add(ob_main_loop, G_USEC_PER_SEC * 2,
-                                 sync_timeout_func,
-                                 NULL, NULL, NULL);
+        obt_main_loop_timeout_remove(ob_main_loop, sync_timeout_func);
+        obt_main_loop_timeout_add(ob_main_loop, G_USEC_PER_SEC * 2,
+                                  sync_timeout_func,
+                                  NULL, NULL, NULL);
     }
 #endif
 
@@ -578,10 +577,10 @@ static void do_edge_warp(gint x, gint y)
         cancel_edge_warp();
         if (dir != (ObDirection)-1) {
             edge_warp_odd = TRUE; /* switch on the first timeout */
-            ob_main_loop_timeout_add(ob_main_loop,
-                                     config_mouse_screenedgetime * 1000,
-                                     edge_warp_delay_func,
-                                     NULL, NULL, NULL);
+            obt_main_loop_timeout_add(ob_main_loop,
+                                      config_mouse_screenedgetime * 1000,
+                                      edge_warp_delay_func,
+                                      NULL, NULL, NULL);
         }
         edge_warp_dir = dir;
     }
@@ -589,7 +588,7 @@ static void do_edge_warp(gint x, gint y)
 
 static void cancel_edge_warp(void)
 {
-    ob_main_loop_timeout_remove(ob_main_loop, edge_warp_delay_func);
+    obt_main_loop_timeout_remove(ob_main_loop, edge_warp_delay_func);
 }
 
 static void move_with_keys(gint keycode, gint state)
@@ -924,7 +923,7 @@ gboolean moveresize_event(XEvent *e)
         }
     }
 #ifdef SYNC
-    else if (e->type == extensions_sync_event_basep + XSyncAlarmNotify)
+    else if (e->type == obt_display_extension_sync_basep + XSyncAlarmNotify)
     {
         waiting_for_sync = FALSE; /* we got our sync... */
         do_resize(); /* ...so try resize if there is more change pending */