forked from e16/e16
1
0
Fork 0

No manual placement or sliding during startup.

SVN revision: 15017
This commit is contained in:
Kim Woelders 2005-05-29 14:59:17 +00:00
parent 5480957906
commit 5388d8539e
8 changed files with 64 additions and 55 deletions

10
src/E.h
View File

@ -909,6 +909,7 @@ typedef struct
{
char manual;
char manual_mouse_pointer;
char slidein;
char ignore_struts;
char raise_fullscreen;
} place;
@ -967,7 +968,6 @@ typedef struct
int deskmode;
int slidemode;
char cleanupslide;
char mapslide;
int slidespeedmap;
int slidespeedcleanup;
char animate_shading;
@ -1029,6 +1029,12 @@ typedef struct
int swapcoord_x, swapcoord_y;
} move;
struct
{
char enable_features;
char doing_manual;
char doing_slide;
} place;
struct
{
char utf8_int; /* Use UTF-8 internally */
char utf8_loc; /* Locale is UTF-8 */
@ -1057,7 +1063,6 @@ typedef struct
char *machine_name;
} wm;
int mode;
char place;
char flipp;
int resize_detail;
int win_x, win_y, win_w, win_h;
@ -1068,7 +1073,6 @@ typedef struct
EWin *mouse_over_ewin;
EWin *context_ewin;
int px, py, x, y;
char doingslide;
int server_grabbed;
int deskdrag;
char button_move_pending;

View File

