moveresize: Remove long time unused swapmove code

Not active because doSwapMove() has been disabled for ages.

Not resurrecting, doesn't seem to work properly.
This commit is contained in:
Kim Woelders 2022-04-21 06:39:02 +02:00
parent e789b1740e
commit 04f040199c
8 changed files with 8 additions and 100 deletions

View File

@ -238,7 +238,6 @@
#define __A_SKIPWINLIST wop * skipwinlist
#define __A_NEVERFOCUS wop * no_wm_focus
#define __A_SKIPLISTS wop * skiplists
#define __A_SWAPMOVE wop * swapmove
#define __A_SEND_TO_NEXT_DESK wop * desk next
#define __A_SEND_TO_PREV_DESK wop * desk prev

View File

@ -1098,7 +1098,6 @@ groups.dflt.raise = 0
groups.dflt.set_border = 1
groups.dflt.stick = 1
groups.dflt.shade = 1
groups.swapmove = 1
# [int] Iconbox animation time(ms)
iconboxes.anim_time = 250

View File

@ -372,9 +372,6 @@ typedef struct {
unsigned int mod_key_mask;
unsigned int mod_combos[8];
} masks;
struct {
char swap;
} move;
struct {
signed char enable_features;
EWin *doing_manual;

View File

@ -487,8 +487,8 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy)
return;
memcpy(lst, lst1, num * sizeof(EWin *));
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, Mode.nogroup
|| Mode.move.swap, &gnum);
gwins =
ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, Mode.nogroup, &gnum);
if (gwins)
{
for (i = 0; i < gnum; i++)

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2021 Kim Woelders
* Copyright (C) 2004-2022 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -72,7 +72,6 @@ static LIST_HEAD(group_list);
static struct {
GroupConfig dflt;
char swapmove;
} Conf_groups;
static struct {
@ -81,12 +80,6 @@ static struct {
static void _GroupsSave(void);
int
GroupsGetSwapmove(void)
{
return Conf_groups.swapmove;
}
static Group *
_GroupCreate(int gid, int cfg_update)
{
@ -1030,7 +1023,6 @@ _EwinGroupsConfig(EWin * ewin)
typedef struct {
GroupConfig group_cfg;
char group_swap;
} GroupCfgDlgData;
static void
@ -1039,7 +1031,6 @@ _DlgApplyGroupDefaults(Dialog * d, int val __UNUSED__, void *data __UNUSED__)
GroupCfgDlgData *dd = DLG_DATA_GET(d, GroupCfgDlgData);
Conf_groups.dflt = dd->group_cfg;
Conf_groups.swapmove = dd->group_swap;
autosave();
}
@ -1051,7 +1042,6 @@ _DlgFillGroupDefaults(Dialog * d, DItem * table, void *data __UNUSED__)
DItem *di;
dd->group_cfg = Conf_groups.dflt;
dd->group_swap = Conf_groups.swapmove;
DialogItemTableSetOptions(table, 2, 0, 0, 0);
@ -1060,9 +1050,6 @@ _DlgFillGroupDefaults(Dialog * d, DItem * table, void *data __UNUSED__)
DialogItemSetAlign(di, 0, 512);
DialogItemSetText(di, _("Per-group settings:"));
di = DialogAddItem(table, DITEM_SEPARATOR);
DialogItemSetColSpan(di, 2);
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetText(di, _("Changing Border Style"));
@ -1097,19 +1084,6 @@ _DlgFillGroupDefaults(Dialog * d, DItem * table, void *data __UNUSED__)
DialogItemSetColSpan(di, 2);
DialogItemSetText(di, _("Shading"));
DialogItemCheckButtonSetPtr(di, &dd->group_cfg.shade);
di = DialogAddItem(table, DITEM_SEPARATOR);
DialogItemSetColSpan(di, 2);
di = DialogAddItem(table, DITEM_TEXT);
DialogItemSetColSpan(di, 2);
DialogItemSetAlign(di, 0, 512);
DialogItemSetText(di, _("Global settings:"));
di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2);
DialogItemSetText(di, _("Swap Window Locations"));
DialogItemCheckButtonSetPtr(di, &dd->group_swap);
}
const DialogDef DlgGroupDefaults = {
@ -1443,7 +1417,6 @@ static const CfgItem GroupsCfgItems[] = {
CFG_ITEM_BOOL(Conf_groups, dflt.set_border, 1),
CFG_ITEM_BOOL(Conf_groups, dflt.stick, 1),
CFG_ITEM_BOOL(Conf_groups, dflt.shade, 1),
CFG_ITEM_BOOL(Conf_groups, swapmove, 1),
};
extern const EModule ModGroups;

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2020 Kim Woelders
* Copyright (C) 2004-2022 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -51,6 +51,5 @@ void GroupsEwinRemove(EWin * ewin);
void GroupsLoad(void);
void GroupsPrune(void);
Group **GroupsGetList(int *pnum);
int GroupsGetSwapmove(void);
#endif /* _GROUPS_H_ */

View File

@ -404,13 +404,6 @@ doMoveConstrained(EWin * ewin, const char *params)
{
return MoveResizeMoveStart(ewin, 0, params, 1, 0);
}
static int
doSwapMove(EWin * ewin, const char *params)
{
Mode.move.swap = 1;
return MoveResizeMoveStart(ewin, 0, params, 0, 0);
}
#endif
static Timer *op_timer = NULL;

View File

@ -49,7 +49,6 @@ static struct {
int start_x, start_y;
int cur_x, cur_y;
int win_x, win_y, win_w, win_h;
int swapcoord_x, swapcoord_y;
int resize_detail;
} Mode_mr;
@ -114,8 +113,7 @@ MoveResizeMoveStart(EWin * ewin, int kbd, int constrained, int nogroup)
Mode_mr.win_y = Mode_mr.start_y - (EoGetY(ewin) + EoGetY(EoGetDesk(ewin)));
EwinRaise(ewin);
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, nogroup
|| Mode.move.swap, &num);
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, nogroup, &num);
Conf.movres.mode_move = MoveResizeModeValidateMove(Conf.movres.mode_move);
Mode_mr.mode = Conf.movres.mode_move;
@ -134,9 +132,6 @@ MoveResizeMoveStart(EWin * ewin, int kbd, int constrained, int nogroup)
Efree(gwins);
_MoveResizeGrabsSet(kbd, ECSR_ACT_MOVE);
Mode_mr.swapcoord_x = EoGetX(ewin);
Mode_mr.swapcoord_y = EoGetY(ewin);
}
static void
@ -160,8 +155,8 @@ _MoveResizeMoveEnd(EWin * ewin)
ewin->state.show_coords = 0;
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, Mode_mr.nogroup
|| Mode.move.swap, &num);
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE,
Mode_mr.nogroup, &num);
if (Mode.mode == MODE_MOVE)
{
@ -197,7 +192,6 @@ _MoveResizeMoveEnd(EWin * ewin)
done:
Mode.mode = MODE_NONE;
Mode.move.swap = 0;
Mode.place.doing_manual = NULL;
Mode_mr.ewin = NULL;
@ -492,7 +486,7 @@ _MoveResizeMoveHandleMotion(void)
EdgeCheckMotion(Mode.events.mx, Mode.events.my);
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE,
Mode_mr.nogroup || Mode.move.swap, &num);
Mode_mr.nogroup, &num);
if (Mode.mode == MODE_MOVE_PENDING)
{
@ -654,52 +648,6 @@ _MoveResizeMoveHandleMotion(void)
/* 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;
/* swapping of group member locations: */
if (Mode.move.swap && GroupsGetSwapmove())
{
EWin **all_gwins, *ewin2;
int j, all_gwins_num;
all_gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_ANY, 0,
&all_gwins_num);
for (j = 0; j < all_gwins_num; j++)
{
ewin2 = all_gwins[j];
if (ewin1 == ewin2)
continue;
/* check for sufficient overlap and avoid flickering */
if (((ewin1->shape_x >= ewin2->shape_x &&
ewin1->shape_x <= ewin2->shape_x + EoGetW(ewin2) / 2 &&
dx <= 0) ||
(ewin1->shape_x <= ewin2->shape_x &&
ewin1->shape_x + EoGetW(ewin1) / 2 >= ewin2->shape_x &&
dx >= 0)) &&
((ewin1->shape_y >= ewin2->shape_y &&
ewin1->shape_y <= ewin2->shape_y + EoGetH(ewin2) / 2 &&
dy <= 0) ||
(EoGetY(ewin1) <= EoGetY(ewin2) &&
ewin1->shape_y + EoGetH(ewin1) / 2 >= ewin2->shape_y &&
dy >= 0)))
{
int tmp_swapcoord_x;
int tmp_swapcoord_y;
tmp_swapcoord_x = Mode_mr.swapcoord_x;
tmp_swapcoord_y = Mode_mr.swapcoord_y;
Mode_mr.swapcoord_x = ewin2->shape_x;
Mode_mr.swapcoord_y = ewin2->shape_y;
EwinOpMove(ewin2, OPSRC_USER,
tmp_swapcoord_x, tmp_swapcoord_y);
break;
}
}
Efree(all_gwins);
}
}
done: