Talk

dwskau's picture
Forwarded keyboard and mouse

I may not be understanding exactly what "with all mouse and keyboard events automatically forwarded" means, but the .app I get from this doesn't seem to respond to any keyboard input. In the QC viewer pressing keys makes my composition display different things, however the same composition in the built .app doesn't seem to take any input. I have attached the composition. Am I missing something?

PreviewAttachmentSize
WeatherData.qtz1.86 MB

cwright's picture
weird

You're right, this doesn't seem to work as expected.

I'm looking into this (even forcing the view's event mask to "everything" doesn't make it accept everything, so I'm not entirely sure what's happening yet..)

cwright's picture
the fix

Ok, I forgot: AppKit doesn't allow borderless windows to become key windows, so they don't receive events in the first place.

To work around this, add the following method to VisualizerWindow.m:

-(BOOL) canBecomeKeyWindow
{
   return YES;
}

You might also want to add the following to AppController.m:

[visView setEventForwardingMask: NSAnyEventMask];

right after the

[visView startRendering];

line.

dwskau's picture
So Fast!

That was so quick! I honestly didn't expect a response for at least an hour, let alone a solution within 30 min.

It works great now, thanks so much!

The next step for me is getting it to load a plugin from within the app...

dwskau's picture
Command + tab

It seems I only post questions here, never much help. One day I hope I can contribute back somehow... Command + tab is disabled while an application built by this is running it seems. Is this because of the borderless window or because of the forwarding of keyboard events? Is there any way around this? Having two fullscreen apps running with the ability to switch between them seamlessly would be very useful for performance settings.

cwright's picture
sort of...

Actually cmd-tab works as expected: you press it, and you can select a different app. (please keep reading)

However, the cmd-tab display is under the QC window, so you can't see it. You can mouse over the region where it should be, and watch the cursor change a bit. And clicking changes the app (though you can't tell which one wins till you get there...)

To fix this, change this part in AppController.m:

[visWindow setLevel: NSMainMenuWindowLevel+1];

the window level was set to something like NSScreenSaverWindowLevel, which is the level screensavers live at (on top of everything). NSMainMenuWindowLevel is where the menubar lives (necessary for proper full-screen functionality), and adding 1 nudges it a bit higher, to cover the clock and airport status etc. This is still below the cmd-tab display though, so you can actually see what you're doing when it's set to this lower window level.

dwskau's picture
Window Level

After playing around a little I've discovered that you can also make the window at the normal window level: [visWindow setLevel: NSNormalWindowLevel]; To make the menubar autohide add this to the Info.plist

<key>LSUIPresentationMode</key>
<integer>4</integer>

A 3 instead of a 4 will make the menubar and dock permanently hidden while that app is in the foreground. For some reason I could not get the value to change in Property List Editor (it would keep changing them back to normal), the equivalent entries in it are: Key: Application UI Presentation Mode Value: All hidden (3) and All suppressed (4).

balam's picture
error on building with leopard

on building project gets this error

