Hybrid View

    You found a bug! We've classified it as ION-1037 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    66
    Vote Rating
    3
    Lukappa is on a distinguished road

      0  

    Default Answered: [FREQ] Multiple instance of same app on Linux & Windows

    Answered: [FREQ] Multiple instance of same app on Linux & Windows


    Hello,
    I just found there is an issue with the packaged version for Windows (7) and Linux (Ubuntu).

    If I try to open my app on MacOS, everything is ok, I can see the window and supposing I'm going to minimize it, than to restore by clicking on the app icon (in Application folder), the same window will be restored (same instance/window).

    Doing it with Ubuntu / Windows, the OS will create multiple instances/windows of same app.
    Is it normal behaviour? Am I missing something during the packaging task? How to avoid this?

    Thank you

  2. This is actually expected behavior, not a "bug"...though if you wish it not to happen, this is certainly a valid concern. A little background:

    OS X uses a "new window" paradigm, where an application bundle runs only a single instance of itself, but the user can create new windows for fresh "instances" of the same app, for example...just like creating a new window of Safari or Chrome.

    On Windows & Linux, the same process can have multiple running instances, which is totally a valid occurrence and often times desired. For example, Sencha Architect can have multiple instances running if a user wants to work on multiple projects at the same time. When Desktop Packager multi-window support comes around, the need for multiple instances will be gone.

    Fortunately, you can use the same technique that a lot of applications implement on Windows & Linux to force a single-running instance, as a stop gap until we decide to make this a configuration option. In your main startup JavaScript code, you can run Ion.sys.exec() on Windows & Linux to query for a list of running processes on the system. If there is more than one running instance in that list, you can call Ion.app.exit() to quit the process. Pseudo-code would look something like this:

    Code:
    var exeName = 'MyApp',
        processes;
    if (Ion.sys.os === 'windows') {
        processes = Ion.sys.exec('tasklist');
        exeName += '.exe';
    } else if (Ion.sys.os === 'linux') {
        processes = Ion.sys.exec('ps -A');
    }
    
    if (numMatches(processes, exeName) > 1) {
        Ion.app.exit(/* optional error code here */);
    }
    I'll create a ticket for this request for adding in this ability on the runtime side as a config option. Thanks!

  3. #2
    Sencha - Desktop Packager Dev Team jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747
    Answers
    20
    Vote Rating
    7
    jarrednicholls will become famous soon enough jarrednicholls will become famous soon enough

      0  

    Default


    This is actually expected behavior, not a "bug"...though if you wish it not to happen, this is certainly a valid concern. A little background:

    OS X uses a "new window" paradigm, where an application bundle runs only a single instance of itself, but the user can create new windows for fresh "instances" of the same app, for example...just like creating a new window of Safari or Chrome.

    On Windows & Linux, the same process can have multiple running instances, which is totally a valid occurrence and often times desired. For example, Sencha Architect can have multiple instances running if a user wants to work on multiple projects at the same time. When Desktop Packager multi-window support comes around, the need for multiple instances will be gone.

    Fortunately, you can use the same technique that a lot of applications implement on Windows & Linux to force a single-running instance, as a stop gap until we decide to make this a configuration option. In your main startup JavaScript code, you can run Ion.sys.exec() on Windows & Linux to query for a list of running processes on the system. If there is more than one running instance in that list, you can call Ion.app.exit() to quit the process. Pseudo-code would look something like this:

    Code:
    var exeName = 'MyApp',
        processes;
    if (Ion.sys.os === 'windows') {
        processes = Ion.sys.exec('tasklist');
        exeName += '.exe';
    } else if (Ion.sys.os === 'linux') {
        processes = Ion.sys.exec('ps -A');
    }
    
    if (numMatches(processes, exeName) > 1) {
        Ion.app.exit(/* optional error code here */);
    }
    I'll create a ticket for this request for adding in this ability on the runtime side as a config option. Thanks!

  4. #3
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    66
    Vote Rating
    3
    Lukappa is on a distinguished road

      0  

    Default


    I was thinking about this solution but I was a little scared about this kind of process handling.
    Thank you for your answer.

  5. #4
    Sencha User
    Join Date
    Dec 2007
    Posts
    115
    Answers
    1
    Vote Rating
    12
    corvonero will become famous soon enough

      0  

    Default


    Quote Originally Posted by Lukappa View Post
    I was thinking about this solution but I was a little scared about this kind of process handling.
    Thank you for your answer.
    I agree this is "scary" ... but in the meantime, probably the only way to go... M.

  6. #5
    Sencha User
    Join Date
    Nov 2013
    Posts
    1
    Vote Rating
    0
    anindo is on a distinguished road

      0  

    Default


    can u send me the complete code of how to stop opening multiple instances of the same program in linux.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar