openFrameworks icon indicating copy to clipboard operation
openFrameworks copied to clipboard

ofSystemLoadDialog and ofSystemSaveDialog error ?

Open eloimaduell opened this issue 12 years ago • 16 comments

The error i guess is that draw is not drawing anymore on screen ... so maybe GLcontext is lost ?

If i use OF 0.84 i got errors on both, load and save. If i get the ofSystemUtils.cpp from Github and put it on the OF 0.84 the load dialog problem is solved, but not the load dialog problem ...

I experienced this with XCode 5 and OSX 10.9.1 if that helps ...¿?

This is what i see if i resize the window when draw is not working ... nice GL glitch ;) screenshot 2014-10-23 02 37 54

eloimaduell avatar Oct 23 '14 00:10 eloimaduell

i think i solve it ... http://forum.openframeworks.cc/t/ofsystemloaddialog-and-ofsystemsavedialog-hangs-draw-solved/15024/5

The only change i made to make it working was in

oFileDialogResult ofSystemSaveDialog(string defaultName, string messageName){ #ifdef TARGET_OSX

and just put the GLcontext operation at the beginning ... so changing from :

NSSavePanel * saveDialog = [NSSavePanel savePanel];
NSOpenGLContext *context = [NSOpenGLContext currentContext];

to

NSOpenGLContext *context = [NSOpenGLContext currentContext];
NSSavePanel * saveDialog = [NSSavePanel savePanel];

and now it works wink

eloimaduell avatar Oct 23 '14 00:10 eloimaduell

does this also occur on the current master branch?

bilderbuchi avatar Oct 23 '14 05:10 bilderbuchi

I can't reproduce the error in master nor in 8.4 release. strange... OSX 10.9.5 Xcode Version 6.0.1

wasawi avatar Oct 23 '14 11:10 wasawi

I double-checked ... and it's weird ... we where talking with @wasawi and we got different results with same example ...

Summary : I've XCode 5.02 in OSX 10.9.1 ...

  • using OF_084 ...

... downloaded OF0.84 from website. Compiling the "fileOpenSaveDialogExample" and running release app ... Press , save dialog opens ... i select a jpg file ... Click ok, dialog closes. Now i rescale window and ... shit ... GL glitch comes ... ( same same with @wasawi in XCode 6.01 and OSx 10.9.5 and he can't reproduce the error) ?!?!

If i do the suggested changes of @ofTheo in the forum : http://forum.openframeworks.cc/t/ofsystemloaddialog-and-ofsystemsavedialog-hangs-draw-solved/15024/3 ..... then Load is corrected ... and to correct the Save i've to do the change I posted here ...

  • using GitHub Master branch ...

Again ... error on SaveDialog ... LoadDialog works ok ... but Save doesn't ! GL glitch comes again ... ?¿

If i make the suggested change in oSystemSaveDialog:

from

NSSavePanel * saveDialog = [NSSavePanel savePanel]; NSOpenGLContext *context = [NSOpenGLContext currentContext];

to

NSOpenGLContext *context = [NSOpenGLContext currentContext]; NSSavePanel * saveDialog = [NSSavePanel savePanel];

it works well ...

??¿¿ totally confused why other people doesn't see this issue ... ?¿ is an XCode 5.01 issue ? or OSx 10.9.1 ?¿

eloimaduell avatar Oct 23 '14 12:10 eloimaduell

hm, could some @openframeworks/macos devs take a look at this?

bilderbuchi avatar Nov 16 '14 20:11 bilderbuchi

I can't seem to reproduce this though I'm not 100% certain what to look for - @eloimaduell could you provide a bit more info:

  • Steps to Reproduce
  • Expected Behavior
  • Actual Behavior

ghost avatar Nov 17 '14 20:11 ghost

I have the same issue with XCode6.3.2 OF 0.8.4 on OSX 10.10.3 The strange thing is that it only started happening after running the same app a few times! So the first few times I compiled and ran the app it worked fine, then all of a sudden it stopped working. I did see some weird shareKit errors popping up:

NSSoftLinking - The ShareKit framework's library couldn't be loaded from /System/Library/PrivateFrameworks/ShareKit.framework/Versions/A/ShareKit.

I'll try to investigate further.

timknapen avatar Jun 16 '15 00:06 timknapen

@timknapen if you have a spare moment and can get a solid repro case down, could you please try to reproduce on the master branch as quite a lot has changed since the 0.8.4.

ghost avatar Jun 16 '15 00:06 ghost

@pizthewiz yes, i'll try it as soon as possible

timknapen avatar Jun 16 '15 00:06 timknapen

@pizthewiz I dowloaded the 0.9.0 master branch as a zip, but it doesnt include an emptyExample for Xcode. Any idea if there's an example project I can start from to test this?

timknapen avatar Jun 16 '15 08:06 timknapen

it's easier to use the nightly builds, you can find them in http://openframeworks.cc/downloads

arturoc avatar Jun 16 '15 09:06 arturoc

thanks @arturoc I'll try that

timknapen avatar Jun 16 '15 09:06 timknapen

@arturoc is there no nightly build for OSX?

timknapen avatar Jun 16 '15 09:06 timknapen

yes: http://192.237.185.151/versions/nightly/of_v20150616_osx_nightly.zip

arturoc avatar Jun 16 '15 09:06 arturoc

@pizthewiz i tried with the main branch (the one @arturoc linked to). I can perfectly reproduce the problem in this version with this simple code: ( on OSX 10.10.3 , OF0.9.0, XCode 6.3.2 )

/// ofApp.h
#pragma once

#include "ofMain.h"

class ofApp : public ofBaseApp{

public:
    void setup();
    void update();
    void draw();
    void keyPressed(int key);
    bool bShowLoadDialog;
};

and

// ofApp.cpp
#include "ofApp.h"

//--------------------------------------------------------------
void ofApp::setup(){
    ofBackground(255);
    bShowLoadDialog = false;
}

//--------------------------------------------------------------
void ofApp::update(){

}

//--------------------------------------------------------------
void ofApp::draw(){
    ofSetColor(0);
    ofDrawBitmapString("Drawing frame nr "+ofToString(ofGetFrameNum()), 15, 15);

}

//--------------------------------------------------------------
void ofApp::keyPressed(int key){
    bShowLoadDialog = true;
    if(bShowLoadDialog){
        bShowLoadDialog = false;
        cout << "Show the file dialog" << endl;
        ofFileDialogResult dialogResult = ofSystemLoadDialog();
    }
}

after opening the load file dialog and closing it again (click cancel), the drawing of the OF view doesn't restart.

timknapen avatar Jun 17 '15 00:06 timknapen

The weird thing with bShowLoadDialog = true; in keyPressed is because I first tried

if(bShowLoadDialog){
        bShowLoadDialog = false;
        cout << "Show the file dialog" << endl;
        ofFileDialogResult dialogResult = ofSystemLoadDialog();
    }

inside update(); and then moved it into keyPressed()

timknapen avatar Jun 17 '15 00:06 timknapen