Yellow border around thumbnail: narrow and wide: difference?

Started by ubacher, April 07, 2018, 05:02:03 PM

Previous topic - Next topic

ubacher

When I select a file with the mouse it also gets focused and it gets a yellow border.

I focused a file using a script and this file also gets a yellow border but a thinner one.
So I consulted the help file (new and old) to find information - but no luck.

(If I press enter to start the viewer on such a "script-focused i.e. narrow yellow frame"  file nothing happens)

Mario

The focus border is drawn thicker if the file window has the input focus (it is the active window).
You can figure that out easily by clicking on a file, and then clicking in another panel.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

It turns out that if I run an app (I also tested one that does nothing) then after closing the app (the window) the focus has gone
and I can not get it back other than clicking the file again. (I tried using IMatch.focusWindow)
????????
Don't know where to look/ what to try next.

Mario

I'm not sure what you are trying to accomplish.
When you run apps, switch to the browser or other applications windows will focus whatever window you click on or select by other means.
When you make IMatch active after another application was active, Windows sets the focus to the IMatch main window.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

1. Select a GIF file
2. Run the GIF app, close it
3. The focus on the file has gone.
(This means you have to click the file again if you need a focused file.)

I tried setting the focused file from within a app and this did not work. This is how I
got to notice this matter and this (having a focused file) is what I want to achieve.

Mario

Quote2. Run the GIF app, close it
3. The focus on the file has gone.

You click on the App Panel to run the app (or the App Manager, or whatever). This makes this window the active window, windows moves the focus to that window.

I'm still not sure what you want do do.
Do you perhaps want to make the active window the file window, from your app?
Where does your app run? App panel? Modal window?

Modals app windows attempt to set the focused window to the window that was focused when you modal was opened, Which may be the App Manager panel, the App Panel, a Favorite or maybe something else, when one app starts another app...
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

How do I set the focused window via script?
I tried the following script starting from a M&F window:
$(document).ready(function () {
            IMatch.focusWindow('mediafolders.filewindow')
        })


but it does not focus on the window.

If I run this in a non-modal window the window stays focused until I close the app window.

Mario

What do you mean "script starting from ..." ?
When you open a modal window for your script, Windows will place the focus to the new window. And the modal will restore the original focus when it closes.
Or do you start your app in an app panel? Via the App Manager? Favorite?

Did you try using a setTimeOut in your script to give Windows a few seconds to manage all windows focus changes before you forcefully focus a Window?
Focus management in Windows is not easy, and IMatch apps can do nothing to overcome this.
Note: When you run your app in a modal, the modal will focus the window that was active then the modal was opened. If possible in the current situation.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

QuoteAnd the modal will restore the original focus when it closes.
Does not. That's what I try to resolve. But the problem is not restricted to Apps. If I run anything
from the Favorites Panel it does not return the focus back.

And I tried all kinds of variations, including waiting as you suggest, to get Imatch.focusWindow to work.
Since this loss of focus happens often I can live with it if I can not set it via an app. It would just save the
user a click. (But, as you state, this (focus not returning to original window) should actually not happen.)

Mario

If you start something from the Favorites panel it is very likely that a dialog opens or that a panel is focused. The Favorites panel cannot "return the focus back" to anything.

You still did not tell me what kind of app you run.
As I said, when you try to set the focus to the file window from a modal app and then close the app, the focus will be set to another window.
setFocus should work from an app in the AppPanel (that's what is is designed for) or also while your modal app is still running. Just don't click around or do anything that causes Windows to focus another window.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

Just in case this is not known to you: If you run a modal app, it runs in a modal window. A modal window blocks the spawning application (IMatch), making it inactive.
Windows does not allow you to set the focus to an inactive window or e child window of it. Hence your attempt to use setFocus from a modal app is futile.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

But a non-modal app does not do this focusing either. Probably because when you click the X to close the app the focus
is set to the (now closing) window. (My guess - since no window seems to be focused after.)

Mario

Where do you click X to close an app? You cannot !"close" an app in the App panel.
Clicking the X means closing the modal window running the app, and for this case, see my statement above.
As soon as you "click" somewhere Windows places the input focus on the clicked button or whatever.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook