2004-01-18 02:24:06 -08:00
|
|
|
/*
|
2005-03-19 08:40:18 -08:00
|
|
|
* Copyright (C) 2000-2005 Carsten Haitzler, Geoff Harrison and various contributors
|
|
|
|
* Copyright (C) 2004-2005 Kim Woelders
|
2004-01-18 02:24:06 -08:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to
|
|
|
|
* deal in the Software without restriction, including without limitation the
|
|
|
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
* sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies of the Software, its documentation and marketing & publicity
|
|
|
|
* materials, and acknowledgment shall be given in the documentation, materials
|
|
|
|
* and software packages that this Software was used.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
|
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
#include "E.h"
|
|
|
|
|
|
|
|
static EWin *mode_moveresize_ewin = NULL;
|
2004-05-19 14:41:03 -07:00
|
|
|
static int move_swapcoord_x = 0;
|
|
|
|
static int move_swapcoord_y = 0;
|
|
|
|
static int move_mode_real = 0;
|
2004-01-18 02:24:06 -08:00
|
|
|
|
|
|
|
int
|
2004-12-28 15:46:49 -08:00
|
|
|
ActionMoveStart(EWin * ewin, int grab, char constrained, int nogroup)
|
2004-01-18 02:24:06 -08:00
|
|
|
{
|
|
|
|
EWin **gwins;
|
2005-03-04 14:14:58 -08:00
|
|
|
int i, num, dx, dy;
|
2004-01-18 02:24:06 -08:00
|
|
|
|
|
|
|
if (!ewin || ewin->fixedpos)
|
2005-01-25 13:58:28 -08:00
|
|
|
return 0;
|
2004-01-18 02:24:06 -08:00
|
|
|
|
|
|
|
mode_moveresize_ewin = ewin;
|
2004-12-28 15:46:49 -08:00
|
|
|
move_mode_real = Conf.movres.mode_move;
|
2004-03-07 14:51:35 -08:00
|
|
|
#if 0 /* Why do this? Let's see what happens if we don't :) */
|
2004-12-28 15:46:49 -08:00
|
|
|
if (((ewin->groups) || (ewin->has_transients))
|
|
|
|
&& (Conf.movres.mode_move > 0))
|
|
|
|
Conf.movres.mode_move = 0;
|
2004-03-07 14:51:35 -08:00
|
|
|
#endif
|
2004-07-15 11:23:54 -07:00
|
|
|
|
2004-01-18 02:24:06 -08:00
|
|
|
SoundPlay("SOUND_MOVE_START");
|
2004-12-28 15:46:49 -08:00
|
|
|
ModulesSignal(ESIGNAL_MOVE_START, NULL);
|
|
|
|
|
|
|
|
if (Conf.movres.mode_move > 0)
|
|
|
|
ecore_x_grab();
|
|
|
|
|
|
|
|
if (grab)
|
|
|
|
{
|
|
|
|
GrabPointerRelease();
|
|
|
|
GrabPointerSet(VRoot.win, ECSR_ACT_MOVE, 1);
|
|
|
|
}
|
2004-07-15 11:23:54 -07:00
|
|
|
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.mode = MODE_MOVE_PENDING;
|
|
|
|
Mode.constrained = constrained;
|
2005-03-04 14:14:58 -08:00
|
|
|
|
|
|
|
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;
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.win_w = ewin->client.w;
|
|
|
|
Mode.win_h = ewin->client.h;
|
2004-01-18 02:24:06 -08:00
|
|
|
|
2004-12-28 15:46:49 -08:00
|
|
|
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, nogroup
|
2004-05-19 14:41:03 -07:00
|
|
|
|| Mode.move.swap, &num);
|
2004-01-18 02:24:06 -08:00
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
{
|
2004-12-28 15:46:49 -08:00
|
|
|
FloatEwinAt(gwins[i], EoGetX(gwins[i]), EoGetY(gwins[i]));
|
2004-01-18 02:24:06 -08:00
|
|
|
}
|
|
|
|
Efree(gwins);
|
2004-12-28 15:46:49 -08:00
|
|
|
move_swapcoord_x = EoGetX(ewin);
|
|
|
|
move_swapcoord_y = EoGetY(ewin);
|
2005-01-25 13:58:28 -08:00
|
|
|
|
|
|
|
return 0;
|
2004-01-18 02:24:06 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
ActionMoveEnd(EWin * ewin)
|
|
|
|
{
|
|
|
|
EWin **gwins;
|
2004-12-28 15:46:49 -08:00
|
|
|
int d, num, i;
|
2004-01-18 02:24:06 -08:00
|
|
|
|
|
|
|
if (ewin && ewin != mode_moveresize_ewin)
|
|
|
|
return 0;
|
|
|
|
|
2004-11-25 11:14:40 -08:00
|
|
|
GrabPointerRelease();
|
|
|
|
|
2004-01-18 02:24:06 -08:00
|
|
|
SoundPlay("SOUND_MOVE_STOP");
|
|
|
|
|
|
|
|
ewin = mode_moveresize_ewin;
|
|
|
|
if (!ewin)
|
|
|
|
{
|
2004-12-28 15:46:49 -08:00
|
|
|
if (Conf.movres.mode_move > 0)
|
|
|
|
ecore_x_ungrab();
|
2004-03-20 07:49:05 -08:00
|
|
|
if (Mode.mode == MODE_MOVE)
|
2004-12-28 15:46:49 -08:00
|
|
|
Conf.movres.mode_move = move_mode_real;
|
2005-01-25 13:58:28 -08:00
|
|
|
return 0;
|
2004-01-18 02:24:06 -08:00
|
|
|
}
|
2004-05-19 14:41:03 -07:00
|
|
|
|
2004-12-28 15:46:49 -08:00
|
|
|
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, Mode.nogroup
|
2004-05-19 14:41:03 -07:00
|
|
|
|| Mode.move.swap, &num);
|
2004-01-18 02:24:06 -08:00
|
|
|
|
2005-05-01 15:26:03 -07:00
|
|
|
#if 0 /* FIXME - Remove? */
|
2004-12-28 15:46:49 -08:00
|
|
|
if (Conf.movres.mode_move == 0)
|
2004-01-18 02:24:06 -08:00
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
DetermineEwinFloat(gwins[i], 0, 0);
|
|
|
|
#endif
|
|
|
|
|
2004-03-20 07:49:05 -08:00
|
|
|
if (Mode.mode == MODE_MOVE)
|
2004-01-18 02:24:06 -08:00
|
|
|
{
|
|
|
|
for (i = 0; i < num; i++)
|
2004-12-28 15:46:49 -08:00
|
|
|
DrawEwinShape(gwins[i], Conf.movres.mode_move,
|
2004-05-19 14:41:03 -07:00
|
|
|
gwins[i]->shape_x, gwins[i]->shape_y,
|
|
|
|
gwins[i]->client.w, gwins[i]->client.h, 2);
|
2004-01-18 02:24:06 -08:00
|
|
|
}
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.mode = MODE_NONE;
|
2004-01-18 02:24:06 -08:00
|
|
|
|
2005-02-26 17:11:51 -08:00
|
|
|
d = DesktopAt(Mode.x, Mode.y);
|
|
|
|
|
2005-05-01 15:26:03 -07:00
|
|
|
if (Conf.movres.mode_move == 0)
|
2005-05-02 15:11:01 -07:00
|
|
|
{
|
|
|
|
EoChangeOpacity(ewin, ewin->ewmh.opacity);
|
|
|
|
}
|
2004-01-18 02:24:06 -08:00
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
{
|
2004-12-28 15:46:49 -08:00
|
|
|
if ((EoIsFloating(gwins[i])) || (Conf.movres.mode_move > 0))
|
2004-01-18 02:24:06 -08:00
|
|
|
{
|
2004-12-28 15:46:49 -08:00
|
|
|
if (EoIsFloating(gwins[i]))
|
2005-05-01 04:27:43 -07:00
|
|
|
{
|
|
|
|
EoSetFloating(gwins[i], 0);
|
|
|
|
MoveEwinToDesktopAt(gwins[i], d,
|
|
|
|
gwins[i]->shape_x -
|
|
|
|
(DeskGetX(d) -
|
|
|
|
DeskGetX(EoGetDesk(gwins[i]))),
|
|
|
|
gwins[i]->shape_y -
|
|
|
|
(DeskGetY(d) -
|
|
|
|
DeskGetY(EoGetDesk(gwins[i]))));
|
|
|
|
}
|
2004-01-18 02:24:06 -08:00
|
|
|
else
|
2005-05-01 04:27:43 -07:00
|
|
|
{
|
|
|
|
MoveEwinToDesktopAt(gwins[i], d, gwins[i]->shape_x,
|
|
|
|
gwins[i]->shape_y);
|
|
|
|
}
|
2004-01-18 02:24:06 -08:00
|
|
|
}
|
2004-05-18 16:31:07 -07:00
|
|
|
|
2004-01-18 02:24:06 -08:00
|
|
|
RaiseEwin(gwins[i]);
|
|
|
|
}
|
2004-12-28 15:46:49 -08:00
|
|
|
|
|
|
|
ecore_x_sync();
|
|
|
|
if (Conf.movres.mode_move > 0)
|
|
|
|
ecore_x_ungrab();
|
2004-04-08 15:17:56 -07:00
|
|
|
|
2004-01-18 02:24:06 -08:00
|
|
|
Efree(gwins);
|
2004-12-28 15:46:49 -08:00
|
|
|
Conf.movres.mode_move = move_mode_real;
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.nogroup = 0;
|
2004-05-19 14:41:03 -07:00
|
|
|
Mode.move.swap = 0;
|
2004-11-20 09:55:12 -08:00
|
|
|
Mode.have_place_grab = 0;
|
2004-12-28 15:46:49 -08:00
|
|
|
Mode.place = 0;
|
|
|
|
|
|
|
|
ModulesSignal(ESIGNAL_MOVE_DONE, NULL);
|
|
|
|
|
2004-02-17 15:28:25 -08:00
|
|
|
EwinUpdateAfterMoveResize(ewin, 0);
|
|
|
|
|
2005-01-25 13:58:28 -08:00
|
|
|
return 0;
|
2004-01-18 02:24:06 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
ActionMoveSuspend(void)
|
|
|
|
{
|
2004-05-15 15:42:21 -07:00
|
|
|
EWin *ewin, **lst;
|
|
|
|
int i, num;
|
2004-01-18 02:24:06 -08:00
|
|
|
|
|
|
|
ewin = mode_moveresize_ewin;
|
|
|
|
if (!ewin)
|
|
|
|
return 0;
|
|
|
|
|
2004-05-15 15:42:21 -07:00
|
|
|
if (Mode.mode == MODE_MOVE_PENDING)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* If non opaque undraw our boxes */
|
2004-12-28 15:46:49 -08:00
|
|
|
if (Conf.movres.mode_move > 0)
|
2004-01-18 02:24:06 -08:00
|
|
|
{
|
2004-12-28 15:46:49 -08:00
|
|
|
lst =
|
|
|
|
ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, Mode.nogroup,
|
|
|
|
&num);
|
2004-05-15 15:42:21 -07:00
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
{
|
|
|
|
ewin = lst[i];
|
2004-12-28 15:46:49 -08:00
|
|
|
DrawEwinShape(ewin, Conf.movres.mode_move, ewin->shape_x,
|
|
|
|
ewin->shape_y, ewin->client.w, ewin->client.h, 3);
|
2004-05-15 15:42:21 -07:00
|
|
|
}
|
|
|
|
if (lst)
|
|
|
|
Efree(lst);
|
2004-01-18 02:24:06 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
ActionMoveResume(void)
|
|
|
|
{
|
2004-05-15 15:42:21 -07:00
|
|
|
EWin *ewin, **lst;
|
|
|
|
int i, num;
|
2004-05-18 16:31:07 -07:00
|
|
|
int x, y, ax, ay, fl;
|
2004-01-18 02:24:06 -08:00
|
|
|
|
|
|
|
ewin = mode_moveresize_ewin;
|
|
|
|
if (!ewin)
|
|
|
|
return 0;
|
|
|
|
|
2004-12-28 15:46:49 -08:00
|
|
|
fl = (Conf.movres.mode_move == 5) ? 4 : 0;
|
2004-03-20 07:49:05 -08:00
|
|
|
if (Mode.mode == MODE_MOVE_PENDING)
|
2004-05-15 15:42:21 -07:00
|
|
|
{
|
|
|
|
Mode.mode = MODE_MOVE;
|
|
|
|
fl = 0; /* This is the first time we draw it */
|
|
|
|
}
|
2004-01-18 02:24:06 -08:00
|
|
|
|
2004-12-28 15:46:49 -08:00
|
|
|
DeskGetCurrentArea(&ax, &ay);
|
2004-05-15 15:42:21 -07:00
|
|
|
|
|
|
|
/* Redraw any windows that were in "move mode" */
|
2004-12-28 15:46:49 -08:00
|
|
|
lst =
|
|
|
|
ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, Mode.nogroup, &num);
|
2004-05-15 15:42:21 -07:00
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
{
|
|
|
|
ewin = lst[i];
|
|
|
|
|
2004-12-28 15:46:49 -08:00
|
|
|
if (!EoIsFloating(ewin))
|
2004-05-15 15:42:21 -07:00
|
|
|
continue;
|
|
|
|
|
2004-05-18 16:31:07 -07:00
|
|
|
x = ewin->shape_x;
|
|
|
|
y = ewin->shape_y;
|
2004-05-15 15:42:21 -07:00
|
|
|
if (Mode.flipp)
|
|
|
|
{
|
2004-05-18 16:31:07 -07:00
|
|
|
x += Mode.x - Mode.px;
|
|
|
|
y += Mode.y - Mode.py;
|
2004-05-15 15:42:21 -07:00
|
|
|
}
|
2004-12-28 15:46:49 -08:00
|
|
|
DrawEwinShape(ewin, Conf.movres.mode_move, x, y,
|
2004-05-15 15:42:21 -07:00
|
|
|
ewin->client.w, ewin->client.h, fl);
|
|
|
|
}
|
|
|
|
if (lst)
|
|
|
|
Efree(lst);
|
2004-01-18 02:24:06 -08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2004-12-28 15:46:49 -08:00
|
|
|
ActionResizeStart(EWin * ewin, int grab, int hv)
|
2004-01-18 02:24:06 -08:00
|
|
|
{
|
2004-11-21 12:37:38 -08:00
|
|
|
int x, y, w, h, ww, hh;
|
2004-01-18 02:24:06 -08:00
|
|
|
|
|
|
|
if (!ewin || ewin->shaded)
|
2005-01-25 13:58:28 -08:00
|
|
|
return 0;
|
2004-01-18 02:24:06 -08:00
|
|
|
|
|
|
|
mode_moveresize_ewin = ewin;
|
2004-07-15 11:23:54 -07:00
|
|
|
|
2004-01-18 02:24:06 -08:00
|
|
|
SoundPlay("SOUND_RESIZE_START");
|
2004-12-28 15:46:49 -08:00
|
|
|
ModulesSignal(ESIGNAL_RESIZE_START, NULL);
|
|
|
|
|
|
|
|
if (Conf.movres.mode_resize > 0)
|
|
|
|
ecore_x_grab();
|
|
|
|
|
|
|
|
Mode.queue_up = 0;
|
|
|
|
|
|
|
|
if (grab)
|
|
|
|
{
|
|
|
|
GrabPointerRelease();
|
|
|
|
GrabPointerSet(VRoot.win, ECSR_ACT_RESIZE, 1);
|
|
|
|
}
|
2004-07-15 11:23:54 -07:00
|
|
|
|
2004-01-18 02:24:06 -08:00
|
|
|
switch (hv)
|
|
|
|
{
|
|
|
|
case MODE_RESIZE:
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.mode = hv;
|
2004-12-28 15:46:49 -08:00
|
|
|
x = Mode.x - EoGetX(ewin);
|
|
|
|
y = Mode.y - EoGetY(ewin);
|
|
|
|
w = EoGetW(ewin) >> 1;
|
|
|
|
h = EoGetH(ewin) >> 1;
|
|
|
|
ww = EoGetW(ewin) / 6;
|
|
|
|
hh = EoGetH(ewin) / 6;
|
|
|
|
|
2004-01-18 02:24:06 -08:00
|
|
|
if ((x < w) && (y < h))
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.resize_detail = 0;
|
2004-01-18 02:24:06 -08:00
|
|
|
if ((x >= w) && (y < h))
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.resize_detail = 1;
|
2004-01-18 02:24:06 -08:00
|
|
|
if ((x < w) && (y >= h))
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.resize_detail = 2;
|
2004-01-18 02:24:06 -08:00
|
|
|
if ((x >= w) && (y >= h))
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.resize_detail = 3;
|
2004-07-22 09:11:43 -07:00
|
|
|
|
|
|
|
/* The following four if statements added on 07/22/04 by Josh Holtrop.
|
|
|
|
* They allow strictly horizontal or vertical resizing when the
|
|
|
|
* cursor is towards the middle of an edge of a window. */
|
2004-11-21 12:37:38 -08:00
|
|
|
if ((abs(x - w) < (w >> 1)) && (y < hh))
|
2004-07-22 09:11:43 -07:00
|
|
|
{
|
|
|
|
Mode.mode = MODE_RESIZE_V;
|
|
|
|
Mode.resize_detail = 0;
|
|
|
|
}
|
2004-12-28 15:46:49 -08:00
|
|
|
else if ((abs(x - w) < (w >> 1)) && (y > (EoGetH(ewin) - hh)))
|
2004-07-22 09:11:43 -07:00
|
|
|
{
|
|
|
|
Mode.mode = MODE_RESIZE_V;
|
|
|
|
Mode.resize_detail = 1;
|
|
|
|
}
|
2004-11-21 12:37:38 -08:00
|
|
|
else if ((abs(y - h) < (h >> 1)) && (x < ww))
|
2004-07-22 09:11:43 -07:00
|
|
|
{
|
|
|
|
Mode.mode = MODE_RESIZE_H;
|
|
|
|
Mode.resize_detail = 0;
|
|
|
|
}
|
2004-12-28 15:46:49 -08:00
|
|
|
else if ((abs(y - h) < (h >> 1)) && (x > (EoGetW(ewin) - ww)))
|
2004-07-22 09:11:43 -07:00
|
|
|
{
|
|
|
|
Mode.mode = MODE_RESIZE_H;
|
|
|
|
Mode.resize_detail = 1;
|
|
|
|
}
|
2004-01-18 02:24:06 -08:00
|
|
|
break;
|
2004-07-22 09:11:43 -07:00
|
|
|
|
2004-01-18 02:24:06 -08:00
|
|
|
case MODE_RESIZE_H:
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.mode = hv;
|
2004-12-28 15:46:49 -08:00
|
|
|
x = Mode.x - EoGetX(ewin);
|
|
|
|
w = EoGetW(ewin) >> 1;
|
2004-01-18 02:24:06 -08:00
|
|
|
if (x < w)
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.resize_detail = 0;
|
2004-01-18 02:24:06 -08:00
|
|
|
else
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.resize_detail = 1;
|
2004-01-18 02:24:06 -08:00
|
|
|
break;
|
2004-07-22 09:11:43 -07:00
|
|
|
|
2004-01-18 02:24:06 -08:00
|
|
|
case MODE_RESIZE_V:
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.mode = hv;
|
2004-12-28 15:46:49 -08:00
|
|
|
y = Mode.y - EoGetY(ewin);
|
|
|
|
h = EoGetH(ewin) >> 1;
|
2004-01-18 02:24:06 -08:00
|
|
|
if (y < h)
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.resize_detail = 0;
|
2004-01-18 02:24:06 -08:00
|
|
|
else
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.resize_detail = 1;
|
2004-01-18 02:24:06 -08:00
|
|
|
break;
|
|
|
|
}
|
2004-07-22 09:11:43 -07:00
|
|
|
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.start_x = Mode.x;
|
|
|
|
Mode.start_y = Mode.y;
|
2004-12-28 15:46:49 -08:00
|
|
|
Mode.win_x = EoGetX(ewin);
|
|
|
|
Mode.win_y = EoGetY(ewin);
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.win_w = ewin->client.w;
|
|
|
|
Mode.win_h = ewin->client.h;
|
2004-12-28 15:46:49 -08:00
|
|
|
DrawEwinShape(ewin, Conf.movres.mode_resize, EoGetX(ewin), EoGetY(ewin),
|
2004-05-19 14:41:03 -07:00
|
|
|
ewin->client.w, ewin->client.h, 0);
|
2004-01-18 02:24:06 -08:00
|
|
|
|
2005-01-25 13:58:28 -08:00
|
|
|
return 0;
|
2004-01-18 02:24:06 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
ActionResizeEnd(EWin * ewin)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (ewin && ewin != mode_moveresize_ewin)
|
|
|
|
return 0;
|
|
|
|
|
2004-11-25 11:14:40 -08:00
|
|
|
GrabPointerRelease();
|
|
|
|
|
2004-01-18 02:24:06 -08:00
|
|
|
SoundPlay("SOUND_RESIZE_STOP");
|
|
|
|
|
|
|
|
ewin = mode_moveresize_ewin;
|
|
|
|
if (!ewin)
|
|
|
|
{
|
2004-12-28 15:46:49 -08:00
|
|
|
if (Conf.movres.mode_resize > 0)
|
|
|
|
ecore_x_ungrab();
|
2005-01-25 13:58:28 -08:00
|
|
|
return 0;
|
2004-01-18 02:24:06 -08:00
|
|
|
}
|
2004-04-09 05:59:56 -07:00
|
|
|
Mode.queue_up = DRAW_QUEUE_ENABLE;
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.mode = MODE_NONE;
|
2004-12-28 15:46:49 -08:00
|
|
|
DrawEwinShape(ewin, Conf.movres.mode_resize, ewin->shape_x, ewin->shape_y,
|
2004-05-19 14:41:03 -07:00
|
|
|
ewin->client.w, ewin->client.h, 2);
|
2004-01-18 02:24:06 -08:00
|
|
|
for (i = 0; i < ewin->border->num_winparts; i++)
|
|
|
|
ewin->bits[i].no_expose = 1;
|
2004-12-28 15:46:49 -08:00
|
|
|
|
|
|
|
ecore_x_sync();
|
|
|
|
if (Conf.movres.mode_resize > 0)
|
|
|
|
ecore_x_ungrab();
|
|
|
|
|
|
|
|
ModulesSignal(ESIGNAL_RESIZE_DONE, NULL);
|
2004-02-17 15:28:25 -08:00
|
|
|
|
|
|
|
EwinUpdateAfterMoveResize(ewin, 1);
|
|
|
|
|
2005-01-25 13:58:28 -08:00
|
|
|
return 0;
|
2004-01-18 02:24:06 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ActionMoveHandleMotion(void)
|
|
|
|
{
|
2004-05-18 16:31:07 -07:00
|
|
|
int dx, dy, dd;
|
|
|
|
EWin *ewin, **gwins, *ewin1;
|
|
|
|
int i, num;
|
2004-01-18 02:24:06 -08:00
|
|
|
int ndx, ndy;
|
|
|
|
int screen_snap_dist;
|
2004-05-16 09:02:58 -07:00
|
|
|
char jumpx, jumpy;
|
|
|
|
int min_dx, max_dx, min_dy, max_dy;
|
2004-01-18 02:24:06 -08:00
|
|
|
|
|
|
|
ewin = mode_moveresize_ewin;
|
|
|
|
if (!ewin)
|
|
|
|
return;
|
|
|
|
|
2005-01-02 07:38:52 -08:00
|
|
|
EdgeCheckMotion(Mode.x, Mode.y);
|
|
|
|
|
2004-12-28 15:46:49 -08:00
|
|
|
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE,
|
2004-05-19 14:41:03 -07:00
|
|
|
Mode.nogroup || Mode.move.swap, &num);
|
2004-01-18 02:24:06 -08:00
|
|
|
|
2004-03-20 07:49:05 -08:00
|
|
|
if (Mode.mode == MODE_MOVE_PENDING)
|
2004-01-18 02:24:06 -08:00
|
|
|
{
|
|
|
|
for (i = 0; i < num; i++)
|
2004-05-18 16:31:07 -07:00
|
|
|
{
|
|
|
|
ewin1 = gwins[i];
|
2004-12-28 15:46:49 -08:00
|
|
|
DrawEwinShape(ewin1, Conf.movres.mode_move, EoGetX(ewin1),
|
|
|
|
EoGetY(ewin1), ewin1->client.w, ewin1->client.h, 0);
|
2004-05-18 16:31:07 -07:00
|
|
|
}
|
2004-03-20 07:49:05 -08:00
|
|
|
Mode.mode = MODE_MOVE;
|
2005-05-01 15:26:03 -07:00
|
|
|
if (Conf.movres.mode_move == 0)
|
2005-05-02 15:11:01 -07:00
|
|
|
{
|
|
|
|
EoChangeOpacity(ewin, OpacityExt(Conf.movres.opacity));
|
|
|
|
}
|
2004-01-18 02:24:06 -08:00
|
|
|
}
|
|
|
|
|
2004-03-20 07:49:05 -08:00
|
|
|
dx = Mode.x - Mode.px;
|
|
|
|
dy = Mode.y - Mode.py;
|
2004-05-15 15:42:21 -07:00
|
|
|
|
2004-05-16 09:02:58 -07:00
|
|
|
jumpx = 0;
|
|
|
|
jumpy = 0;
|
|
|
|
min_dx = dx;
|
|
|
|
min_dy = dy;
|
|
|
|
max_dx = dx;
|
|
|
|
max_dy = dy;
|
2004-01-18 02:24:06 -08:00
|
|
|
|
2004-05-16 09:02:58 -07:00
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
{
|
|
|
|
ndx = dx;
|
|
|
|
ndy = dy;
|
|
|
|
/* make our ewin resist other ewins around the place */
|
|
|
|
SnapEwin(gwins[i], dx, dy, &ndx, &ndy);
|
|
|
|
if ((dx < 0) && (ndx <= 0))
|
|
|
|
{
|
|
|
|
if (ndx > min_dx)
|
|
|
|
min_dx = ndx;
|
|
|
|
if (ndx < max_dx)
|
|
|
|
max_dx = ndx;
|
|
|
|
}
|
|
|
|
else if (ndx >= 0)
|
|
|
|
{
|
|
|
|
if (ndx < min_dx)
|
|
|
|
min_dx = ndx;
|
|
|
|
if (ndx > max_dx)
|
|
|
|
max_dx = ndx;
|
|
|
|
}
|
|
|
|
if ((dy < 0) && (ndy <= 0))
|
|
|
|
{
|
|
|
|
if (ndy > min_dy)
|
|
|
|
min_dy = ndy;
|
|
|
|
if (ndy < max_dy)
|
|
|
|
max_dy = ndy;
|
|
|
|
}
|
|
|
|
else if (ndy >= 0)
|
|
|
|
{
|
|
|
|
if (ndy < min_dy)
|
|
|
|
min_dy = ndy;
|
|
|
|
if (ndy > max_dy)
|
|
|
|
max_dy = ndy;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (min_dx == dx)
|
|
|
|
ndx = max_dx;
|
|
|
|
else
|
|
|
|
ndx = min_dx;
|
|
|
|
if (min_dy == dy)
|
|
|
|
ndy = max_dy;
|
|
|
|
else
|
|
|
|
ndy = min_dy;
|
|
|
|
|
|
|
|
screen_snap_dist =
|
|
|
|
Mode.constrained ? (VRoot.w + VRoot.h) : Conf.snap.screen_snap_dist;
|
|
|
|
|
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
{
|
2004-05-18 16:31:07 -07:00
|
|
|
ewin1 = gwins[i];
|
|
|
|
|
2004-05-16 09:02:58 -07:00
|
|
|
/* jump out of snap horizontally */
|
2004-05-18 16:31:07 -07:00
|
|
|
dd = ewin1->req_x - ewin1->shape_x;
|
|
|
|
if (dd < 0)
|
|
|
|
dd = -dd;
|
2004-05-16 09:02:58 -07:00
|
|
|
if ((ndx != dx) &&
|
2004-05-18 16:31:07 -07:00
|
|
|
(((ewin1->shape_x == 0) &&
|
|
|
|
(dd > screen_snap_dist)) ||
|
2004-12-28 15:46:49 -08:00
|
|
|
((ewin1->shape_x == (VRoot.w - EoGetW(ewin1))) &&
|
2004-05-18 16:31:07 -07:00
|
|
|
(dd > screen_snap_dist)) ||
|
|
|
|
((ewin1->shape_x != 0) &&
|
2004-12-28 15:46:49 -08:00
|
|
|
(ewin1->shape_x != (VRoot.w - EoGetW(ewin1)) &&
|
2004-05-18 16:31:07 -07:00
|
|
|
(dd > Conf.snap.edge_snap_dist)))))
|
2004-05-16 09:02:58 -07:00
|
|
|
{
|
|
|
|
jumpx = 1;
|
2004-05-18 16:31:07 -07:00
|
|
|
ndx = ewin1->req_x - ewin1->shape_x + dx;
|
2004-05-16 09:02:58 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* jump out of snap vertically */
|
2004-05-18 16:31:07 -07:00
|
|
|
dd = ewin1->req_y - ewin1->shape_y;
|
|
|
|
if (dd < 0)
|
|
|
|
dd = -dd;
|
2004-05-16 09:02:58 -07:00
|
|
|
if ((ndy != dy) &&
|
2004-05-18 16:31:07 -07:00
|
|
|
(((ewin1->shape_y == 0) &&
|
|
|
|
(dd > screen_snap_dist)) ||
|
2004-12-28 15:46:49 -08:00
|
|
|
((ewin1->shape_y == (VRoot.h - EoGetH(ewin1))) &&
|
2004-05-18 16:31:07 -07:00
|
|
|
(dd > screen_snap_dist)) ||
|
|
|
|
((ewin1->shape_y != 0) &&
|
2004-12-28 15:46:49 -08:00
|
|
|
(ewin1->shape_y != (VRoot.h - EoGetH(ewin1)) &&
|
2004-05-18 16:31:07 -07:00
|
|
|
(dd > Conf.snap.edge_snap_dist)))))
|
2004-05-16 09:02:58 -07:00
|
|
|
{
|
|
|
|
jumpy = 1;
|
2004-05-18 16:31:07 -07:00
|
|
|
ndy = ewin1->req_y - ewin1->shape_y + dy;
|
2004-05-16 09:02:58 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
{
|
2004-05-18 16:31:07 -07:00
|
|
|
ewin1 = gwins[i];
|
|
|
|
|
2004-05-16 09:02:58 -07:00
|
|
|
/* if its opaque move mode check to see if we have to float */
|
2005-03-04 14:14:58 -08:00
|
|
|
/* the window above all desktops (reparent to root) */
|
2004-12-28 15:46:49 -08:00
|
|
|
if (Conf.movres.mode_move == 0)
|
2004-05-18 16:31:07 -07:00
|
|
|
DetermineEwinFloat(ewin1, ndx, ndy);
|
|
|
|
|
2004-05-16 09:02:58 -07:00
|
|
|
/* draw the new position of the window */
|
2004-12-28 15:46:49 -08:00
|
|
|
DrawEwinShape(ewin1, Conf.movres.mode_move,
|
2004-05-19 14:41:03 -07:00
|
|
|
ewin1->shape_x + ndx, ewin1->shape_y + ndy,
|
|
|
|
ewin1->client.w, ewin1->client.h, 1);
|
2004-05-18 16:31:07 -07:00
|
|
|
|
|
|
|
/* if we didnt jump the window after a resist at the edge */
|
2004-05-16 09:02:58 -07:00
|
|
|
/* reset the requested x to be the prev. requested + delta */
|
2004-05-18 16:31:07 -07:00
|
|
|
/* if we did jump set requested to current shape position */
|
|
|
|
ewin1->req_x = (jumpx) ? ewin1->shape_x : ewin1->req_x + dx;
|
|
|
|
ewin1->req_y = (jumpy) ? ewin1->shape_y : ewin1->req_y + dy;
|
2004-05-16 09:02:58 -07:00
|
|
|
|
|
|
|
/* swapping of group member locations: */
|
2004-12-28 15:46:49 -08:00
|
|
|
if (Mode.move.swap && Conf.groups.swapmove)
|
2004-05-16 09:02:58 -07:00
|
|
|
{
|
2004-05-18 16:31:07 -07:00
|
|
|
EWin **all_gwins, *ewin2;
|
|
|
|
int j, all_gwins_num;
|
2004-05-16 09:02:58 -07:00
|
|
|
|
2004-12-28 15:46:49 -08:00
|
|
|
all_gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_ANY, 0,
|
2004-05-18 16:31:07 -07:00
|
|
|
&all_gwins_num);
|
2004-05-16 09:02:58 -07:00
|
|
|
|
|
|
|
for (j = 0; j < all_gwins_num; j++)
|
|
|
|
{
|
2004-05-18 16:31:07 -07:00
|
|
|
ewin2 = all_gwins[j];
|
|
|
|
|
|
|
|
if (ewin1 == ewin2)
|
2004-05-16 09:02:58 -07:00
|
|
|
continue;
|
|
|
|
|
|
|
|
/* check for sufficient overlap and avoid flickering */
|
2004-05-18 16:31:07 -07:00
|
|
|
if (((ewin1->shape_x >= ewin2->shape_x &&
|
|
|
|
ewin1->shape_x <= ewin2->shape_x +
|
2004-12-28 15:46:49 -08:00
|
|
|
EoGetW(ewin2) / 2 && Mode.x <= Mode.px) ||
|
2004-05-18 16:31:07 -07:00
|
|
|
(ewin1->shape_x <= ewin2->shape_x &&
|
2004-12-28 15:46:49 -08:00
|
|
|
ewin1->shape_x + EoGetW(ewin1) / 2 >=
|
2004-05-18 16:31:07 -07:00
|
|
|
ewin2->shape_x &&
|
2004-05-16 09:02:58 -07:00
|
|
|
Mode.x >= Mode.px)) &&
|
2004-05-18 16:31:07 -07:00
|
|
|
((ewin1->shape_y >= ewin2->shape_y
|
|
|
|
&& ewin1->shape_y <=
|
2004-12-28 15:46:49 -08:00
|
|
|
ewin2->shape_y + EoGetH(ewin2) / 2
|
|
|
|
&& Mode.y <= Mode.py)
|
|
|
|
|| (EoGetY(ewin1) <= EoGetY(ewin2)
|
|
|
|
&& ewin1->shape_y + EoGetH(ewin1) / 2 >=
|
|
|
|
ewin2->shape_y && Mode.y >= Mode.py)))
|
2004-05-16 09:02:58 -07:00
|
|
|
{
|
|
|
|
int tmp_swapcoord_x;
|
|
|
|
int tmp_swapcoord_y;
|
|
|
|
|
2004-05-19 14:41:03 -07:00
|
|
|
tmp_swapcoord_x = move_swapcoord_x;
|
|
|
|
tmp_swapcoord_y = move_swapcoord_y;
|
|
|
|
move_swapcoord_x = ewin2->shape_x;
|
|
|
|
move_swapcoord_y = ewin2->shape_y;
|
2004-05-18 16:31:07 -07:00
|
|
|
MoveEwin(ewin2, tmp_swapcoord_x, tmp_swapcoord_y);
|
2004-05-16 09:02:58 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Efree(all_gwins);
|
|
|
|
}
|
|
|
|
}
|
2004-01-18 02:24:06 -08:00
|
|
|
Efree(gwins);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ActionResizeHandleMotion(void)
|
|
|
|
{
|
|
|
|
int pw, ph;
|
|
|
|
int x, y, w, h;
|
|
|
|
EWin *ewin;
|
|
|
|
|
|
|
|
ewin = mode_moveresize_ewin;
|
|
|
|
if (!ewin)
|
|
|
|
return;
|
|
|
|
|
2004-03-20 07:49:05 -08:00
|
|
|
switch (Mode.mode)
|
2004-01-18 02:24:06 -08:00
|
|
|
{
|
|
|
|
case MODE_RESIZE:
|
2004-03-20 07:49:05 -08:00
|
|
|
switch (Mode.resize_detail)
|
2004-01-18 02:24:06 -08:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
pw = ewin->client.w;
|
|
|
|
ph = ewin->client.h;
|
2004-03-20 07:49:05 -08:00
|
|
|
w = Mode.win_w - (Mode.x - Mode.start_x);
|
|
|
|
h = Mode.win_h - (Mode.y - Mode.start_y);
|
|
|
|
x = Mode.win_x + (Mode.x - Mode.start_x);
|
|
|
|
y = Mode.win_y + (Mode.y - Mode.start_y);
|
2004-01-18 02:24:06 -08:00
|
|
|
ewin->client.w = w;
|
|
|
|
ewin->client.h = h;
|
|
|
|
ICCCM_MatchSize(ewin);
|
|
|
|
w = ewin->client.w;
|
|
|
|
h = ewin->client.h;
|
|
|
|
if (pw == ewin->client.w)
|
2004-05-18 16:31:07 -07:00
|
|
|
x = ewin->shape_x;
|
2004-01-18 02:24:06 -08:00
|
|
|
else
|
2004-03-20 07:49:05 -08:00
|
|
|
x = Mode.win_x + Mode.win_w - w;
|
2004-01-18 02:24:06 -08:00
|
|
|
if (ph == ewin->client.h)
|
2004-05-18 16:31:07 -07:00
|
|
|
y = ewin->shape_y;
|
2004-01-18 02:24:06 -08:00
|
|
|
else
|
2004-03-20 07:49:05 -08:00
|
|
|
y = Mode.win_y + Mode.win_h - h;
|
2004-01-18 02:24:06 -08:00
|
|
|
ewin->client.w = pw;
|
|
|
|
ewin->client.h = ph;
|
2004-12-28 15:46:49 -08:00
|
|
|
DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1);
|
2004-01-18 02:24:06 -08:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
ph = ewin->client.h;
|
2004-03-20 07:49:05 -08:00
|
|
|
w = Mode.win_w + (Mode.x - Mode.start_x);
|
|
|
|
h = Mode.win_h - (Mode.y - Mode.start_y);
|
2004-05-18 16:31:07 -07:00
|
|
|
x = ewin->shape_x;
|
2004-03-20 07:49:05 -08:00
|
|
|
y = Mode.win_y + (Mode.y - Mode.start_y);
|
2004-01-18 02:24:06 -08:00
|
|
|
ewin->client.h = h;
|
|
|
|
ICCCM_MatchSize(ewin);
|
|
|
|
h = ewin->client.h;
|
|
|
|
if (ph == ewin->client.h)
|
2004-05-18 16:31:07 -07:00
|
|
|
y = ewin->shape_y;
|
2004-01-18 02:24:06 -08:00
|
|
|
else
|
2004-03-20 07:49:05 -08:00
|
|
|
y = Mode.win_y + Mode.win_h - h;
|
2004-01-18 02:24:06 -08:00
|
|
|
ewin->client.h = ph;
|
2004-12-28 15:46:49 -08:00
|
|
|
DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1);
|
2004-01-18 02:24:06 -08:00
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
pw = ewin->client.w;
|
2004-03-20 07:49:05 -08:00
|
|
|
w = Mode.win_w - (Mode.x - Mode.start_x);
|
|
|
|
h = Mode.win_h + (Mode.y - Mode.start_y);
|
|
|
|
x = Mode.win_x + (Mode.x - Mode.start_x);
|
2004-05-18 16:31:07 -07:00
|
|
|
y = ewin->shape_y;
|
2004-01-18 02:24:06 -08:00
|
|
|
ewin->client.w = w;
|
|
|
|
ICCCM_MatchSize(ewin);
|
|
|
|
w = ewin->client.w;
|
|
|
|
if (pw == ewin->client.w)
|
2004-05-18 16:31:07 -07:00
|
|
|
x = ewin->shape_x;
|
2004-01-18 02:24:06 -08:00
|
|
|
else
|
2004-03-20 07:49:05 -08:00
|
|
|
x = Mode.win_x + Mode.win_w - w;
|
2004-01-18 02:24:06 -08:00
|
|
|
ewin->client.w = pw;
|
2004-12-28 15:46:49 -08:00
|
|
|
DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1);
|
2004-01-18 02:24:06 -08:00
|
|
|
break;
|
|
|
|
case 3:
|
2004-03-20 07:49:05 -08:00
|
|
|
w = Mode.win_w + (Mode.x - Mode.start_x);
|
|
|
|
h = Mode.win_h + (Mode.y - Mode.start_y);
|
2004-05-18 16:31:07 -07:00
|
|
|
x = ewin->shape_x;
|
|
|
|
y = ewin->shape_y;
|
2004-12-28 15:46:49 -08:00
|
|
|
DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1);
|
2004-01-18 02:24:06 -08:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MODE_RESIZE_H:
|
2004-03-20 07:49:05 -08:00
|
|
|
switch (Mode.resize_detail)
|
2004-01-18 02:24:06 -08:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
pw = ewin->client.w;
|
2004-03-20 07:49:05 -08:00
|
|
|
w = Mode.win_w - (Mode.x - Mode.start_x);
|
2004-01-18 02:24:06 -08:00
|
|
|
h = ewin->client.h;
|
2004-03-20 07:49:05 -08:00
|
|
|
x = Mode.win_x + (Mode.x - Mode.start_x);
|
2004-05-18 16:31:07 -07:00
|
|
|
y = ewin->shape_y;
|
2004-01-18 02:24:06 -08:00
|
|
|
ewin->client.w = w;
|
|
|
|
ICCCM_MatchSize(ewin);
|
|
|
|
w = ewin->client.w;
|
|
|
|
if (pw == ewin->client.w)
|
2004-05-18 16:31:07 -07:00
|
|
|
x = ewin->shape_x;
|
2004-01-18 02:24:06 -08:00
|
|
|
else
|
2004-03-20 07:49:05 -08:00
|
|
|
x = Mode.win_x + Mode.win_w - w;
|
2004-01-18 02:24:06 -08:00
|
|
|
ewin->client.w = pw;
|
2004-12-28 15:46:49 -08:00
|
|
|
DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1);
|
2004-01-18 02:24:06 -08:00
|
|
|
break;
|
|
|
|
case 1:
|
2004-03-20 07:49:05 -08:00
|
|
|
w = Mode.win_w + (Mode.x - Mode.start_x);
|
2004-01-18 02:24:06 -08:00
|
|
|
h = ewin->client.h;
|
2004-05-18 16:31:07 -07:00
|
|
|
x = ewin->shape_x;
|
|
|
|
y = ewin->shape_y;
|
2004-12-28 15:46:49 -08:00
|
|
|
DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1);
|
2004-01-18 02:24:06 -08:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MODE_RESIZE_V:
|
2004-03-20 07:49:05 -08:00
|
|
|
switch (Mode.resize_detail)
|
2004-01-18 02:24:06 -08:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
ph = ewin->client.h;
|
|
|
|
w = ewin->client.w;
|
2004-03-20 07:49:05 -08:00
|
|
|
h = Mode.win_h - (Mode.y - Mode.start_y);
|
2004-05-18 16:31:07 -07:00
|
|
|
x = ewin->shape_x;
|
2004-03-20 07:49:05 -08:00
|
|
|
y = Mode.win_y + (Mode.y - Mode.start_y);
|
2004-01-18 02:24:06 -08:00
|
|
|
ewin->client.h = h;
|
|
|
|
ICCCM_MatchSize(ewin);
|
|
|
|
h = ewin->client.h;
|
|
|
|
if (ph == ewin->client.h)
|
2004-05-18 16:31:07 -07:00
|
|
|
y = ewin->shape_y;
|
2004-01-18 02:24:06 -08:00
|
|
|
else
|
2004-03-20 07:49:05 -08:00
|
|
|
y = Mode.win_y + Mode.win_h - h;
|
2004-01-18 02:24:06 -08:00
|
|
|
ewin->client.h = ph;
|
2004-12-28 15:46:49 -08:00
|
|
|
DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1);
|
2004-01-18 02:24:06 -08:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
w = ewin->client.w;
|
2004-03-20 07:49:05 -08:00
|
|
|
h = Mode.win_h + (Mode.y - Mode.start_y);
|
2004-05-18 16:31:07 -07:00
|
|
|
x = ewin->shape_x;
|
|
|
|
y = ewin->shape_y;
|
2004-12-28 15:46:49 -08:00
|
|
|
DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1);
|
2004-01-18 02:24:06 -08:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|