Ignore:
Timestamp:
04/09/03 08:46:50 (21 years ago)
Author:
Nicholas Riley
Message:

PSVolumeController.m: Use NJRNonCenteringWindow to prevent the
repositioning from succeeding. Fixes bug 27.

NJRNonCenteringWindow.[hm]: Stub implementation of -[NSWindow center].
Should be removed when bug in Mac OS X is fixed (filed in Radar).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cocoa/Pester/Source/PSVolumeController.m

    r133 r136  
    99#import "PSVolumeController.h"
    1010#import "NJRSoundManager.h"
     11#import "NJRNonCenteringWindow.h"
    1112
    1213@implementation PSVolumeController
     
    2122    if ( (self = [self initWithWindowNibName: @"Volume"]) != nil) {
    2223        [self window]; // connect outlets
    23         NSWindow *window = [[NSWindow alloc] initWithContentRect: [contentView bounds] styleMask: NSBorderlessWindowMask | NSTexturedBackgroundWindowMask backing: NSBackingStoreBuffered defer: NO];
    24 
    25         NSModalSession session = [NSApp beginModalSessionForWindow: window];
    26         [window orderOut: self];
     24        NSWindow *window = [[NJRNonCenteringWindow alloc] initWithContentRect: [contentView bounds] styleMask: NSBorderlessWindowMask | NSTexturedBackgroundWindowMask backing: NSBackingStoreBuffered defer: NO];
    2725
    2826        if ([NJRSoundManager volumeIsNotMutedOrInvalid: volume])
     
    5048            }
    5149        }
    52         [window makeKeyAndOrderFront: self];
    5350
     51        // -[NSApplication beginModalSessionForWindow:] shows and centers the window; we use NJRNonCenteringWindow to prevent the repositioning from succeeding
     52        NSModalSession session = [NSApp beginModalSessionForWindow: window];
    5453        [volumeSlider mouseDown: [NSApp currentEvent]];
    5554        [NSApp runModalSession: session];
Note: See TracChangeset for help on using the changeset viewer.