@ -24,6 +24,7 @@
#include "E.h"
#include "ewin-ops.h"
#include "snaps.h"
#include <math.h>
#include <sys/time.h>
static const WinOp winops[] = {
@ -97,13 +98,17 @@ SlideEwinTo(EWin * ewin, int fx, int fy, int tx, int ty, int speed)
char firstlast;
firstlast = 0;
Mode.doingslide = 1;
Mode.place.doing_slide = 1;
FocusEnable(0);
SoundPlay("SOUND_WINDOW_SLIDE");
if (Conf.slidemode > 0)
EGrabServer();
tmpx = abs(tx - fx) + abs(ty - fy);
tmpx = (tmpx > 0) ? (VRoot.w + VRoot.h) / tmpx : 100;
speed *= tmpx;
ETimedLoopInit(0, 1024, speed);
for (k = 0; k <= 1024;)
{
@ -124,7 +129,7 @@ SlideEwinTo(EWin * ewin, int fx, int fy, int tx, int ty, int speed)
DrawEwinShape(ewin, Conf.slidemode, x, y, ewin->client.w, ewin->client.h, 2);
MoveEwin(ewin, tx, ty);
Mode.doingslide = 0;
Mode.place.doing_slide = 0;
FocusEnable(1);
if (Conf.slidemode > 0)
@ -149,7 +154,7 @@ SlideEwinsTo(EWin ** ewin, int *fx, int *fy, int *tx, int *ty, int num_wins,
goto done;
firstlast = 0;
Mode.doingslide = 1;
Mode.place.doing_slide = 1;
FocusEnable(0);
SoundPlay("SOUND_WINDOW_SLIDE");
@ -191,7 +196,7 @@ SlideEwinsTo(EWin ** ewin, int *fx, int *fy, int *tx, int *ty, int num_wins,
}
}
Mode.doingslide = 0;
Mode.place.doing_slide = 0;
FocusEnable(1);
if (Conf.slidemode > 0)
@ -260,7 +265,7 @@ static void
doMoveResizeEwin(EWin * ewin, int desk, int x, int y, int w, int h, int flags)
{
static int call_depth = 0;
int dx, dy, sw, sh, x0, y0, pdesk;
int dx, dy, sw, sh, xo, yo, pdesk;
char move, resize, reparent, raise, floating;
EWin **lst;
int i, num;
@ -320,15 +325,15 @@ doMoveResizeEwin(EWin * ewin, int desk, int x, int y, int w, int h, int flags)
sh = VRoot.h;
if (EoIsSticky(ewin))
{
x0 = y0 = 0;
xo = yo = 0;
}
else
{
int ax, ay;
DeskGetArea(desk, &ax, &ay);
x0 = -ax * sw;
y0 = -ay * sh;
xo = -ax * sw;
yo = -ay * sh;
sw *= Conf.desks.areas_nx;
sh *= Conf.desks.areas_ny;
}
@ -350,14 +355,14 @@ doMoveResizeEwin(EWin * ewin, int desk, int x, int y, int w, int h, int flags)
dy = 8;
}
if (x < x0 - EoGetW(ewin) + dx)
x = x0 - EoGetW(ewin) + dx;
else if (x > x0 + sw - dx)
x = x0 + sw - dx;
if (y < y0 - EoGetH(ewin) + dy)
y = y0 - EoGetH(ewin) + dy;
else if (y > y0 + sh - dy)
y = y0 + sh - dy;
if (x < xo - EoGetW(ewin) + dx)
x = xo - EoGetW(ewin) + dx;
else if (x > xo + sw - dx)
x = xo + sw - dx;
if (y < yo - EoGetH(ewin) + dy)
y = yo - EoGetH(ewin) + dy;
else if (y > yo + sh - dy)
y = yo + sh - dy;
}
if (flags & MRF_RAISE)
@ -422,21 +427,18 @@ doMoveResizeEwin(EWin * ewin, int desk, int x, int y, int w, int h, int flags)
else
EoMoveResize(ewin, x, y, w, h);
#if 1 /* FIXME - Should be done when shading/unshading */
if (ewin->shaded == 0)
{
EMoveResizeWindow(ewin->win_container,
ewin->border->border.left, ewin->border->border.top,
ewin->client.w, ewin->client.h);
}
else
{
EMoveResizeWindow(ewin->win_container, -30, -30, 1, 1);
}
#endif
if (flags & MRF_RESIZE)
{
if (!ewin->shaded)
EMoveResizeWindow(ewin->win_container,
ewin->border->border.left,
ewin->border->border.top,
ewin->client.w, ewin->client.h);
#if 0
else
EMoveResizeWindow(ewin->win_container, -30, -30, 1, 1);
#endif
EMoveResizeWindow(ewin->client.win, 0, 0, ewin->client.w,
ewin->client.h);
EwinBorderCalcSizes(ewin, 0);

View File

@ -598,11 +598,6 @@ AddToFamily(EWin * ewin, Window win)
ewin->focusclick = 1;
}
doslide = Conf.mapslide && !Mode.wm.startup;
/* if set for borderless then dont slide it in */
if ((!ewin->client.mwm_decor_title) && (!ewin->client.mwm_decor_border))
doslide = 0;
ewin2 = NULL;
if (ewin->client.transient)
{
@ -693,15 +688,20 @@ AddToFamily(EWin * ewin, Window win)
ResizeEwin(ewin, ewin->client.w, ewin->client.h);
manplace = 0;
if ((!ewin->client.transient) && (Conf.place.manual)
&& (!ewin->client.already_placed) && (!Mode.wm.startup) && (!Mode.place))
doslide = manplace = 0;
if (Mode.place.enable_features)
{
char cangrab;
/* if set for borderless then dont slide it in */
if (Conf.place.slidein && !Mode.place.doing_slide &&
(ewin->client.mwm_decor_title || ewin->client.mwm_decor_border))
doslide = 1;
cangrab = GrabPointerSet(VRoot.win, ECSR_GRAB, 0);
if (cangrab == GrabSuccess)
manplace = 1;
if (Conf.place.manual && !Mode.place.doing_manual &&
!ewin->client.already_placed && !ewin->client.transient)
{
if (GrabPointerSet(VRoot.win, ECSR_GRAB, 0) == GrabSuccess)
manplace = 1;
}
}
/* if it hasn't been placed yet.... find a spot for it */
@ -770,12 +770,10 @@ AddToFamily(EWin * ewin, Window win)
unsigned int mask;
Window junk, root_return;
#if 0 /* FIXME: Disable for now */
/* if the loser has manual placement on and the app asks to be on */
/* a desktop, then send E to that desktop so the user can place */
/* the window there */
DeskGoto(desk);
#endif
XQueryPointer(disp, VRoot.win, &root_return, &junk, &rx, &ry, &wx, &wy,
&mask);
@ -789,12 +787,12 @@ AddToFamily(EWin * ewin, Window win)
ShowEwin(ewin);
GrabPointerSet(VRoot.win, ECSR_GRAB, 0);
Mode.have_place_grab = 1;
Mode.place = 1;
Mode.place.doing_manual = 1;
EoSetFloating(ewin, 1); /* Causes reparenting to root */
ActionMoveStart(ewin, 1, 0, 0);
goto done;
}
else if ((doslide) && (!Mode.doingslide))
else if (doslide)
{
k = rand() % 4;
if (k == 0)
@ -817,6 +815,7 @@ AddToFamily(EWin * ewin, Window win)
fx = VRoot.w;
fy = (rand() % (VRoot.h)) - EoGetH(ewin);
}
Mode.place.doing_slide = 1;
FocusEnable(0);
MoveEwinToDesktopAt(ewin, desk, fx, fy);
ShowEwin(ewin);
@ -876,11 +875,11 @@ EwinUnmap1(EWin * ewin)
ActionsEnd(ewin);
if (Mode.doingslide)
if (Mode.place.doing_slide)
{
DrawEwinShape(ewin, Conf.slidemode, ewin->shape_x, ewin->shape_y,
ewin->client.w, ewin->client.h, 2);
Mode.doingslide = 0;
Mode.place.doing_slide = 0;
}
if (ewin == GetContextEwin())

View File

@ -307,7 +307,7 @@ FocusToEWin(EWin * ewin, int why)
if ((ewin2) && (Mode.focuswin == ewin2))
do_follow = 2;
}
else if (Mode.place)
else if (Mode.place.doing_manual)
{
do_follow = 1;
}
@ -420,6 +420,9 @@ FocusInit(void)
Mode.mouse_over_ewin = ewin;
FocusToEWin(NULL, FOCUS_DESK_ENTER);
/* Enable window placement features */
Mode.place.enable_features = 1;
}
static void

