focus_order_add_new(self);
/* focus the new window? */
- if (ob_state != State_Starting && config_focus_new &&
+ if (ob_state != OB_STATE_STARTING && config_focus_new &&
(self->type == Type_Normal || self->type == Type_Dialog)) {
gboolean group_foc = FALSE;
frame_release_client(self->frame, self);
self->frame = NULL;
- if (ob_state != State_Exiting) {
+ if (ob_state != OB_STATE_EXITING) {
/* these values should not be persisted across a window
unmapping/mapping */
prop_erase(self->window, prop_atoms.net_wm_desktop);
frame_frame_gravity(self->frame, &x, &y); /* get where the client
should be */
- client_configure(self , Corner_TopLeft, x, y,
+ client_configure(self, OB_CORNER_TOPLEFT, x, y,
self->area.width, self->area.height,
TRUE, TRUE);
}
/* by making this pass FALSE for user, we avoid the emacs event storm where
every configurenotify causes an update in its normal hints, i think this
is generally what we want anyways... */
- client_configure(self, Corner_TopLeft, self->area.x, self->area.y,
+ client_configure(self, OB_CORNER_TOPLEFT, self->area.x, self->area.y,
self->area.width, self->area.height, FALSE, TRUE);
}
/* only do this when first managing the window *AND* when we aren't
starting up! */
- if (ob_state != State_Starting && self->frame == NULL)
+ if (ob_state != OB_STATE_STARTING && self->frame == NULL)
if (hints->flags & StateHint)
self->iconic = hints->initial_state == IconicState;
*/
}
-void client_configure(Client *self, Corner anchor, int x, int y, int w, int h,
+void client_configure(Client *self, ObCorner anchor,
+ int x, int y, int w, int h,
gboolean user, gboolean final)
{
gboolean moved = FALSE, resized = FALSE;
Rect *a;
guint i;
- i = client_xinerama_area(self);
- a = screen_physical_area_xinerama(i);
+ i = client_monitor(self);
+ a = screen_physical_area_monitor(i);
#ifdef VIDMODE
if (i == 0 && /* primary head */
} else {
Rect *a;
- a = screen_area_xinerama(self->desktop, client_xinerama_area(self));
+ a = screen_area_monitor(self->desktop, client_monitor(self));
/* set the size and position if maximized */
if (self->max_horz) {
}
switch (anchor) {
- case Corner_TopLeft:
+ case OB_CORNER_TOPLEFT:
break;
- case Corner_TopRight:
+ case OB_CORNER_TOPRIGHT:
x -= w - self->area.width;
break;
- case Corner_BottomLeft:
+ case OB_CORNER_BOTTOMLEFT:
y -= h - self->area.height;
break;
- case Corner_BottomRight:
+ case OB_CORNER_BOTTOMRIGHT:
x -= w - self->area.width;
y -= h - self->area.height;
break;
Rect *a;
/* pick some fallbacks... */
- a = screen_area_xinerama(self->desktop, 0);
+ a = screen_area_monitor(self->desktop, 0);
x = a->x + a->width / 4;
y = a->y + a->height / 4;
w = a->width / 2;
client_setup_decor_and_functions(self);
- client_configure(self, Corner_TopLeft, x, y, w, h, TRUE, TRUE);
+ client_configure(self, OB_CORNER_TOPLEFT, x, y, w, h, TRUE, TRUE);
/* try focus us when we go into fullscreen mode */
client_focus(self);
Rect *a;
/* pick some fallbacks... */
- a = screen_area_xinerama(self->desktop, 0);
+ a = screen_area_monitor(self->desktop, 0);
if (dir == 0 || dir == 1) { /* horz */
x = a->x + a->width / 4;
w = a->width / 2;
/* figure out where the client should be going */
frame_frame_gravity(self->frame, &x, &y);
- client_configure(self, Corner_TopLeft, x, y, w, h, TRUE, TRUE);
+ client_configure(self, OB_CORNER_TOPLEFT, x, y, w, h, TRUE, TRUE);
}
void client_shade(Client *self, gboolean shade)
}
/* this be mostly ripped from fvwm */
-Client *client_find_directional(Client *c, Direction dir)
+Client *client_find_directional(Client *c, ObDirection dir)
{
int my_cx, my_cy, his_cx, his_cy;
int offset = 0;
}
switch(dir) {
- case Direction_North :
- case Direction_South :
- case Direction_NorthEast :
- case Direction_SouthWest :
+ case OB_DIRECTION_NORTH:
+ case OB_DIRECTION_SOUTH:
+ case OB_DIRECTION_NORTHEAST:
+ case OB_DIRECTION_SOUTHWEST:
offset = (his_cx < 0) ? -his_cx : his_cx;
- distance = (dir == Direction_North || dir == Direction_NorthEast) ?
- -his_cy : his_cy;
+ distance = ((dir == OB_DIRECTION_NORTH ||
+ dir == OB_DIRECTION_NORTHEAST) ?
+ -his_cy : his_cy);
break;
- case Direction_East :
- case Direction_West :
- case Direction_SouthEast :
- case Direction_NorthWest :
+ case OB_DIRECTION_EAST:
+ case OB_DIRECTION_WEST:
+ case OB_DIRECTION_SOUTHEAST:
+ case OB_DIRECTION_NORTHWEST:
offset = (his_cy < 0) ? -his_cy : his_cy;
- distance = (dir == Direction_West || dir == Direction_NorthWest) ?
- -his_cx : his_cx;
+ distance = ((dir == OB_DIRECTION_WEST ||
+ dir == OB_DIRECTION_NORTHWEST) ?
+ -his_cx : his_cx);
break;
}
client_change_state(self); /* reflect this in the state hints */
}
-guint client_xinerama_area(Client *self)
+guint client_monitor(Client *self)
{
guint i;
- for (i = 0; i < screen_num_xin_areas; ++i) {
- Rect *area = screen_physical_area_xinerama(i);
+ for (i = 0; i < screen_num_monitors; ++i) {
+ Rect *area = screen_physical_area_monitor(i);
if (RECT_INTERSECTS_RECT(*area, self->frame->area))
break;
}
- if (i == screen_num_xin_areas) i = 0;
- g_assert(i < screen_num_xin_areas);
+ if (i == screen_num_monitors) i = 0;
+ g_assert(i < screen_num_monitors);
return i;
}