Add move/resize functions with action source parameter.

SVN revision: 20597
This commit is contained in:
Kim Woelders 2006-02-19 22:23:50 +00:00
parent 2a4e9350b1
commit 2b9692f28f
6 changed files with 39 additions and 9 deletions

View File

@ -532,6 +532,7 @@ typedef struct
char *machine_name;
} wm;
int mode;
int op_source;
char action_inhibit;
EWin *focuswin;
EWin *mouse_over_ewin;

View File

@ -634,7 +634,7 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
switch (md)
{
case 0:
EwinMoveResize(ewin, x, y, w, h);
EwinOpMoveResize(ewin, OPSRC_USER, x, y, w, h);
EwinShapeSet(ewin);
CoordsShow(ewin);
break;

View File

@ -1280,6 +1280,30 @@ EwinUnShade(EWin * ewin)
HintsSetWindowState(ewin);
}
void
EwinOpMove(EWin * ewin, int source, int x, int y)
{
Mode.op_source = source;
EwinMove(ewin, x, y);
Mode.op_source = 0;
}
void
EwinOpResize(EWin * ewin, int source, int w, int h)
{
Mode.op_source = source;
EwinResize(ewin, w, h);
Mode.op_source = 0;
}
void
EwinOpMoveResize(EWin * ewin, int source, int x, int y, int w, int h)
{
Mode.op_source = source;
EwinMoveResize(ewin, x, y, w, h);
Mode.op_source = 0;
}
void
EwinOpFullscreen(EWin * ewin, int source __UNUSED__, int on)
{

View File

@ -352,6 +352,10 @@ void EwinMoveToArea(EWin * ewin, int ax, int ay);
void EwinMoveToLinearArea(EWin * ewin, int a);
void EwinMoveLinearAreaBy(EWin * ewin, int a);
void EwinOpMove(EWin * ewin, int source, int x, int y);
void EwinOpResize(EWin * ewin, int source, int w, int h);
void EwinOpMoveResize(EWin * ewin, int source, int x, int y,
int w, int h);
void EwinOpClose(EWin * ewin, int source);
void EwinOpActivate(EWin * ewin, int source);
void EwinOpKill(EWin * ewin, int source);

View File

@ -569,7 +569,7 @@ IPC_WinOps(const char *params, Client * c __UNUSED__)
else
{
sscanf(params, "%*s %*s %i %i", &a, &b);
EwinMove(ewin, a, b);
EwinOpMove(ewin, OPSRC_USER, a, b);
}
break;
@ -600,7 +600,7 @@ IPC_WinOps(const char *params, Client * c __UNUSED__)
else
{
sscanf(params, "%*s %*s %i %i", &a, &b);
EwinResize(ewin, a, b);
EwinOpResize(ewin, OPSRC_USER, a, b);
}
break;
@ -611,7 +611,7 @@ IPC_WinOps(const char *params, Client * c __UNUSED__)
sscanf(params, "%*s %*s %i %i", &a, &b);
a += EoGetX(ewin);
b += EoGetY(ewin);
EwinMove(ewin, a, b);
EwinOpMove(ewin, OPSRC_USER, a, b);
break;
case EWIN_OP_SIZE_REL:
@ -621,7 +621,7 @@ IPC_WinOps(const char *params, Client * c __UNUSED__)
sscanf(params, "%*s %*s %i %i", &a, &b);
a += ewin->client.w;
b += ewin->client.h;
EwinResize(ewin, a, b);
EwinOpResize(ewin, OPSRC_USER, a, b);
break;
case EWIN_OP_MAX_WIDTH:

View File

@ -396,10 +396,10 @@ ActionResizeEnd(EWin * ewin)
else
{
if (ewin->state.shaded)
EwinMove(ewin, ewin->shape_x, ewin->shape_y);
EwinOpMove(ewin, OPSRC_USER, ewin->shape_x, ewin->shape_y);
else
EwinMoveResize(ewin, ewin->shape_x, ewin->shape_y,
ewin->shape_w, ewin->shape_h);
EwinOpMoveResize(ewin, OPSRC_USER, ewin->shape_x, ewin->shape_y,
ewin->shape_w, ewin->shape_h);
}
ESync();
@ -622,7 +622,8 @@ ActionMoveHandleMotion(void)
tmp_swapcoord_y = Mode_mr.swapcoord_y;
Mode_mr.swapcoord_x = ewin2->shape_x;
Mode_mr.swapcoord_y = ewin2->shape_y;
EwinMove(ewin2, tmp_swapcoord_x, tmp_swapcoord_y);
EwinOpMove(ewin2, OPSRC_USER,
tmp_swapcoord_x, tmp_swapcoord_y);
break;
}
}