From 84788b993c9cf84779a6c885621d42d048744385 Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Sun, 3 Mar 2019 07:54:24 +0100 Subject: [PATCH] Optionally don't slide in DeskGotoByEwin() No actual changes yet. --- src/desktops.c | 12 ++++++++++-- src/desktops.h | 4 ++-- src/ewin-ops.c | 4 ++-- src/ewins.c | 4 ++-- src/focus.c | 4 ++-- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/desktops.c b/src/desktops.c index 6ae8685f..76b7e436 100644 --- a/src/desktops.c +++ b/src/desktops.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors - * Copyright (C) 2004-2018 Kim Woelders + * Copyright (C) 2004-2019 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 @@ -1504,13 +1504,21 @@ DeskRestack(Desk * dsk) } void -DeskGotoByEwin(EWin * ewin) +DeskGotoByEwin(EWin * ewin, int now) { + int slide; + if (EoIsSticky(ewin) || EoIsFloating(ewin)) return; + slide = Conf.desks.slidein; + if (now) + Conf.desks.slidein = 0; + DeskGoto(EoGetDesk(ewin)); DeskCurrentGotoArea(ewin->area_x, ewin->area_y); + + Conf.desks.slidein = slide; } /* diff --git a/src/desktops.h b/src/desktops.h index 20415a0e..9849a01e 100644 --- a/src/desktops.h +++ b/src/desktops.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors - * Copyright (C) 2004-2014 Kim Woelders + * Copyright (C) 2004-2019 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 @@ -82,7 +82,7 @@ void DeskCurrentGetArea(int *ax, int *ay); void DeskCurrentGotoArea(int ax, int ay); void DeskCurrentMoveAreaBy(int ax, int ay); -void DeskGotoByEwin(EWin * ewin); +void DeskGotoByEwin(EWin * ewin, int now); unsigned int DesksGetNumber(void); Desk *DesksGetCurrent(void); diff --git a/src/ewin-ops.c b/src/ewin-ops.c index 1a387748..45c57bc3 100644 --- a/src/ewin-ops.c +++ b/src/ewin-ops.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors - * Copyright (C) 2004-2018 Kim Woelders + * Copyright (C) 2004-2019 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 @@ -1375,7 +1375,7 @@ EwinOpActivate(EWin * ewin, int source, int raise) /* If somehow lost outside desktop, move it to center */ if (!EwinIsOnDesktop(ewin)) ArrangeEwinCentered(ewin); - DeskGotoByEwin(ewin); + DeskGotoByEwin(ewin, 0); } if (raise) EwinOpRaise(ewin, source); diff --git a/src/ewins.c b/src/ewins.c index 88bb6210..d36d354f 100644 --- a/src/ewins.c +++ b/src/ewins.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors - * Copyright (C) 2004-2018 Kim Woelders + * Copyright (C) 2004-2019 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 @@ -881,7 +881,7 @@ AddToFamily(EWin * ewin, EX_Window xwin, XWindowAttributes * pxwa, int startup) dsk = EoGetDesk(ewin2); if (!Mode.wm.startup && Conf.focus.switchfortransientmap && !ewin->state.iconified) - DeskGotoByEwin(ewin2); + DeskGotoByEwin(ewin2, 0); } } diff --git a/src/focus.c b/src/focus.c index 58a6805d..3578b4f4 100644 --- a/src/focus.c +++ b/src/focus.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors - * Copyright (C) 2004-2018 Kim Woelders + * Copyright (C) 2004-2019 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 @@ -388,7 +388,7 @@ doFocusToEwin(EWin * ewin, int why) if (!do_focus) return; - DeskGotoByEwin(ewin); + DeskGotoByEwin(ewin, 0); goto check_focus_new; }