Building target “QCFullscreen” of project “QCFullscreen” with configuration “Release” — (1 error) Checking Dependencies Internal error occurred while creating dependency graph: ASSERTION FAILURE in /SourceCache/DevToolsBase/DevToolsBase-921/pbxcore/SpecificationTypes/XCCompilerSpecification.m:267 Details: arch should be a non-empty string, but it's an empty string Object: Method: -computeDependenciesForInputFile:ofType:variant:architecture:outputDirectory:inTargetBuildContext: Thread: {name = (null), num = 4} Backtrace: 0 0x00712276 -[PBXTargetBuildContext(DependencyGraphEvents) handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:] (in DevToolsCore) 1 0x0076cead XCAssertionFailureHandler (in DevToolsCore) 2 0x005fb85d -[XCCompilerSpecification computeDependenciesForInputFile:ofType:variant:architecture:outputDirectory:inTargetBuildContext:] (in DevToolsCore) 3 0x005e1daf -[XCCompilerSpecification computeDependenciesForFilePath:ofType:outputDirectory:inTargetBuildContext:] (in DevToolsCore) 4 0x005e1511 -[XCBuildRuleDGSnapshot computeDependenciesForFilePath:ofType:forBuildFileReference:withOutputDirectory:additionalProperties:inTargetBuildContext:] (in DevToolsCore) 5 0x005d5ccd -[XCResourcesBuildPhaseDGSnapshot computeDependenciesForBuildFileReference:inTargetBuildContext:] (in DevToolsCore) 6 0x005d3df4 -[XCBuildPhaseDGSnapshot computeDependenciesForAllBuildFileReferencesInTargetBuildContext:] (in DevToolsCore) 7 0x005d38a0 -[XCBuildPhaseDGSnapshot computeDependenciesInTargetBuildContext:] (in DevToolsCore) 8 0x005d5895 -[XCResourcesBuildPhaseDGSnapshot computeDependenciesInTargetBuildContext:] (in DevToolsCore) 9 0x005c84d9 -[XCProductTypeSpecification computeDependenciesInTargetBuildContext:] (in DevToolsCore) 10 0x005c42e0 -[XCNativeTargetDGSnapshot computeDependenciesInTargetBuildContext:] (in DevToolsCore) 11 0x005c1a4e -[PBXTargetBuildContext createDependencyGraphWithTargetDGSnapshot:] (in DevToolsCore) 12 0x005c0c8b -[PBXTargetBuildContext(DependencyGraphEvents) dg_setTargetSnapshot:] (in DevToolsCore) 13 0x960f3a3d invoking (in CoreFoundation) 14 0x960f3428 -[NSInvocation invoke] (in CoreFoundation) 15 0x005c06b1 -[PBXTargetBuildContext(DependencyGraphEvents) processDependencyGraphEvents] (in DevToolsCore) 16 0x960f3a3d invoking___ (in CoreFoundation) 17 0x960f3428 -[NSInvocation invoke] (in CoreFoundation) 18 0x005c001e -[XCInvocationQueue _processNextInvocationInThreadSlotNumber:] (in DevToolsCore) 19 0x005bfccd -[XCInvocationQueue _processInvocationsInThreadSlotNumber:] (in DevToolsCore) 20 0x9052f7ed -[NSThread main] (in Foundation) 21 0x9052f394 __NSThread__main (in Foundation) 22 0x92226095 _pthread_start (in libSystem.B.dylib) 23 0x92225f52 thread_start (in libSystem.B.dylib)

  Internal error occurred while creating dependency graph: ASSERTION FAILURE in /SourceCache/DevToolsBase/DevToolsBase-921/pbxcore/SpecificationTypes/XCCompilerSpecification.m:267

Details: arch should be a non-empty string, but it's an empty string Object: Method: -computeDependenciesForInputFile:ofType:variant:architecture:outputDirectory:inTargetBuildContext: Thread: {name = (null), num = 4} Backtrace: 0 0x00712276 -[PBXTargetBuildContext(DependencyGraphEvents) handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:] (in DevToolsCore) 1 0x0076cead XCAssertionFailureHandler (in DevToolsCore) 2 0x005fb85d -[XCCompilerSpecification computeDependenciesForInputFile:ofType:variant:architecture:outputDirectory:inTargetBuildContext:] (in DevToolsCore) 3 0x005e1daf -[XCCompilerSpecification computeDependenciesForFilePath:ofType:outputDirectory:inTargetBuildContext:] (in DevToolsCore) 4 0x005e1511 -[XCBuildRuleDGSnapshot computeDependenciesForFilePath:ofType:forBuildFileReference:withOutputDirectory:additionalProperties:inTargetBuildContext:] (in DevToolsCore) 5 0x005d5ccd -[XCResourcesBuildPhaseDGSnapshot computeDependenciesForBuildFileReference:inTargetBuildContext:] (in DevToolsCore) 6 0x005d3df4 -[XCBuildPhaseDGSnapshot computeDependenciesForAllBuildFileReferencesInTargetBuildContext:] (in DevToolsCore) 7 0x005d38a0 -[XCBuildPhaseDGSnapshot computeDependenciesInTargetBuildContext:] (in DevToolsCore) 8 0x005d5895 -[XCResourcesBuildPhaseDGSnapshot computeDependenciesInTargetBuildContext:] (in DevToolsCore) 9 0x005c84d9 -[XCProductTypeSpecification computeDependenciesInTargetBuildContext:] (in DevToolsCore) 10 0x005c42e0 -[XCNativeTargetDGSnapshot computeDependenciesInTargetBuildContext:] (in DevToolsCore) 11 0x005c1a4e -[PBXTargetBuildContext createDependencyGraphWithTargetDGSnapshot:] (in DevToolsCore) 12 0x005c0c8b -[PBXTargetBuildContext(DependencyGraphEvents) dg_setTargetSnapshot:] (in DevToolsCore) 13 0x960f3a3d invoking (in CoreFoundation) 14 0x960f3428 -[NSInvocation invoke] (in CoreFoundation) 15 0x005c06b1 -[PBXTargetBuildContext(DependencyGraphEvents) processDependencyGraphEvents] (in DevToolsCore) 16 0x960f3a3d invoking___ (in CoreFoundation) 17 0x960f3428 -[NSInvocation invoke] (in CoreFoundation) 18 0x005c001e -[XCInvocationQueue _processNextInvocationInThreadSlotNumber:] (in DevToolsCore) 19 0x005bfccd -[XCInvocationQueue _processInvocationsInThreadSlotNumber:] (in DevToolsCore) 20 0x9052f7ed -[NSThread main] (in Foundation) 21 0x9052f394 __NSThread__main (in Foundation) 22 0x92226095 _pthread_start (in libSystem.B.dylib) 23 0x92225f52 thread_start (in libSystem.B.dylib)

