Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SaveFileDialog changes working directory, but only on Windows #130

Open
KnorrFG opened this issue Feb 25, 2021 · 0 comments
Open

SaveFileDialog changes working directory, but only on Windows #130

KnorrFG opened this issue Feb 25, 2021 · 0 comments

Comments

@KnorrFG
Copy link

KnorrFG commented Feb 25, 2021

EDIT2: By now I managed to figure out what was causing my problems. Code isn't neccessary. The Problem was that using a SaveFileDialog will change the working directory of the program to the folder in which the selected File is stored. BUT to add insult to injury, this is only the case for Windows, not for Linux. I dont think that's a real bug, but I think the behavior should be the same on both platforms.

Feel free to close this again if you disagree.


EDIT: Nvm, I was trying to reproduce the bug with a minimal example for hours, and in my delusion I forgot to add the required text file ... Ill reopen this once I manage to actually reproduce the problem ...


The following example will either crash, or freeze if compiled with --gc:arc

import nigui

app.init()

var 
    win = newWindow("Session Planer")
    drawing = newControl()

drawing.widthMode = WidthMode_Expand
drawing.heightMode = HeightMode_Expand
win.add(drawing)

drawing.onDraw = proc(ev: DrawEvent) = 
    discard readFile "foo.txt"
    quit(0)

win.show()
app.run()

The line where it freezes is the one with readFile.
This happens only on Windows 10 but not on Ubuntu. It happens with mingw and msvc. Tested with nigui 0.2.4 and 0.2.5 (the --gc:arc option was only tested with 0.2.4)

Btw, this might be related to #112

@KnorrFG KnorrFG closed this as completed Feb 25, 2021
@KnorrFG KnorrFG reopened this Feb 26, 2021
@KnorrFG KnorrFG changed the title Crash/freeze when opening Files SaveFileDialog changes working directory, but only on Windows Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant