Fix moving between offset desktops.

SVN revision: 13618
This commit is contained in:
Kim Woelders 2005-03-04 22:14:58 +00:00
parent 2f9aa061cb
commit 24812e4b61
3 changed files with 28 additions and 13 deletions

View File

@ -882,7 +882,7 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
{
static GC gc = 0;
XGCValues gcv;
int x1, y1, w1, h1, i, j, pw, ph;
int x1, y1, w1, h1, i, j, pw, ph, dx, dy;
static Pixmap b1 = 0, b2 = 0, b3 = 0;
static Font font = 0;
int bpp;
@ -957,14 +957,22 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
if (!b3)
b3 = XCreateBitmapFromData(disp, VRoot.win, gray3_bits, gray3_width,
gray3_height);
x1 = ewin->shape_x;
y1 = ewin->shape_y;
dx = DeskGetX(EoGetDesk(ewin));
dy = DeskGetY(EoGetDesk(ewin));
x1 = ewin->shape_x + dx;
y1 = ewin->shape_y + dy;
w1 = EoGetW(ewin) - (ewin->border->border.left +
ewin->border->border.right);
h1 = EoGetH(ewin) - (ewin->border->border.top +
ewin->border->border.bottom);
ewin->shape_x = x;
ewin->shape_y = y;
x += dx;
y += dy;
if ((w != ewin->client.w) || (h != ewin->client.h))
{
ewin->client.w = w;
@ -1207,7 +1215,7 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
}
else if (firstlast == 1)
{
int dx, dy, wt, ht;
int wt, ht;
int adx, ady;
dx = x - x1;

View File

@ -1375,6 +1375,13 @@ FloatEwinAt(EWin * ewin, int x, int y)
if (EoIsFloating(ewin))
{
/* Reparenting to root moves the desktop-relative coordinates */
dx = DeskGetX(EoGetDesk(ewin));
dy = DeskGetY(EoGetDesk(ewin));
ewin->shape_x += dx;
ewin->shape_y += dy;
ewin->req_x += dx;
ewin->req_y += dy;
EoSetFloating(ewin, 2);
}
else

View File

@ -31,7 +31,7 @@ int
ActionMoveStart(EWin * ewin, int grab, char constrained, int nogroup)
{
EWin **gwins;
int i, num;
int i, num, dx, dy;
if (!ewin || ewin->fixedpos)
return 0;
@ -58,10 +58,13 @@ ActionMoveStart(EWin * ewin, int grab, char constrained, int nogroup)
Mode.mode = MODE_MOVE_PENDING;
Mode.constrained = constrained;
Mode.start_x = Mode.x;
Mode.start_y = Mode.y;
Mode.win_x = EoGetX(ewin);
Mode.win_y = EoGetY(ewin);
dx = DeskGetX(EoGetDesk(ewin));
dy = DeskGetY(EoGetDesk(ewin));
Mode.start_x = Mode.x + dx;
Mode.start_y = Mode.y + dy;
Mode.win_x = EoGetX(ewin) + dx;
Mode.win_y = EoGetY(ewin) + dy;
Mode.win_w = ewin->client.w;
Mode.win_h = ewin->client.h;
@ -70,9 +73,6 @@ ActionMoveStart(EWin * ewin, int grab, char constrained, int nogroup)
for (i = 0; i < num; i++)
{
FloatEwinAt(gwins[i], EoGetX(gwins[i]), EoGetY(gwins[i]));
/* This shouldn't be necessary ... will figure it out some other time */
gwins[i]->shape_x = EoGetX(gwins[i]);
gwins[i]->shape_y = EoGetY(gwins[i]);
}
Efree(gwins);
move_swapcoord_x = EoGetX(ewin);
@ -514,7 +514,7 @@ ActionMoveHandleMotion(void)
ewin1 = gwins[i];
/* if its opaque move mode check to see if we have to float */
/* the window aboe all desktops (reparent to root) */
/* the window above all desktops (reparent to root) */
if (Conf.movres.mode_move == 0)
DetermineEwinFloat(ewin1, ndx, ndy);