gboolean history = TRUE;
-void place_random(Client *c)
+static void place_random(Client *c)
{
int l, r, t, b;
int x, y;
Rect *area;
+ if (ob_state == State_Starting) return;
+
area = screen_area(c->desktop);
l = area->x;
TRUE, TRUE);
}
-void place_event(ObEvent *e, void *foo)
+static void event(ObEvent *e, void *foo)
{
g_assert(e->type == Event_Client_New);
- if (ob_state == State_Starting) return;
+ /* requested a position */
+ if (e->data.c.client->positioned) return;
if (!place_history(e->data.c.client))
place_random(e->data.c.client);
void plugin_startup()
{
- dispatch_register(Event_Client_New, (EventHandler)place_event, NULL);
+ dispatch_register(Event_Client_New, (EventHandler)event, NULL);
history_startup();
}
void plugin_shutdown()
{
- dispatch_register(0, (EventHandler)place_event, NULL);
+ dispatch_register(0, (EventHandler)event, NULL);
history_shutdown();
}