focus_order_add_new(self);
/* focus the new window? */
- if (ob_state != OB_STATE_STARTING && config_focus_new &&
+ if (ob_state() != OB_STATE_STARTING && config_focus_new &&
(self->type == OB_CLIENT_TYPE_NORMAL || self->type == OB_CLIENT_TYPE_DIALOG)) {
gboolean group_foc = FALSE;
frame_release_client(self->frame, self);
self->frame = NULL;
- if (ob_state != OB_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);
/* only do this when first managing the window *AND* when we aren't
starting up! */
- if (ob_state != OB_STATE_STARTING && self->frame == NULL)
+ if (ob_state() != OB_STATE_STARTING && self->frame == NULL)
if (hints->flags & StateHint)
self->iconic = hints->initial_state == IconicState;
member set the root window, and one set to the client, but both get
handled and need to be ignored.
*/
- if (ob_state == OB_STATE_STARTING)
+ if (ob_state() == OB_STATE_STARTING)
app->ignore_unmaps += 2;
if (app->win != app->icon_win) {
break;
case EnterNotify:
if (client_normal(client)) {
- if (ob_state == OB_STATE_STARTING) {
+ if (ob_state() == OB_STATE_STARTING) {
/* move it to the top of the focus order */
guint desktop = client->desktop;
if (desktop == DESKTOP_ALL) desktop = screen_desktop;
push_to_top(client);
/* set the NET_ACTIVE_WINDOW hint, but preserve it on shutdown */
- if (ob_state != OB_STATE_EXITING) {
+ if (ob_state() != OB_STATE_EXITING) {
active = client ? client->window : None;
PROP_SET32(RootWindow(ob_display, ob_screen),
net_active_window, window, active);
member set the root window, and one set to the client, but both get
handled and need to be ignored.
*/
- if (ob_state == OB_STATE_STARTING)
+ if (ob_state() == OB_STATE_STARTING)
client->ignore_unmaps += 2;
/* select the event mask on the client's parent (to receive config/map
RrTheme *ob_rr_theme;
Display *ob_display;
gint ob_screen;
-ObState ob_state;
Cursor ob_cursors[OB_NUM_CURSORS];
KeyCode ob_keys[OB_NUM_KEYS];
+static ObState state;
static gboolean sync;
static gboolean shutdown;
static gboolean restart;
xmlDocPtr doc;
xmlNodePtr node;
- ob_state = OB_STATE_STARTING;
+ state = OB_STATE_STARTING;
/* initialize the locale */
if (!setlocale(LC_ALL, ""))
/* get all the existing windows */
client_manage_all();
- ob_state = OB_STATE_RUNNING;
+ state = OB_STATE_RUNNING;
while (!shutdown)
event_loop();
- ob_state = OB_STATE_EXITING;
+ state = OB_STATE_EXITING;
dock_remove_all();
client_unmanage_all();
g_assert(key < OB_NUM_KEYS);
return ob_keys[key];
}
+
+ObState ob_state()
+{
+ return state;
+}
extern gint ob_screen;
/* The state of execution of the window manager */
-extern ObState ob_state;
+ObState ob_state();
void ob_restart_other(const gchar *path);
void ob_restart();
PROP_SETA32(RootWindow(ob_display, ob_screen),
net_desktop_geometry, cardinal, geometry, 2);
- if (ob_state == OB_STATE_STARTING)
+ if (ob_state() == OB_STATE_STARTING)
return;
dock_configure();
/* on shutdown, don't update the properties, so that we can read it back
in on startup and re-stack the windows as they were before we shut down
*/
- if (ob_state == OB_STATE_EXITING) return;
+ if (ob_state() == OB_STATE_EXITING) return;
/* create an array of the window ids (from bottom to top,
reverse order!) */
if (hi && !(hi->flags & PLACED)) {
hi->flags |= PLACED;
- if (ob_state != OB_STATE_STARTING) {
+ if (ob_state() != OB_STATE_STARTING) {
if (hi->flags & HAVE_POSITION ||
hi->flags & HAVE_SIZE) {
if (hi->flags & HAVE_POSITION) {
int x, y;
Rect *area;
- if (ob_state == OB_STATE_STARTING) return;
+ if (ob_state() == OB_STATE_STARTING) return;
area = screen_area_monitor(c->desktop,
g_random_int_range(0, screen_num_monitors));