Build failed (1 error)

mattgolsen's picture
I was able to fix this error

I was able to fix this error by opening the project, going to "Project" > "Edit Project Settings" then selecting the second field "Architectures" hitting delete which should change the field to "i386". From there I double clicked "Base SDK Path", and inputted "/Developer/SDKs/macosx10.5.sdk" which should be the default value for 10.5

After that Build and Run worked with no issue!

dad1916's picture
Re: Simple Fullscreen QC App

Does this allow you to embed a qc composition with an application achieving a stand alone executable ?

I tried compiling but got this :

Line Location MainMenu.xib:0: Command /Developer/usr/bin/ibtool failed with exit code 1
Line Location MainMenu.xib:0:    Recovery Suggestion: Locate the com.apple.QuartzComposerIBPlugin Interface Builder plug-in to continue opening this document. Consider using the --plugin option or Interface Builder's plug-in preferences to resolve this dependency.
Line Location MainMenu.xib:0:    Description: Unable to resolve plug-in dependency for "MainMenu.xib".
Line Location MainMenu.xib:0: Internal Error:
Line Location MainMenu.xib:0: /* com.apple.ibtool.errors */

cwright's picture
Re: Simple Fullscreen QC App

I would suggest following the directions:

Interface Builder wrote:
Recovery Suggestion: Locate the com.apple.QuartzComposerIBPlugin Interface Builder plug-in to continue opening this document. Consider using the --plugin option or Interface Builder's plug-in preferences to resolve this dependency.

To install this, you should try first upgrading to the latest set of developer tools (iPhone SDK), and perhaps checking out /System/Library/Frameworks/Quartz.framework/Frameworks/QuartzComposer.framework/Versions/A/Resources/QuartzComposer.ibplugin/

(or this handy terminal command: open /System/Library/Frameworks/Quartz.framework/Frameworks/QuartzComposer.framework/Versions/A/Resources/QuartzComposer.ibplugin/)

dad1916's picture
Re: Simple Fullscreen QC App

Many thanks , got it working now.

ayalacortes's picture
Re: Simple Fullscreen QC App

Hi,

i'm not sure if this is possible but... can these lines from your example in AppController.m:

// hide the cursor
 
CGDisplayHideCursor (kCGDirectMainDisplay);

go somewhere in the code of the Quartz Builder app? So quartz builder could have an option to hide the mouse as well?

juan

cwright's picture
Re: Simple Fullscreen QC App

Those lines (plus some control logic to work around some missing features in Apple's API regarding this) are already in there.

Cursor hiding is already exposed from the template:

PreviewAttachmentSize
HideCursorQBTemplate.png
HideCursorQBTemplate.png92.86 KB

ayalacortes's picture
Re: Simple Fullscreen QC App

hmmmm of course... the template. Fantastic.... Thank you!

imagenero's picture
QCFullScreen + MSAQTPlayer MASHUP

Here is the XCODE file of a mash up of the QCFullScreen app with the MSAQTPlayer (form Memo Atken).

I made it to display a full screen app in 4 full HD monitors connected to a single computer with 2 graphics ati 5770 hd graphic cards.

I the xcode project you can put the screen size you need. mine was 3072x 1366.

The project only works in snow leopard (mac os 10.6.8)

Hope it is of some use.

Thanks Chris and Memo for sharing your code.

PreviewAttachmentSize
QCFullMultiScreen.zip99.32 KB