Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: GDC window at the top of the screen  (Read 12804 times)
Ernest D.
Posts: 18


« on: June 29, 2018, 01:48:34 pm »

Hello,

We have one minor problem. If we run GDC application more than once, the GDC will not appear at the top of the screen. The first run of the GDC is correct. Each next run of the GDC appears under the Window of other Application (for example Windows File Explorer). I know, if we used command line -n, the new GDC instance will start and the top, it is correctly. But we don`t want to run another new instance of GDC. Do you have any solution?

The issue is displayed in this video: https://www.screencast.com/t/8nhISwj4
Reuben B.
Four Js
Posts: 1049


« Reply #1 on: July 02, 2018, 12:49:15 am »

By "the GDC will not appear at the top of the screen", do you mean the GDC application will not have Windows focus, as opposed to the other possible meaning of the window y position = 0?.

If you mean the GDC application will not have Windows focus, and hence the GDC window does not showing in front of the other windows, this is due to the default behaviour of Windows operating system.  An application, In your case explorer.exe, can pass the focus to a new application, gdc.exe as in the case when you first double clicked.  A running application cannot steal the Windows focus from the current application, so when you start the second Genero app, you are effectively wanting the existing gdc.exe application to steal the focus from the explorer.exe application.

This Windows behaviour was introduced many Windows versions ago, either XP or Vista, and the best way to explain it, is if you recall early mail apps would popup a dialog saying 'You have mail, would you like to read it Yes/No' but you would be typing away in another app and if you weren't looking at the screen, then you might answer the dialog without realising it.  So this Windows behaviour was introduced so that an application e.g. Outlook.exe would not be able to steal the focus away from the current application e.g. Word.exe, but would instead flash in the taskbar.  If you look at your video carefully, you will see the GDC icon in the taskbar flashing when you launched the second Genero program.

When you use gdc -n, then it is launching another instance of gdc.exe so Windows focus can be passed to it, it is not a case of the existing gdc.exe trying to steal the focus.  You also may see this if you double-click on two .txt files, two instances of notepad.exe are started.

You can change this behaviour by changing the value of some registry settings.  Google "foreground lock timeout" and "foreground flash count" for more of an explanation.

Hope that helps,

Reuben








Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Leo S.
Four Js
Posts: 126


« Reply #2 on: July 02, 2018, 03:17:15 pm »

Ernest, if you did not yet use the -X (--close) command line option of gdc you might have a look at it if this works for you.

-X closes GDC if the last remote Genero app handled by this GDC closes.

So if you combine -n with -X (and probably also -M) you still have one Genero app per GDC , but closing the app doesn't cause the GDC to linger around , it closes together with the app (and starting with -n gives you the wanted focus behaviour).

The only drawback I see is that the Windows tray is filled then with multiple GDC icons, if this is an issue for you let us know.

Regards, Leo
Ernest D.
Posts: 18


« Reply #3 on: July 18, 2018, 02:36:42 pm »

Of course, we also use the -X command to close GDC. But we have several applications. Users often run several programs at the same time. The solution would be to use the -n command, but as you write, a problem is that the Windows tray is filled then with multiple GDC icons (see the link: https://www.screencast.com/t/RV2AetXoOo).

Regards, Ernest
Reuben B.
Four Js
Posts: 1049


« Reply #4 on: July 23, 2018, 01:03:17 am »

Ernest,

An observation from your second screencast, all your windows are named screen.  If you used http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_ClassInterface_setText.html and/or http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_ClassWindow_setText.html then you can get more meaningful text appearing in the window title and in the task bar.

You should also note that this issue is all about us respecting the Windows Operating System.  We are unable to break its rules with regards to programs assigning or grabbing the Windows focus, nor its rules regarding what appears in the taskbar.  A key to understand is to observe that the "program" in the Windows O/S eyes is "gdc.exe", not the fglrun process.  Using gdc -n, then you have multiple gdc.exe processes.  Also compare behaviour with other Windows applications.  if you were to double-click on two .txt files in Explorer, you get the behaviour you want but note in Task Manager that there is two notepad.exe processes running.  That is a new instance of notepad.exe was started for the second instance, the equivalent of gdc -n.  Interestingly if you double-click two pdf's or two html's etc, then you may observe that Adobe Reader, or your browser, comes to the foreground with the second document/webpage open in a new tab.  I'd be curious to know how they achieve that but that may imply an interface where each Genero application is a tab in the one GDC Window. ( a bit like the Genero Browser Client)

In your first screencast you are double-clicking an icon in Explorer to start multiple programs.  Is that what your users are going to do? or will you have a program, typically called names like a Main Menu program, also written in Genero that users will select the program they want to run from?  That solution shouldn't face the issue you are experiencing.  The gdc.exe has focus and hence Windows allows it to pass Windows focus to a new window.

Reuben


Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines