From: <co...@us...> - 2003-09-17 21:08:59
|
Update of /cvsroot/interfacewm/interfacewm In directory sc8-pr-cvs1:/tmp/cvs-serv17603 Modified Files: IWMWindowManager+Event.m IWMWindowManager.h IWMWindowManager.m Log Message: fix memory leak. this was due to a call of new method -waitForGodot (???) in the -run method of IWMWindowManager. Index: IWMWindowManager+Event.m =================================================================== RCS file: /cvsroot/interfacewm/interfacewm/IWMWindowManager+Event.m,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IWMWindowManager+Event.m 8 Sep 2003 17:21:13 -0000 1.3 --- IWMWindowManager+Event.m 17 Sep 2003 21:08:53 -0000 1.4 *************** *** 75,90 **** #ifdef NEW_HANDLER ! static IWMClient ! *client = nil; ! static int ! lastEventButton = 0, ! lastEventTime = 0; ! static BOOL ! nextDoubleClick = NO; ! static Window ! lastEventWindow = 0; #endif --- 75,86 ---- #ifdef NEW_HANDLER ! static IWMClient *client = nil; ! static int lastEventButton = 0, ! static int lastEventTime = 0; ! static BOOL nextDoubleClick = NO; ! static Window lastEventWindow = 0; #endif *************** *** 94,103 **** #ifdef NEW_HANDLER - /** - * - * - * - */ - static BOOL isDoubleClick(XEvent *event) { --- 90,93 ---- *************** *** 127,136 **** */ ! /** ! * ! * ! * ! */ ! - (void) waitForGodot { --- 117,121 ---- */ ! #if 0 - (void) waitForGodot { *************** *** 145,155 **** } } ! /** ! * ! * ! * ! */ ! - (BOOL) handleEvents: (XEvent *) event { --- 130,136 ---- } } + #endif ! #if 0 - (BOOL) handleEvents: (XEvent *) event { *************** *** 173,176 **** --- 154,158 ---- return NO; } + #endif /** *************** *** 497,506 **** */ - /** - * - * - * - */ - - (BOOL)grabPointerAndServer { --- 479,482 ---- *************** *** 519,528 **** } - /** - * - * - * - */ - - (void)ungrabPointerAndServer { --- 495,498 ---- *************** *** 537,546 **** */ - /** - * - * - * - */ - - (void)cacheEventTime:(XEvent *)event { --- 507,510 ---- *************** *** 686,695 **** #ifdef NEW_HANDLER - /** - * - * - * - */ - - (void) handleKeyPress: (XEvent *) event { --- 650,653 ---- *************** *** 699,708 **** } - /** - * - * - * - */ - - (void) handleKeyRelease: (XEvent *) event { --- 657,660 ---- *************** *** 712,721 **** } - /** - * - * - * - */ - - (void) handleButtonPress: (XEvent *) event { --- 664,667 ---- *************** *** 783,797 **** else if( type == atoms.iwm_window_type_titlebar ) { ! // shade client if titlebar was double-clicked ! if( doubleClick ) ! { ! [client shade]; ! } ! else ! { ! [client raise]; ! [client move]; ! [self setHeadClient: client]; ! } } else if (type == atoms.iwm_window_type_resizebar) --- 729,743 ---- else if( type == atoms.iwm_window_type_titlebar ) { ! // shade client if titlebar was double-clicked ! if (doubleClick) ! { ! [client shade]; ! } ! else ! { ! [client raise]; ! [client move]; ! [self setHeadClient: client]; ! } } else if (type == atoms.iwm_window_type_resizebar) *************** *** 828,837 **** } - /** - * - * - * - */ - - (void) handleButtonRelease: (XEvent *) event { --- 774,777 ---- *************** *** 841,850 **** } - /** - * - * - * - */ - - (void) handleMotionNotify: (XEvent *) event { --- 781,784 ---- *************** *** 854,863 **** } - /** - * - * - * - */ - - (void) handleEnterNotify: (XEvent *) event { --- 788,791 ---- *************** *** 867,876 **** } - /** - * - * - * - */ - - (void) handleLeaveNotify: (XEvent *) event { --- 795,798 ---- *************** *** 880,889 **** } - /** - * - * - * - */ - - (void) handleFocusIn: (XEvent *) event { --- 802,805 ---- *************** *** 893,902 **** } - /** - * - * - * - */ - - (void) handleFocusOut: (XEvent *) event { --- 809,812 ---- *************** *** 906,915 **** } - /** - * - * - * - */ - - (void) handleKeymapNotify: (XEvent *) event { --- 816,819 ---- *************** *** 919,928 **** } - /** - * - * - * - */ - - (void) handleExpose: (XEvent *) event { --- 823,826 ---- *************** *** 944,953 **** } - /** - * - * - * - */ - - (void) handleGraphicsExpose: (XEvent *) event { --- 842,845 ---- *************** *** 957,966 **** } - /** - * - * - * - */ - - (void) handleNoExpose: (XEvent *) event { --- 849,852 ---- *************** *** 970,979 **** } - /** - * - * - * - */ - - (void) handleVisibilityNotify: (XEvent *) event { --- 856,859 ---- *************** *** 994,1003 **** } - /** - * - * - * - */ - - (void) handleCreateNotify: (XEvent *) event { --- 874,877 ---- *************** *** 1007,1016 **** } - /** - * - * - * - */ - - (void) handleDestroyNotify: (XEvent *) event { --- 881,884 ---- *************** *** 1039,1048 **** } - /** - * - * - * - */ - - (void) handleUnmapNotify: (XEvent *) event { --- 907,910 ---- *************** *** 1103,1112 **** } - /** - * - * - * - */ - - (void) handleMapNotify: (XEvent *) event { --- 965,968 ---- *************** *** 1138,1147 **** } - /** - * - * - * - */ - - (void) handleMapRequest: (XEvent *) event { --- 994,997 ---- *************** *** 1176,1185 **** } - /** - * - * - * - */ - - (void) handleReparentNotify: (XEvent *) event { --- 1026,1029 ---- *************** *** 1189,1198 **** } - /** - * - * - * - */ - - (void) handleConfigureNotify: (XEvent *) event { --- 1033,1036 ---- *************** *** 1213,1222 **** } - /** - * - * - * - */ - - (void) handleConfigureRequest: (XEvent *) event { --- 1051,1054 ---- *************** *** 1278,1287 **** } - /** - * - * - * - */ - - (void) handleGravityNotify: (XEvent *) event { --- 1110,1113 ---- *************** *** 1291,1300 **** } - /** - * - * - * - */ - - (void) handleResizeRequest: (XEvent *) event { --- 1117,1120 ---- *************** *** 1304,1313 **** } - /** - * - * - * - */ - - (void) handleCirculateNotify: (XEvent *) event { --- 1124,1127 ---- *************** *** 1317,1326 **** } - /** - * - * - * - */ - - (void) handleCirculateRequest: (XEvent *) event { --- 1131,1134 ---- *************** *** 1330,1339 **** } - /** - * - * - * - */ - - (void) handlePropertyNotify: (XEvent *) event { --- 1138,1141 ---- *************** *** 1416,1425 **** } - /** - * - * - * - */ - - (void) handleSelectionClear: (XEvent *) event { --- 1218,1221 ---- *************** *** 1429,1438 **** } - /** - * - * - * - */ - - (void) handleSelectionRequest: (XEvent *) event { --- 1225,1228 ---- *************** *** 1442,1451 **** } - /** - * - * - * - */ - - (void) handleSelectionNotify: (XEvent *) event { --- 1232,1235 ---- *************** *** 1455,1464 **** } - /** - * - * - * - */ - - (void) handleColormapNotify: (XEvent *) event { --- 1239,1242 ---- *************** *** 1468,1477 **** } - /** - * - * - * - */ - - (void) handleClientMessage: (XEvent *) event { --- 1246,1249 ---- *************** *** 1480,1489 **** return; } - - /** - * - * - * - */ - (void) handleMappingNotify: (XEvent *) event --- 1252,1255 ---- Index: IWMWindowManager.h =================================================================== RCS file: /cvsroot/interfacewm/interfacewm/IWMWindowManager.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** IWMWindowManager.h 8 Sep 2003 17:21:13 -0000 1.14 --- IWMWindowManager.h 17 Sep 2003 21:08:53 -0000 1.15 *************** *** 277,283 **** * @param event An XEvent */ ! - (void) waitForGodot; - (BOOL) handleEvents: (XEvent *) event; - (void)handleEvent:(XEvent *)event; --- 277,285 ---- * @param event An XEvent */ ! #if 0 - (void) waitForGodot; - (BOOL) handleEvents: (XEvent *) event; + #endif + - (void)handleEvent:(XEvent *)event; Index: IWMWindowManager.m =================================================================== RCS file: /cvsroot/interfacewm/interfacewm/IWMWindowManager.m,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** IWMWindowManager.m 8 Sep 2003 17:21:13 -0000 1.18 --- IWMWindowManager.m 17 Sep 2003 21:08:53 -0000 1.19 *************** *** 468,475 **** { IWMTRACE; ! [self waitForGodot]; ! ! #if 0 XEvent event; --- 468,476 ---- { IWMTRACE; + + // XXX this method caused a horrible memory leak + // [self waitForGodot]; ! //#if 0 XEvent event; *************** *** 479,485 **** { XNextEvent(GlobalDisplay, &event); [self handleEvent:&event]; } ! #endif } --- 480,487 ---- { XNextEvent(GlobalDisplay, &event); + //[self cacheEventTime:&event]; [self handleEvent:&event]; } ! //#endif } *************** *** 900,903 **** --- 902,907 ---- if (aClient) { + int i, count = [clientArray count]; + Window window[1]; *************** *** 909,915 **** --- 913,927 ---- _headClientIndex); + // unfocus all clients in clientArray + for (i = 0; i < count; i++) + { + [[clientArray objectAtIndex:i] unfocus]; + } + + // now display the target client and grab the focus [aClient display]; [aClient focus]; + // update the _NET_CLIENT_LIST property [self updateClientWindowList]; |