The following shows the diffstat and patchsets between
7d2faa6..cc2034a^
----------------------------------------------------------------
commit cc2034aacddd1a728c338ac553f9ee2467c06bd2
Author: Thomas Adam <[email protected]>
Date: Sun Sep 21 16:36:49 2014 +0100
SnapAttraction: Use global screen
When performing snapttraction, use the global screen rather than the initial
window monitor's screen as this can change as the window is being moved, and
we do not update the window's screen assignment until afterwards. This
means snapping windows on a different monitor than the starting one wasn't
working.
Also fix some silly conversions of monitor coordinates.
---
mvwm/move_resize.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/mvwm/move_resize.c b/mvwm/move_resize.c
index 387e7a9..1863233 100644
--- a/mvwm/move_resize.c
+++ b/mvwm/move_resize.c
@@ -1960,7 +1960,14 @@ static void DoSnapAttract(
rectangle self;
int score_x;
int score_y;
- struct monitor *m = fw->m;
+
+ /* TA: 2014-09-21: Use the 'global' monitor when performing snap
+ * attraction, and do not rely on the indivudual status of separate
+ * monitors with respect to where the windows are; dragging windows
+ * between monitors is allowed, and without using the global screen,
+ * those windows would be excluded from snapping.
+ */
+ struct monitor *m = monitor_by_name("global");
nxl = -99999;
nyt = -99999;
@@ -2051,7 +2058,7 @@ static void DoSnapAttract(
get_visible_window_or_icon_geometry(tmp, &other);
if (other.x >= m->coord.w ||
other.x + other.width <= 0 ||
- other.y >= m->coord.y ||
+ other.y >= m->coord.h ||
other.y + other.height <= 0)
{
/* do not snap to windows that are not currently
@@ -2186,7 +2193,7 @@ static void DoSnapAttract(
if (!(m->coord.h < (*py) ||
(*py + self.height) < 0))
{
- if (*px + self.width >= m->coord.h &&
+ if (*px + self.width >= m->coord.w &&
*px + self.width <
m->coord.w + fw->snap_attraction.proximity)
{
----------------------------------------------------------------
Diffstat:
----------------------------------------------------------------
----------------------------------------------------------------