X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=plugins%2Ffocus.c;h=17ab20ef40915d974991698043ec7c07bab191f6;hb=ac735b647c9915a40fc3c44a04f7f5f7cacb4278;hp=db0a2b33c6621f03d290e146395c1c11eccf29e4;hpb=b52ec93251508461fca8e3d2604a704d0a1e4285;p=chaz%2Fopenbox diff --git a/plugins/focus.c b/plugins/focus.c index db0a2b33..17ab20ef 100644 --- a/plugins/focus.c +++ b/plugins/focus.c @@ -19,7 +19,7 @@ void plugin_setup_config() config_set("focus.followMouse", Config_Bool, val); config_def_set(config_def_new("focus.focusNew", Config_Bool, "Focus New Windows", - "Focus windows when they first appear ")); + "Focus windows when they first appear.")); val.bool = TRUE; config_set("focus.focusNew", Config_Bool, val); /* @@ -118,14 +118,14 @@ static void focus_desktop() static void event(ObEvent *e, void *foo) { ConfigValue follow_mouse, focus_new; - gboolean r; - r = config_get("focus.followMouse", Config_Bool, &follow_mouse); - g_assert(r); + if (!config_get("focus.followMouse", Config_Bool, &follow_mouse)) + g_assert_not_reached(); switch (e->type) { case Event_Client_Mapped: - r = config_get("focus.focusNew", Config_Bool, &focus_new); + if (!config_get("focus.focusNew", Config_Bool, &focus_new)) + g_assert_not_reached(); if (focus_new.bool && client_normal(e->data.c.client)) client_focus(e->data.c.client); break; @@ -166,8 +166,9 @@ static void event(ObEvent *e, void *foo) --skip_enter; } else*/ - if (e->data.x.client != NULL && client_normal(e->data.x.client)) - client_focus(e->data.x.client); + if (follow_mouse.bool) + if (e->data.x.client != NULL && client_normal(e->data.x.client)) + client_focus(e->data.x.client); break; default: