mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
New move_window function
This commit is contained in:
committed by
Carlos R. Mafra
parent
7facc79c0c
commit
42cb1291e3
@@ -1767,9 +1767,8 @@ void wArrangeIcons(WScreen *scr, Bool arrangeAll)
|
||||
|
||||
if (aicon->x_pos != X || aicon->y_pos != Y) {
|
||||
#ifdef ANIMATIONS
|
||||
if (!wPreferences.no_animations) {
|
||||
if (!wPreferences.no_animations)
|
||||
SlideWindow(aicon->icon->core->window, aicon->x_pos, aicon->y_pos, X, Y);
|
||||
}
|
||||
#endif /* ANIMATIONS */
|
||||
}
|
||||
wAppIconMove(aicon, X, Y);
|
||||
@@ -1796,18 +1795,9 @@ void wArrangeIcons(WScreen *scr, Bool arrangeAll)
|
||||
head = wGetHeadForWindow(wwin);
|
||||
|
||||
if (arrangeAll || !wwin->flags.icon_moved) {
|
||||
if (wwin->icon_x != X || wwin->icon_y != Y) {
|
||||
#ifdef ANIMATIONS
|
||||
if (wPreferences.no_animations) {
|
||||
XMoveWindow(dpy, wwin->icon->core->window, X, Y);
|
||||
} else {
|
||||
SlideWindow(wwin->icon->core->window, wwin->icon_x,
|
||||
wwin->icon_y, X, Y);
|
||||
}
|
||||
#else
|
||||
XMoveWindow(dpy, wwin->icon->core->window, X, Y);
|
||||
#endif /* ANIMATIONS */
|
||||
}
|
||||
if (wwin->icon_x != X || wwin->icon_y != Y)
|
||||
move_window(wwin->icon->core->window, wwin->icon_x, wwin->icon_y, X, Y);
|
||||
|
||||
wwin->icon_x = X;
|
||||
wwin->icon_y = Y;
|
||||
|
||||
|
||||
15
src/dock.c
15
src/dock.c
@@ -592,18 +592,9 @@ static void colectIconsCallback(WMenu *menu, WMenuEntry *entry)
|
||||
if (!aicon->docked && wDockFindFreeSlot(clip, &x, &y)) {
|
||||
x_pos = clip->x_pos + x * ICON_SIZE;
|
||||
y_pos = clip->y_pos + y * ICON_SIZE;
|
||||
if (aicon->x_pos != x_pos || aicon->y_pos != y_pos) {
|
||||
#ifdef ANIMATIONS
|
||||
if (wPreferences.no_animations) {
|
||||
XMoveWindow(dpy, aicon->icon->core->window, x_pos, y_pos);
|
||||
} else {
|
||||
SlideWindow(aicon->icon->core->window,
|
||||
aicon->x_pos, aicon->y_pos, x_pos, y_pos);
|
||||
}
|
||||
#else
|
||||
XMoveWindow(dpy, aicon->icon->core->window, x_pos, y_pos);
|
||||
#endif /* ANIMATIONS */
|
||||
}
|
||||
if (aicon->x_pos != x_pos || aicon->y_pos != y_pos)
|
||||
move_window(aicon->icon->core->window, aicon->x_pos, aicon->y_pos, x_pos, y_pos);
|
||||
|
||||
aicon->attracted = 1;
|
||||
if (!aicon->icon->shadowed) {
|
||||
aicon->icon->shadowed = 1;
|
||||
|
||||
@@ -85,6 +85,7 @@ Bool UpdateDomainFile(WDDomain *domain);
|
||||
WWindow * NextToFocusAfter(WWindow *wwin);
|
||||
WWindow * NextToFocusBefore(WWindow *wwin);
|
||||
|
||||
void move_window(Window win, int from_x, int from_y, int to_x, int to_y);
|
||||
void SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y);
|
||||
|
||||
RImage * wGetImageForWindowName(WScreen *scr, char *winstance, char *wclass);
|
||||
|
||||
12
src/misc.c
12
src/misc.c
@@ -247,6 +247,18 @@ static void eatExpose(void)
|
||||
}
|
||||
}
|
||||
|
||||
void move_window(Window win, int from_x, int from_y, int to_x, int to_y)
|
||||
{
|
||||
#ifdef ANIMATIONS
|
||||
if (wPreferences.no_animations)
|
||||
XMoveWindow(dpy, win, to_x, to_y);
|
||||
else
|
||||
SlideWindow(win, from_x, from_y, to_x, to_y);
|
||||
#else
|
||||
XMoveWindow(dpy, win, to_x, to_y);
|
||||
#endif
|
||||
}
|
||||
|
||||
void SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y)
|
||||
{
|
||||
time_t time0 = time(NULL);
|
||||
|
||||
Reference in New Issue
Block a user