X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=plugins%2Fplacement%2Fplacement.c;h=2627eb84358fd27fea6a808ddf22184cb970b168;hb=94f2b4a7b8b62ed031fe96da4d24b2d5dbb4aded;hp=58c29a480039fc4d3469dd67a1ab29475832766f;hpb=6216c4be175789be73a1d5551ce594f73b3f2061;p=chaz%2Fopenbox diff --git a/plugins/placement/placement.c b/plugins/placement/placement.c index 58c29a48..2627eb84 100644 --- a/plugins/placement/placement.c +++ b/plugins/placement/placement.c @@ -8,12 +8,14 @@ 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; @@ -31,11 +33,12 @@ void place_random(Client *c) 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); @@ -43,7 +46,7 @@ void place_event(ObEvent *e, void *foo) void plugin_startup() { - dispatch_register(Event_Client_New, (EventHandler)place_event, NULL); + dispatch_register(Event_Client_New, (EventHandler)event, NULL); history_startup(); }