Re: Activating application raises windows meant to be invisible
Re: Activating application raises windows meant to be invisible
- Subject: Re: Activating application raises windows meant to be invisible
- From: David Reitter <email@hidden>
- Date: Tue, 8 Jun 2010 09:11:22 -0400
On May 28, 2010, at 1:04 AM, Peter Ammon wrote:
> If a window is ordered out, AppKit will not order it back in when the app is activated. Is it possible that a different window is created, or that the window was not ordered out to begin with?
I have verified that it is the same window that appears. (The NSWindow object is below, 1).
I have also checked that we send the window an `orderOut'.
I find that my NSApp object gets an AppKit event (sendEvent:) when the application becomes active (shown below, 2). I'm passing this event back to NSApplication ([super sendEvent: theEvent]), and the window becomes visible at that moment. Not passing on the event prevents the window from being made visible.
So, I still don't understand where my mistake is.
(1) window after it's been ordered out:
$4 = {
<NSResponder> = {
<NSObject> = {
isa = 0x1002b0b38
},
members of NSResponder:
_nextResponder = 0x0
},
members of NSWindow:
_frame = {
origin = {
x = 13,
y = 375
},
size = {
width = 642,
height = 638
}
},
_contentView = 0x101188600,
_delegate = 0x101350cd0,
_firstResponder = 0x101350cd0,
_lastLeftHit = 0x101350cd0,
_lastRightHit = 0x0,
_counterpart = 0x0,
_fieldEditor = 0x0,
_winEventMask = -1071906784,
_windowNum = 334,
_level = 0,
_backgroundColor = 0x10084d180,
_borderView = 0x101185ca0,
_postingDisabled = 0 '\000',
_styleMask = 14 '\016',
_flushDisabled = 0 '\000',
_reservedWindow1 = 0 '\000',
_cursorRects = 0x10111d210,
_trectTable = 0x101137ee0,
_miniIcon = 0x0,
_unused = 0,
_dragTypes = 0x0,
_representedURL = 0x0,
_sizeLimits = 0x0,
_frameSaveName = 0x0,
_regDragTypes = 0x10137e890,
_wFlags = {
backing = 2,
visible = 0,
isMainWindow = 0,
isKeyWindow = 0,
hidesOnDeactivate = 0,
dontFreeWhenClosed = 0,
oneShot = 0,
deferred = 1,
cursorRectsDisabled = 0,
haveFreeCursorRects = 1,
validCursorRects = 0,
docEdited = 1,
dynamicDepthLimit = 0,
worksWhenModal = 0,
limitedBecomeKey = 0,
needsFlush = 0,
viewsNeedDisplay = 0,
ignoredFirstMouse = 0,
repostedFirstMouse = 0,
windowDying = 0,
tempHidden = 0,
floatingPanel = 0,
wantsToBeOnMainScreen = 0,
optimizedDrawingOk = 0,
optimizeDrawing = 1,
titleIsRepresentedFilename = 0,
excludedFromWindowsMenu = 0,
depthLimit = 0,
delegateReturnsValidRequestor = 1,
lmouseupPending = 0,
rmouseupPending = 0,
wantsToDestroyRealWindow = 0,
wantsToRegDragTypes = 0,
sentInvalidateCursorRectsMsg = 0,
avoidsActivation = 0,
frameSavedUsingTitle = 0,
didRegDragTypes = 1,
delayedOneShot = 0,
postedNeedsDisplayNote = 0,
postedInvalidCursorRectsNote = 0,
initialFirstResponderTempSet = 0,
autodisplay = 1,
tossedFirstEvent = 0,
isImageCache = 0,
interfaceStyle = 0,
keyViewSelectionDirection = 0,
defaultButtonCellKETemporarilyDisabled = 0,
defaultButtonCellKEDisabled = 1,
menuHasBeenSet = 1,
wantsToBeModal = 0,
showingModalFrame = 0,
isTerminating = 0,
win32MouseActivationInProgress = 0,
makingFirstResponderForMouseDown = 0,
needsZoom = 0,
sentWindowNeedsDisplayMsg = 0,
liveResizeActive = 0
},
_defaultButtonCell = 0x0,
_initialFirstResponder = 0x101188600,
_auxiliaryStorage = 0x1013515e0
}
(gdb)
(2) The event:
(gdb) print *theEvent
$1 = {
<NSObject> = {
isa = 0x7fff70186180
},
members of NSEvent:
_type = 13,
_location = {
x = 0,
y = 1050
},
_modifierFlags = 80,
_WSTimestamp = 0x0,
_timestamp = 5264.2341900000001,
_windowNumber = 0,
_window = 0x0,
_context = 0x0,
_data = {
mouse = {
eventNumber = 1,
clickCount = 0,
pressure = 1.59748025e-43,
deltaX = 3.9525251667299724e-322,
deltaY = 0,
subtype = 0,
buttonNumber = 0,
reserved1 = 0,
reserved2 = {0, 0, 0}
},
key = {
keys = 0x1,
unmodKeys = 0x72,
keyCode = 80,
isARepeat = 0 '\000',
eventFlags = 0,
reserved = {0, 0, 0, 0, 0}
},
tracking = {
eventNumber = 1,
trackingNumber = 114,
userData = 0x50,
reserved = {0, 0, 0, 0, 0, 0}
},
scrollWheel = {
deltaX = 4.9406564584124654e-324,
deltaY = 5.6323483625902106e-322,
deltaZ = 3.9525251667299724e-322,
subtype = 0,
reserved1 = 0,
reserved2 = {0, 0, 0, 0, 0, 0}
},
axisGesture = {
deltaX = 4.9406564584124654e-324,
deltaY = 5.6323483625902106e-322,
deltaZ = 3.9525251667299724e-322,
reserved = {0, 0, 0, 0, 0, 0, 0}
},
miscGesture = {
subtype = 1,
gestureEnded = 0 '\000',
reserved = 0 '\000',
value = 0,
percentage = 1.59748025e-43,
reserved2 = {0, 80, 0, 0, 0, 0, 0}
},
misc = {
subtype = 1,
data1 = 114,
data2 = 80,
reserved = {0, 0, 0, 0, 0, 0}
},
tabletPointData = {1, 0, 114, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0},
tabletProximityData = {1, 0, 114, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0}
},
_eventRef = 0x1008e4610,
reserved1 = 0x0,
reserved2 = 0x0
}_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden