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

Allow only one instance of a file #97

Closed
mica opened this Issue Jan 24, 2016 · 12 comments

Comments

Projects
None yet
3 participants
@mica

mica commented Jan 24, 2016

If a file is already open, activate the window, don't create a new one.

@mike-ward

This comment has been minimized.

Show comment
Hide comment
@mike-ward

mike-ward Jan 24, 2016

Owner

How do others feel about this?

Owner

mike-ward commented Jan 24, 2016

How do others feel about this?

@cyotek

This comment has been minimized.

Show comment
Hide comment
@cyotek

cyotek Jan 24, 2016

Not that it helps, but I'm ambivalent either way.

cyotek commented Jan 24, 2016

Not that it helps, but I'm ambivalent either way.

@mike-ward mike-ward added the on hold label Feb 11, 2016

@mike-ward

This comment has been minimized.

Show comment
Hide comment
@mike-ward

mike-ward Feb 12, 2016

Owner

Doesn't seem to be much interest in this one.

Owner

mike-ward commented Feb 12, 2016

Doesn't seem to be much interest in this one.

@mike-ward mike-ward closed this Feb 12, 2016

@mica

This comment has been minimized.

Show comment
Hide comment
@mica

mica Feb 13, 2016

But this is just kind of the basic expected behavior of any app. Lack of commentary here doesn't mean it's not worth implementing.

mica commented Feb 13, 2016

But this is just kind of the basic expected behavior of any app. Lack of commentary here doesn't mean it's not worth implementing.

@mike-ward

This comment has been minimized.

Show comment
Hide comment
@mike-ward

mike-ward Feb 13, 2016

Owner

Notepad doesn't work that way.

Owner

mike-ward commented Feb 13, 2016

Notepad doesn't work that way.

@mica

This comment has been minimized.

Show comment
Hide comment
@mica

mica Feb 13, 2016

True, but that's the only example I can think of, and it's mainly because it's a 30 year old app.

mica commented Feb 13, 2016

True, but that's the only example I can think of, and it's mainly because it's a 30 year old app.

@mike-ward

This comment has been minimized.

Show comment
Hide comment
@mike-ward

mike-ward Feb 13, 2016

Owner

Which apps behave this way?

Owner

mike-ward commented Feb 13, 2016

Which apps behave this way?

@mica

This comment has been minimized.

Show comment
Hide comment
@mica

mica Feb 13, 2016

Just a quick survey of some apps I have here:

  • MS Office
  • Anything Adobe (e.g. Photoshop, Illustrator)
  • Sublime Text
  • PowerShell ISE
  • Ableton Live
  • Cinema 4D

mica commented Feb 13, 2016

Just a quick survey of some apps I have here:

  • MS Office
  • Anything Adobe (e.g. Photoshop, Illustrator)
  • Sublime Text
  • PowerShell ISE
  • Ableton Live
  • Cinema 4D
@mike-ward

This comment has been minimized.

Show comment
Hide comment
@mike-ward

mike-ward Feb 13, 2016

Owner

With the exception of Sublime Text, none of these are text editors.

They're also "heavy" programs (Sublime Text excluded) that take a while to startup.

Most of these programs also lock the files their editing.

In other words, they're the opposite of MDE. MDE is light, minimal and single purpose.

I can see the utility in what you're asking but it requires interacting with system services at program start up time. MDE is quick to start (especially for a WPF program). That's no accident. I worked hard to make sure that first screen arrives quickly.

Checking if MDE is running elsewhere and is editing the file you clicked slows start-up (I've done this in other programs so I have some experience here). So while it may be a useful feature, the downsides (IMO) out-weigh the benefits.

Owner

mike-ward commented Feb 13, 2016

With the exception of Sublime Text, none of these are text editors.

They're also "heavy" programs (Sublime Text excluded) that take a while to startup.

Most of these programs also lock the files their editing.

In other words, they're the opposite of MDE. MDE is light, minimal and single purpose.

I can see the utility in what you're asking but it requires interacting with system services at program start up time. MDE is quick to start (especially for a WPF program). That's no accident. I worked hard to make sure that first screen arrives quickly.

Checking if MDE is running elsewhere and is editing the file you clicked slows start-up (I've done this in other programs so I have some experience here). So while it may be a useful feature, the downsides (IMO) out-weigh the benefits.

@mike-ward

This comment has been minimized.

Show comment
Hide comment
@mike-ward

mike-ward Feb 13, 2016

Owner

OK, I looked into this further. It's about a 100 ms hit to check running instances. Less if there are no other instances running. That's acceptable. However, I don't have a way to interrogate the other process to see what file is has open. Thoughts on this anyone?

Owner

mike-ward commented Feb 13, 2016

OK, I looked into this further. It's about a 100 ms hit to check running instances. Less if there are no other instances running. That's acceptable. However, I don't have a way to interrogate the other process to see what file is has open. Thoughts on this anyone?

@mike-ward mike-ward reopened this Feb 13, 2016

mike-ward added a commit that referenced this issue Feb 13, 2016

@mike-ward

This comment has been minimized.

Show comment
Hide comment
@mike-ward

mike-ward Feb 13, 2016

Owner

I have something working. I ended up going old school (very old school) and sending old fashioned window messages to interrogate the other MDE processes. I'll have to "live" with this for a while to shake out any bugs/crashes before releasing it. Whenever I have to dip down into allocating memory blocks and marshalling I get nervous about stability.

I doubt this will work with multiple (virtual) desktops due to the nature of window broadcast messages.

Owner

mike-ward commented Feb 13, 2016

I have something working. I ended up going old school (very old school) and sending old fashioned window messages to interrogate the other MDE processes. I'll have to "live" with this for a while to shake out any bugs/crashes before releasing it. Whenever I have to dip down into allocating memory blocks and marshalling I get nervous about stability.

I doubt this will work with multiple (virtual) desktops due to the nature of window broadcast messages.

@mike-ward mike-ward added fixed and removed on hold labels Feb 13, 2016

@mike-ward mike-ward closed this Feb 20, 2016

@mica

This comment has been minimized.

Show comment
Hide comment
@mica

mica Feb 20, 2016

Thanks for sorting this out, Mike. Future would-be accidental-multiple-instance-opening-people will be grateful.

mica commented Feb 20, 2016

Thanks for sorting this out, Mike. Future would-be accidental-multiple-instance-opening-people will be grateful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment