From bba6dd1670aa99198cbf563af632ccf10da48dbb Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 3 Oct 2000 22:20:00 +0000 Subject: [PATCH] - WMDestroyWidget() now first calls WMUnmapWidget() - decided behavior of list selection while scrolling --- WINGs/ChangeLog | 1 + WINGs/TODO | 3 --- WINGs/Tests/wtest.c | 5 ++++- WINGs/widgets.c | 1 + WINGs/wlist.c | 19 ------------------- WINGs/wview.c | 4 ++-- 6 files changed, 8 insertions(+), 25 deletions(-) diff --git a/WINGs/ChangeLog b/WINGs/ChangeLog index daaccfb4..238ec88d 100644 --- a/WINGs/ChangeLog +++ b/WINGs/ChangeLog @@ -39,6 +39,7 @@ changes since wmaker 0.62.1: - WMBrowser now allows multiple selections. - Added WMGetBrowserPaths() to retrieve the paths for browsers that allow multiple selections. +- WMDestroyWidget() now calls WMUnmapWidget() first changes since wmaker 0.62.0: diff --git a/WINGs/TODO b/WINGs/TODO index 074a5b59..328a178c 100644 --- a/WINGs/TODO +++ b/WINGs/TODO @@ -1,10 +1,7 @@ - move paint to idle handlers -- check whether WMDestroyWidget() should first call WMUnmapWidget(). - check if its useful to add some WMBrowserSelectionDidChangeNotification (actually a pass-through for WMListSelectionDidChangeNotification). Or a delegate to be called when the list selection change. -- check which behavior is better for list selecting while scrolling - (the #define behavior2 in wlist.c) - optimize color allocation for repeated colors diff --git a/WINGs/Tests/wtest.c b/WINGs/Tests/wtest.c index 9d717d68..091088d2 100644 --- a/WINGs/Tests/wtest.c +++ b/WINGs/Tests/wtest.c @@ -29,7 +29,6 @@ int windowCount = 0; void closeAction(WMWidget *self, void *data) { - WMUnmapWidget(self); WMDestroyWidget(self); windowCount--; printf("window closed, window count = %d\n", windowCount); @@ -1207,6 +1206,10 @@ main(int argc, char **argv) */ testList(scr); + testColorWell(scr); + + testTextField(scr); + testText(scr); #if 0 testColorWell(scr); diff --git a/WINGs/widgets.c b/WINGs/widgets.c index 8762553e..66242a87 100644 --- a/WINGs/widgets.c +++ b/WINGs/widgets.c @@ -851,6 +851,7 @@ WMGetHangedData(WMWidget *widget) void WMDestroyWidget(WMWidget *widget) { + W_UnmapView(W_VIEW(widget)); W_DestroyView(W_VIEW(widget)); } diff --git a/WINGs/wlist.c b/WINGs/wlist.c index 7c3880ca..391efadd 100644 --- a/WINGs/wlist.c +++ b/WINGs/wlist.c @@ -1002,7 +1002,6 @@ toggleItemSelection(WMList *lPtr, int index) } } -#define behavior2 static void handleActionEvents(XEvent *event, void *data) @@ -1040,10 +1039,6 @@ handleActionEvents(XEvent *event, void *data) break; case EnterNotify: -#ifndef behavior2 - lPtr->flags.buttonPressed = lPtr->flags.buttonWasPressed; - lPtr->flags.buttonWasPressed = 0; -#endif if (lPtr->selectID) { WMDeleteTimerHandler(lPtr->selectID); lPtr->selectID = NULL; @@ -1051,18 +1046,8 @@ handleActionEvents(XEvent *event, void *data) break; case LeaveNotify: -#ifndef behavior2 - lPtr->flags.buttonWasPressed = lPtr->flags.buttonPressed; - lPtr->flags.buttonPressed = 0; -#endif - height = WMWidgetHeight(lPtr); - -#ifdef behavior2 if (lPtr->flags.buttonPressed && !lPtr->selectID) { -#else - if (lPtr->flags.buttonWasPressed && !lPtr->selectID) { -#endif if (event->xcrossing.y >= height) { lPtr->selectID = WMAddTimerHandler(SCROLL_DELAY, scrollForwardSelecting, @@ -1148,15 +1133,12 @@ handleActionEvents(XEvent *event, void *data) break; case MotionNotify: -#ifdef behavior2 height = WMWidgetHeight(lPtr); if (lPtr->selectID && event->xmotion.y>0 && event->xmotion.yselectID); lPtr->selectID = NULL; } -#endif if (lPtr->flags.buttonPressed && !lPtr->selectID) { -#ifdef behavior2 if (event->xmotion.y <= 0) { lPtr->selectID = WMAddTimerHandler(SCROLL_DELAY, scrollBackwardSelecting, @@ -1168,7 +1150,6 @@ handleActionEvents(XEvent *event, void *data) lPtr); break; } -#endif tmp = getItemIndexAt(lPtr, event->xmotion.y); if (tmp>=0 && tmp!=prevItem) { diff --git a/WINGs/wview.c b/WINGs/wview.c index 46c04379..0ec6141e 100644 --- a/WINGs/wview.c +++ b/WINGs/wview.c @@ -346,10 +346,10 @@ W_UnmapView(W_View *view) view->flags.mapWhenRealized = 0; if (!view->flags.mapped) return; - + XUnmapWindow(view->screen->display, view->window); XFlush(view->screen->display); - + view->flags.mapped = 0; } -- 2.11.4.GIT