1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-28 17:32:29 +01:00

- WMDestroyWidget() now first calls WMUnmapWidget()

- decided behavior of list selection while scrolling
This commit is contained in:
dan
2000-10-03 22:20:00 +00:00
parent ed39c92de0
commit bba6dd1670
6 changed files with 8 additions and 25 deletions

View File

@@ -39,6 +39,7 @@ changes since wmaker 0.62.1:
- WMBrowser now allows multiple selections. - WMBrowser now allows multiple selections.
- Added WMGetBrowserPaths() to retrieve the paths for browsers that allow - Added WMGetBrowserPaths() to retrieve the paths for browsers that allow
multiple selections. multiple selections.
- WMDestroyWidget() now calls WMUnmapWidget() first
changes since wmaker 0.62.0: changes since wmaker 0.62.0:

View File

@@ -1,10 +1,7 @@
- move paint to idle handlers - move paint to idle handlers
- check whether WMDestroyWidget() should first call WMUnmapWidget().
- check if its useful to add some WMBrowserSelectionDidChangeNotification - check if its useful to add some WMBrowserSelectionDidChangeNotification
(actually a pass-through for WMListSelectionDidChangeNotification). (actually a pass-through for WMListSelectionDidChangeNotification).
Or a delegate to be called when the list selection change. 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 - optimize color allocation for repeated colors

View File

@@ -29,7 +29,6 @@ int windowCount = 0;
void void
closeAction(WMWidget *self, void *data) closeAction(WMWidget *self, void *data)
{ {
WMUnmapWidget(self);
WMDestroyWidget(self); WMDestroyWidget(self);
windowCount--; windowCount--;
printf("window closed, window count = %d\n", windowCount); printf("window closed, window count = %d\n", windowCount);
@@ -1207,6 +1206,10 @@ main(int argc, char **argv)
*/ */
testList(scr); testList(scr);
testColorWell(scr);
testTextField(scr);
testText(scr);
#if 0 #if 0
testColorWell(scr); testColorWell(scr);

View File

@@ -851,6 +851,7 @@ WMGetHangedData(WMWidget *widget)
void void
WMDestroyWidget(WMWidget *widget) WMDestroyWidget(WMWidget *widget)
{ {
W_UnmapView(W_VIEW(widget));
W_DestroyView(W_VIEW(widget)); W_DestroyView(W_VIEW(widget));
} }

View File

@@ -1002,7 +1002,6 @@ toggleItemSelection(WMList *lPtr, int index)
} }
} }
#define behavior2
static void static void
handleActionEvents(XEvent *event, void *data) handleActionEvents(XEvent *event, void *data)
@@ -1040,10 +1039,6 @@ handleActionEvents(XEvent *event, void *data)
break; break;
case EnterNotify: case EnterNotify:
#ifndef behavior2
lPtr->flags.buttonPressed = lPtr->flags.buttonWasPressed;
lPtr->flags.buttonWasPressed = 0;
#endif
if (lPtr->selectID) { if (lPtr->selectID) {
WMDeleteTimerHandler(lPtr->selectID); WMDeleteTimerHandler(lPtr->selectID);
lPtr->selectID = NULL; lPtr->selectID = NULL;
@@ -1051,18 +1046,8 @@ handleActionEvents(XEvent *event, void *data)
break; break;
case LeaveNotify: case LeaveNotify:
#ifndef behavior2
lPtr->flags.buttonWasPressed = lPtr->flags.buttonPressed;
lPtr->flags.buttonPressed = 0;
#endif
height = WMWidgetHeight(lPtr); height = WMWidgetHeight(lPtr);
#ifdef behavior2
if (lPtr->flags.buttonPressed && !lPtr->selectID) { if (lPtr->flags.buttonPressed && !lPtr->selectID) {
#else
if (lPtr->flags.buttonWasPressed && !lPtr->selectID) {
#endif
if (event->xcrossing.y >= height) { if (event->xcrossing.y >= height) {
lPtr->selectID = WMAddTimerHandler(SCROLL_DELAY, lPtr->selectID = WMAddTimerHandler(SCROLL_DELAY,
scrollForwardSelecting, scrollForwardSelecting,
@@ -1148,15 +1133,12 @@ handleActionEvents(XEvent *event, void *data)
break; break;
case MotionNotify: case MotionNotify:
#ifdef behavior2
height = WMWidgetHeight(lPtr); height = WMWidgetHeight(lPtr);
if (lPtr->selectID && event->xmotion.y>0 && event->xmotion.y<height) { if (lPtr->selectID && event->xmotion.y>0 && event->xmotion.y<height) {
WMDeleteTimerHandler(lPtr->selectID); WMDeleteTimerHandler(lPtr->selectID);
lPtr->selectID = NULL; lPtr->selectID = NULL;
} }
#endif
if (lPtr->flags.buttonPressed && !lPtr->selectID) { if (lPtr->flags.buttonPressed && !lPtr->selectID) {
#ifdef behavior2
if (event->xmotion.y <= 0) { if (event->xmotion.y <= 0) {
lPtr->selectID = WMAddTimerHandler(SCROLL_DELAY, lPtr->selectID = WMAddTimerHandler(SCROLL_DELAY,
scrollBackwardSelecting, scrollBackwardSelecting,
@@ -1168,7 +1150,6 @@ handleActionEvents(XEvent *event, void *data)
lPtr); lPtr);
break; break;
} }
#endif
tmp = getItemIndexAt(lPtr, event->xmotion.y); tmp = getItemIndexAt(lPtr, event->xmotion.y);
if (tmp>=0 && tmp!=prevItem) { if (tmp>=0 && tmp!=prevItem) {