View File

@ -340,6 +340,7 @@ MenuShow(Menu * m, char noshow)
ewin->head = head_num;
MoveEwinToDesktop(ewin, EoGetDesk(ewin));
ResizeEwin(ewin, ewin->client.w, ewin->client.h);
if (Conf.menus.animate)
EwinInstantShade(ewin, 0);

View File

@ -116,6 +116,7 @@ static const CfgItem MiscCfgItems[] = {
CFG_ITEM_BOOL(Conf, place.manual, 0),
CFG_ITEM_BOOL(Conf, place.manual_mouse_pointer, 0),
CFG_ITEM_BOOL(Conf, place.slidein, 0),
CFG_ITEM_BOOL(Conf, place.ignore_struts, 0),
CFG_ITEM_BOOL(Conf, place.raise_fullscreen, 0),
@ -136,7 +137,6 @@ static const CfgItem MiscCfgItems[] = {
CFG_ITEM_INT(Conf, deskmode, MODE_NONE),
CFG_ITEM_INT(Conf, slidemode, 0),
CFG_ITEM_BOOL(Conf, cleanupslide, 1),
CFG_ITEM_BOOL(Conf, mapslide, 0),
CFG_ITEM_INT(Conf, slidespeedmap, 6000),
CFG_ITEM_INT(Conf, slidespeedcleanup, 8000),
CFG_ITEM_BOOL(Conf, animate_shading, 1),

View File

@ -164,7 +164,7 @@ ActionMoveEnd(EWin * ewin)
Mode.nogroup = 0;
Mode.move.swap = 0;
Mode.have_place_grab = 0;
Mode.place = 0;
Mode.place.doing_manual = 0;
ModulesSignal(ESIGNAL_MOVE_DONE, NULL);

View File

@ -837,7 +837,7 @@ CB_ConfigureFX(Dialog * d __UNUSED__, int val, void *data __UNUSED__)
Conf.menus.warp = tmp_warpmenus;
Conf.menus.animate = tmp_animated_menus;
Conf.menus.onscreen = tmp_menusonscreen;
Conf.mapslide = tmp_map_slide;
Conf.place.slidein = tmp_map_slide;
Conf.cleanupslide = tmp_cleanup_slide;
Conf.desks.slidein = tmp_desktop_slide;
Conf.animate_shading = tmp_animate_shading;
@ -868,7 +868,7 @@ SettingsSpecialFX(void)
tmp_warpmenus = Conf.menus.warp;
tmp_animated_menus = Conf.menus.animate;
tmp_menusonscreen = Conf.menus.onscreen;
tmp_map_slide = Conf.mapslide;
tmp_map_slide = Conf.place.slidein;
tmp_cleanup_slide = Conf.cleanupslide;
tmp_desktop_slide = Conf.desks.slidein;
tmp_animate_shading = Conf.animate_shading;