diff --git a/ChangeLog b/ChangeLog index 44a2ef280..60af8b24c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Wed Mar 08 115:4500 2000 Richard Frith-Macdonald + + Removed a fixup that should no longer be needed now that the + coordinate stuff is fixed - NB you need to update your copy of + WindowMaker to the latest CVS code because that contains some + coordinate handling bug fixes that we need. + * Source/NSPopPupButton.m: Removed workaround for bad coordinates. + * Source/NSPopPupButtonCell.m: ditto. + Wed Mar 08 13:15:00 2000 Richard Frith-Macdonald * Source/NSWindow.m: Final (I hope) coordinate handling fixes to diff --git a/Source/NSPopUpButton.m b/Source/NSPopUpButton.m index a197a7022..ec9b94e34 100644 --- a/Source/NSPopUpButton.m +++ b/Source/NSPopUpButton.m @@ -317,18 +317,8 @@ Class _nspopupbuttonCellClass = 0; [_cell attachPopUpWithFrame: _bounds inView: self]; - { - // Hack, function in NSPopUpButtonCell - extern NSPoint - _convertBaseToScreen_with_fix (NSRect frame, NSWindow *window, - NSPoint point); - - p = [[mr window] - convertScreenToBase: - _convertBaseToScreen_with_fix ([self convertRect:_bounds - toView: nil], _window, - [theEvent locationInWindow])]; - } + p = [_window convertBaseToScreen: [theEvent locationInWindow]]; + p = [[mr window] convertScreenToBase: p]; // Process events; we start menu events processing by converting // this event to the menu window, and sending it there. diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index cf4756a18..a0c311112 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -46,49 +46,6 @@ } @end -/* Same as [NSWindow -convertBaseToScreen:] with the difference - that detects and fixes at run time bugs in the window frame management */ -/* frame is a frame where the mouse is supposed to be. - If the mouse is out of that frame, it means the window code has got the - window origin wrong -- presumably by a decoration height. - Looking if mouse is upper or lower than the given frame we determine - if decoration window size need to be added or subtracted. */ -NSPoint -_convertBaseToScreen_with_fix(NSRect frame, NSWindow *window, NSPoint point) -{ - /* We get mouse position */ - NSPoint mouse = [window mouseLocationOutsideOfEventStream]; - float l, r, b; - float t = 0; - NSPoint ret; - - /* If the reported mouse position is not in frame - this means that the window frame origin is broken. */ - if (mouse.y > frame.origin.y + frame.size.height) - { - NSLog (@"Window Frame Origin Bug Detected: point reported higher"); - NSLog (@"Workaround enabled."); - DPSstyleoffsets (GSCurrentContext (), &l, &r, &t, &b, - [window styleMask]); - } - else if (mouse.y < frame.origin. y) - { - NSLog (@"Window Frame Origin Bug Detected: point reported lower"); - NSLog (@"Workaround enabled."); - DPSstyleoffsets (GSCurrentContext (), &l, &r, &t, &b, - [window styleMask]); - t = -t; - } - - /* Convert the origin */ - ret = [window convertBaseToScreen: point]; - - /* Add the bug correction */ - ret.y += t; - - return ret; -} - /* The image to use in a specific popupbutton is * _pbc_image[_pbcFlags.pullsDown]; that is, _pbc_image[0] if it is a * popup menu, _pbc_image[1] if it is a pulls down list. */ @@ -477,21 +434,21 @@ static NSImage *_pbc_image[2]; NSWindow *cvWin = [controlView window]; NSMenuView *mr = [_menu menuRepresentation]; int items; - NSRect origCellFrame = [controlView convertRect: cellFrame - toView: nil]; [nc postNotificationName: NSPopUpButtonCellWillPopUpNotification - object: self]; + object: self]; [nc postNotificationName: NSPopUpButtonCellWillPopUpNotification - object: controlView]; + object: controlView]; [mr _setCellSize: cellFrame.size]; [_menu sizeToFit]; - // Compute the frame (NB: the temporary frame to be passed - // to mr as per spec, not yet the definitive frame where - // the menu is going to appear) + /* + * Compute the frame (NB: the temporary frame to be passed + * to mr as per spec, not yet the definitive frame where + * the menu is going to appear) + */ items = [_menu numberOfItems]; if (items > 1) { @@ -506,10 +463,9 @@ static NSImage *_pbc_image[2]; /* Convert to content view */ cellFrame = [controlView convertRect: cellFrame - toView: nil]; + toView: nil]; - cellFrame.origin = _convertBaseToScreen_with_fix (origCellFrame, cvWin, - cellFrame.origin); + cellFrame.origin = [cvWin convertBaseToScreen: cellFrame.origin]; // Ask the MenuView to attach the menu to this rect if (_pbcFlags.pullsDown)