#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>
Rect *area = screen_physical_area_active();
gint gravity, x, y;
- x = config_resize_popup_x;
- if (config_resize_popup_x_center) x = area->x + area->width/2;
- else if (config_resize_popup_x_opposite) x = RECT_RIGHT(*area) - x;
- else x = area->x + x;
+ x = config_resize_popup_fixed.x.pos;
+ if (config_resize_popup_fixed.x.center)
+ x = area->x + area->width/2;
+ else if (config_resize_popup_fixed.x.opposite)
+ x = RECT_RIGHT(*area) - x;
+ else
+ x = area->x + x;
- y = config_resize_popup_y;
- if (config_resize_popup_y_center) y = area->y + area->height/2;
- else if (config_resize_popup_y_opposite) y = RECT_BOTTOM(*area) - y;
- else y = area->y + y;
+ y = config_resize_popup_fixed.y.pos;
+ if (config_resize_popup_fixed.y.center)
+ y = area->y + area->height/2;
+ else if (config_resize_popup_fixed.y.opposite)
+ y = RECT_RIGHT(*area) - y;
+ else
+ y = area->y + y;
- if (config_resize_popup_x_center) {
- if (config_resize_popup_y_center)
+ if (config_resize_popup_fixed.x.center) {
+ if (config_resize_popup_fixed.y.center)
gravity = CenterGravity;
- else if (config_resize_popup_y_opposite)
+ else if (config_resize_popup_fixed.y.opposite)
gravity = SouthGravity;
else
gravity = NorthGravity;
}
- else if (config_resize_popup_x_opposite) {
- if (config_resize_popup_y_center)
+ else if (config_resize_popup_fixed.x.opposite) {
+ if (config_resize_popup_fixed.y.center)
gravity = EastGravity;
- else if (config_resize_popup_y_opposite)
+ else if (config_resize_popup_fixed.y.opposite)
gravity = SouthEastGravity;
else
gravity = NorthEastGravity;
}
else {
- if (config_resize_popup_y_center)
+ if (config_resize_popup_fixed.y.center)
gravity = WestGravity;
- else if (config_resize_popup_y_opposite)
+ else if (config_resize_popup_fixed.y.opposite)
gravity = SouthWestGravity;
else
gravity = NorthWestGravity;
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
/* set the counter to an initial value */
XSyncIntToValue(&val, 0);
- XSyncSetCounter(ob_display, moveresize_client->sync_counter, val);
+ XSyncSetCounter(obt_display, moveresize_client->sync_counter, val);
/* this will be incremented when we tell the client what we're
looking for */
aa.trigger.test_type = XSyncPositiveTransition;
aa.events = True;
XSyncIntToValue(&aa.delta, 1);
- moveresize_alarm = XSyncCreateAlarm(ob_display,
+ moveresize_alarm = XSyncCreateAlarm(obt_display,
XSyncCACounter |
XSyncCAValue |
XSyncCAValueType |
#ifdef SYNC
/* turn off the alarm */
if (moveresize_alarm != None) {
- XSyncDestroyAlarm(ob_display, moveresize_alarm);
+ XSyncDestroyAlarm(obt_display, moveresize_alarm);
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,
}
#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;
/* tell the client what we're waiting for */
ce.xclient.type = ClientMessage;
ce.xclient.message_type = prop_atoms.wm_protocols;
- ce.xclient.display = ob_display;
+ ce.xclient.display = obt_display;
ce.xclient.window = moveresize_client->window;
ce.xclient.format = 32;
ce.xclient.data.l[0] = prop_atoms.net_wm_sync_request;
ce.xclient.data.l[2] = XSyncValueLow32(val);
ce.xclient.data.l[3] = XSyncValueHigh32(val);
ce.xclient.data.l[4] = 0l;
- XSendEvent(ob_display, moveresize_client->window, FALSE,
+ XSendEvent(obt_display, moveresize_client->window, FALSE,
NoEventMask, &ce);
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
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;
}
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)
}
screen_pointer_pos(&opx, &opy);
- XWarpPointer(ob_display, None, None, 0, 0, 0, 0, dx, dy);
+ XWarpPointer(obt_display, None, None, 0, 0, 0, 0, dx, dy);
/* steal the motion events this causes */
- XSync(ob_display, FALSE);
+ XSync(obt_display, FALSE);
{
XEvent ce;
- while (XCheckTypedEvent(ob_display, MotionNotify, &ce));
+ while (XCheckTypedEvent(obt_display, MotionNotify, &ce));
}
screen_pointer_pos(&px, &py);
pdy = dh;
screen_pointer_pos(&opx, &opy);
- XWarpPointer(ob_display, None, None, 0, 0, 0, 0, pdx, pdy);
+ XWarpPointer(obt_display, None, None, 0, 0, 0, 0, pdx, pdy);
/* steal the motion events this causes */
- XSync(ob_display, FALSE);
+ XSync(obt_display, FALSE);
{
XEvent ce;
- while (XCheckTypedEvent(ob_display, MotionNotify, &ce));
+ while (XCheckTypedEvent(obt_display, MotionNotify, &ce));
}
screen_pointer_pos(&px, &py);
}
}
#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 */