From dfbc246a3f22c7f606260bf96af6aaa716f0bcd7 Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 22 Apr 1999 03:25:30 +0000 Subject: [PATCH] Fixed a bug with icon position calculation when redocking in clip, and made libwmfun to be added to distribution with "make dist". --- ChangeLog | 7 +++++++ Makefile.am | 2 +- Makefile.in | 2 +- src/dock.c | 22 ++++++++++------------ 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index f26cfdfd..6013d260 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Changes since version 0.53.0: +............................. + +- fixed a bug that caused icon overlaping in Clip, when icon was moved around. +- this time really added libwmfun to distribution. + + Changes since version 0.52.0: ............................. diff --git a/Makefile.am b/Makefile.am index 720b4e0e..9da92d85 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ SUBDIRS = wrlib WINGs src util po WindowMaker wmlib test WPrefs.app doc EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N MIRRORS COPYING.OPL \ Install acconfig.h\ mkpatch README.KDE README.GNOME WindowMaker.lsm.in\ - docklib-0.2.tar.gz + docklib-0.2.tar.gz libwmfun-0.0.1.tar.gz WindowMaker.lsm: WindowMaker.lsm.in size=`wc -c $(distdir).tar.gz|cut -d\ -f1`;\ diff --git a/Makefile.in b/Makefile.in index a27365b3..3ef488c9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -90,7 +90,7 @@ wprefsdir = @wprefsdir@ SUBDIRS = wrlib WINGs src util po WindowMaker wmlib test WPrefs.app doc -EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N MIRRORS COPYING.OPL Install acconfig.h mkpatch README.KDE README.GNOME WindowMaker.lsm.in docklib-0.2.tar.gz +EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N MIRRORS COPYING.OPL Install acconfig.h mkpatch README.KDE README.GNOME WindowMaker.lsm.in docklib-0.2.tar.gz libwmfun-0.0.1.tar.gz ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs diff --git a/src/dock.c b/src/dock.c index 12e8b68f..9e52090d 100644 --- a/src/dock.c +++ b/src/dock.c @@ -2307,6 +2307,9 @@ wDockDetach(WDock *dock, WAppIcon *icon) * coordinates. * * Returns False if icon can't be docked. + * + * Note: this function should NEVER alter ret_x or ret_y, unless it will + * return True. -Dan */ Bool wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y, @@ -2365,8 +2368,6 @@ wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y, } } - *ret_x = 0; - if (redocking) { int sig, done, closest; @@ -2380,12 +2381,10 @@ wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y, if (abs(ex_x) > DOCK_DETTACH_THRESHOLD) return False; - if (ex_y >= 0 && ex_y <= max_y_icons && (aicon == icon || !aicon)) { - + if (ex_y>=0 && ex_y<=max_y_icons && (aicon==icon || !aicon)) { + *ret_x = 0; *ret_y = ex_y; - - - return True; + return True; } /* start looking at the upper slot or lower? */ @@ -2420,15 +2419,15 @@ wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y, ((ex_y >= closest && ex_y - closest < DOCK_DETTACH_THRESHOLD+1) || (ex_y < closest && closest - ex_y <= DOCK_DETTACH_THRESHOLD+1))) { - + *ret_x = 0; *ret_y = closest; - return True; } } else { /* !redocking */ /* if slot is free and the icon is close enough, return it */ if (!aicon && ex_x == 0 && ex_y >= 0 && ex_y <= max_y_icons) { + *ret_x = 0; *ret_y = ex_y; return True; } @@ -3618,8 +3617,7 @@ handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event) if (dock->auto_raise_lower) wDockRaise(dock); last_dock = dock; - } - else if (dock2) { + } else if (dock2) { tmp = wDockSnapIcon(dock2, aicon, x, y, &ix, &iy, False); if (tmp) { change_dock = 1; @@ -3641,7 +3639,7 @@ handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event) || (aicon->running && !(ev.xmotion.state & MOD_MASK)) || (!aicon->running && tmp)) { shad_x = last_dock->x_pos + ix*wPreferences.icon_size; - shad_y = last_dock->y_pos + iy*wPreferences.icon_size; + shad_y = last_dock->y_pos + iy*wPreferences.icon_size; XMoveWindow(dpy, scr->dock_shadow, shad_x, shad_y);