From 811fa21940629236eb15345b4034bcc278bf7ba9 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 12 May 2007 18:56:56 +0000 Subject: [PATCH] remove the edges_hit_layers_below option. don't use windows in other layers for resistance --- data/rc.xml | 1 - data/rc.xsd | 1 - openbox/client.c | 2 +- openbox/config.c | 4 ---- openbox/config.h | 2 -- openbox/resist.c | 14 ++++++-------- 6 files changed, 7 insertions(+), 17 deletions(-) diff --git a/data/rc.xml b/data/rc.xml index 9c6f6425..52ca0e4b 100644 --- a/data/rc.xml +++ b/data/rc.xml @@ -10,7 +10,6 @@ 10 20 - no diff --git a/data/rc.xsd b/data/rc.xsd index 71ab68c8..2d4059f0 100644 --- a/data/rc.xsd +++ b/data/rc.xsd @@ -36,7 +36,6 @@ - diff --git a/openbox/client.c b/openbox/client.c index ffac20d8..8428be6b 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -3710,7 +3710,7 @@ ObClient *client_search_transient(ObClient *self, ObClient *search) continue; \ if(cur->iconic) \ continue; \ - if(cur->layer < c->layer && !config_resist_layers_below) \ + if(cur->layer == c->layer) \ continue; #define HIT_EDGE(my_edge_start, my_edge_end, his_edge_start, his_edge_end) \ diff --git a/openbox/config.c b/openbox/config.c index c4fed63d..6a45005d 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -87,7 +87,6 @@ GSList *config_menu_files; gint config_resist_win; gint config_resist_edge; -gboolean config_resist_layers_below; GSList *config_per_app_settings; @@ -705,8 +704,6 @@ static void parse_resistance(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, config_resist_win = parse_int(doc, n); if ((n = parse_find_node("screen_edge_strength", node))) config_resist_edge = parse_int(doc, n); - if ((n = parse_find_node("edges_hit_layers_below", node))) - config_resist_layers_below = parse_bool(doc, n); } typedef struct @@ -882,7 +879,6 @@ void config_startup(ObParseInst *i) config_resist_win = 10; config_resist_edge = 20; - config_resist_layers_below = FALSE; parse_register(i, "resistance", parse_resistance, NULL); diff --git a/openbox/config.h b/openbox/config.h index 94991a60..6a0ee33c 100644 --- a/openbox/config.h +++ b/openbox/config.h @@ -149,8 +149,6 @@ extern gint config_mouse_dclicktime; extern gint config_resist_win; /*! Number of pixels to resist while crossing a screen's edge */ extern gint config_resist_edge; -/*! Should windows resist edges at layers below */ -extern gboolean config_resist_layers_below; /*! Warp near edge on menu? */ extern gboolean config_menu_warppointer; diff --git a/openbox/resist.c b/openbox/resist.c index 729f83fc..56bd214d 100644 --- a/openbox/resist.c +++ b/openbox/resist.c @@ -57,15 +57,14 @@ void resist_move_windows(ObClient *c, gint resist, gint *x, gint *y) if (!WINDOW_IS_CLIENT(it->data)) continue; + /* only snap in the same layer */ + if (window_layer(it->data) != c->layer) + continue; target = it->data; /* don't snap to self or non-visibles */ if (!target->frame->visible || target == c) continue; - /* don't snap to windows in layers beneath */ - if(target->layer < c->layer && !config_resist_layers_below) - continue; - tl = RECT_LEFT(target->frame->area) - 1; tt = RECT_TOP(target->frame->area) - 1; tr = RECT_RIGHT(target->frame->area) + 1; @@ -207,15 +206,14 @@ void resist_size_windows(ObClient *c, gint resist, gint *w, gint *h, for (it = stacking_list; it; it = g_list_next(it)) { if (!WINDOW_IS_CLIENT(it->data)) continue; + /* only snap in the same layer */ + if (window_layer(it->data) != c->layer) + continue; target = it->data; /* don't snap to invisibles or ourself */ if (!target->frame->visible || target == c) continue; - /* don't snap to windows in layers beneath */ - if(target->layer < c->layer && !config_resist_layers_below) - continue; - tl = RECT_LEFT(target->frame->area); tr = RECT_RIGHT(target->frame->area); tt = RECT_TOP(target->frame->area); -- 2.39.2