X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=plugins%2Fresistance.c;h=24e291a049b8d70becaef1581670f2d5da0763d2;hb=6b79b47f232445b428d415faf47008631b822168;hp=e60b683ea5aaf542f68cf00d96296b6547dae982;hpb=34ab5a1fb88f910d1a2d4e5f40859edcf035150b;p=chaz%2Fopenbox diff --git a/plugins/resistance.c b/plugins/resistance.c index e60b683e..24e291a0 100644 --- a/plugins/resistance.c +++ b/plugins/resistance.c @@ -5,8 +5,11 @@ #include "../kernel/screen.h" #include +void plugin_setup_config() +{ +} + static int resistance = 10; -static gboolean edge_resistance = TRUE; /* window-to-edge */ static gboolean window_resistance = TRUE; /* window-to-window */ static void resist(Client *c, int *x, int *y) @@ -19,8 +22,6 @@ static void resist(Client *c, int *x, int *y) int w, h; /* current size */ gboolean snapx = FALSE, snapy = FALSE; - if (!edge_resistance) return; - w = c->frame->area.width; h = c->frame->area.height; @@ -41,6 +42,8 @@ static void resist(Client *c, int *x, int *y) int tl, tt, tr, tb; /* 1 past the target's edges on each side */ target = it->data; + /* don't snap to self or non-visibles */ + if (!target->frame->visible || target == c) continue; tl = target->frame->area.x - 1; tt = target->frame->area.y - 1;