File Window turns black after minimizing IMatch

Started by Ger, May 25, 2024, 09:50:52 AM

Previous topic - Next topic

Ger

When minimizing IMatch and restoring, the main screen turns black, only showing the main menu bar. All panels on the main screen disappear; if other panels are on supporting screens, they continue to be visible.

The issue resolves when closing/reopening IMatch or when changing workspace with the View > Workspaces option.
(Selecting other options from that menu bar will not rebuild the main screen).

I'm experiencing this with version 2023.9.2 (experimental mode on); Windows 11 Pro (23H2)

This behavior is repeatable; it happens every time IMatch is minimized

ger

Mario

I cannot reproduce this on two PCs and in a VM.
I see that IMWS has problems binding to a port, something is locking the port you have configured under Edit > Preferences > Applications. IMWS finally picks port 50622.

The license manager complains that you have not entered your email and license key under Edit > Preferences > Application. The automatic updater will not be able to download updates for you unless you provide this information.

Then:

Clearing CEF cache 'C:\ProgramData\photools.com\IMatch6\browser' failed.
Clear the folder manually in Windows Explorer. Check for invalid/insufficient file-system permissions of that folder in Windows Explorer.


IMatch tried to clear the cache folder for the integrated web browser but could not, for some reason. Virus checker? Group policy? Messed up file system permissions? Close IMatch and delete the folder. IMatch recreated it automatically on the next start.

That's all that I can see in the log file.
Could me a graphic card driver issue or just Windows wanting a full reboot.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ger

Mario,

QuoteI cannot reproduce this on two PCs and in a VM

Yes, that's what I am afraid of. I'm having this issue for some time now and have not seen it reported yet. Windows has been rebooted (complete shut down several times).

But I have no idea where/what this could cause. As far as I can see, only IMatch suffers this restore issue.



Other comments:

QuoteClearing CEF cache 'C:\ProgramData\photools.com\IMatch6\browser' failed.

Deleted the folder; it's a folder in ProgramData, not an area where I would regularly fool around. Virus checker is Windows Defender only.

QuoteThe license manager complains ...

I never bothered setting it up; your message in the forum normally tells me there's a new version...



Mario

QuoteI never bothered setting it up; your message in the forum normally tells me there's a new version...
Don't you use the Downloader in IMatch to download updates automatically?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ger

QuoteDon't you use the Downloader in IMatch to download updates automatically?
Old, grey hair, habits... :)


Mario

You should ;)
The Downot only tells you about new releases, but also downloads them, validates the certificates and allows you to update IMatch when you close it automatically. Comfy!

The Updater app will retire and downloading manually from the customer portal is a nuisance.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ger

Mario,

coming back to the original topic of the threat (the black screen). After installing the update (2023.14.2), the issue has disappeared. This version has the experimental features (ribbons, menus) disabled.

Version 2012.14.2 does not show turn to a black screen after minimizing. When turning of experimental features in 2023.12.2 the issue is gone as well.  This might be related and might give you an idea of what can happen.

ger

Mario

Very good. I have still no clue why only you were affected by this issue or what could cause it.
At least no other user ever reported this, I could not reproduce it either.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ger

I understand this is an isolated (but irritating) issue.

Any further information I can provide?

The issue happens on both laptop and desktop, with different monitors connected consistently when experimental features are on.

Mario

Could be anything. Even a graphic driver issue.
When happens when you maximize and restore the window? Windows then should repaint everything.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ger

Interesting.
Normally I have the IMatch main window defined on full screen (maximized). In that case, minimizing the window to task bar and restoring leads to black screen. 
However, if the window is not maximized, minimizing and restoring brings back the screen normally.



Mario

I can still not reproduce this, even with IMatch maximized. Tried with the current version and one back.
And with IMatch 2025, which is what I use on my PC.

Very weird. Graphic card driver issue or something else. I can see that Windows sends WM_PAINT to IMatch when it is restored and IMatch redraws anything.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ger

I totally understand that these issue fall under the category "(almost) impossible".

The workaround on non-maximized screen I did of course with 2023.12.2 (in 2023.14.2 I don't have the new ribbons).

But I see this happening on both desktop and laptop; and the laptop being connected to the same monitors as the desktop and also when connected to completely different monitors.


loweskid

I missed this thread originally but I've also had this issue for a while and assumed it was a problem with my graphics card (ancient by computer standards) - I have three monitors attached.  I could restore the screen just by grabbing the top of the window with the mouse and dragging it a fraction so it wasn't much of a problem.

Anyway, I've installed the latest version this morning and it's fixed the issue.

Mario

#14
Did you also use IMatch in maximized mode (if you can move the window, probably not)?
Was this dependent on experimental mode being enabled?
Was the IMatch window on the main monitor or another monitor?
Were one or more panels on other monitors?
Windows 10 or 11?



Quoteproblem with my graphics card (ancient by computer standards

I've recently replaced my old NVIDIA card (5 years old) with a new mid-range one.
AI performance is 300%, the new card is 1/2 the size of the old card and needs ~30W less in standby low-usage.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

loweskid

Quote from: Mario on August 05, 2024, 03:39:37 PMDid you also use IMatch in maximized mode (if you can move the window, probably not)?
Was this dependent on experimental mode being enabled?
Was the IMatch window on the main monitor or another monitor?
Were one or more panels on other monitors?
Windows 10 or 11?

1:  Either - I can move the window whether maximized or not.
2:  Exp - yes
3:  Main monitor
4:  Yes - 5 panels open on left monitor (App Manager, Notepad, Filter, Metadata, Keywords).  None on right monitor.
5:  Windows 10.

The whole computer is getting a bit ancient and won't support Windows 11 so I will probably be upgrading next year, if not sooner.


Ger

Quote from: Mario on August 05, 2024, 03:39:37 PMDid you also use IMatch in maximized mode (if you can move the window, probably not)?
Was this dependent on experimental mode being enabled?
Was the IMatch window on the main monitor or another monitor?
Were one or more panels on other monitors?
Windows 10 or 11?
1a: IMatch File Window maximized on main monitor. Click Minimize to taskbar. Restore from taskbar: result black screen.
1b: IMatch File Window not maximed on main monitor. Click Minimize to taskbar. Restore from taskbar: result ok (file window restores correctly)
2. Above happens with Experimental Features on (2023.12.2) (in 2023.14.2 I have no experimental features, and the black screen does not show.)
3. Main monitor (more monitors connected)
4. Happens with only panels on main monitor and panels open on other monitor
5. Windows 11

Mario

Thanks. Still cannot repro this with ribbons etc. enabled, on two computers (notebook with external monitor, desktop PC with two monitors).

I can only add some extra "redraw everything" function calls when the main window receives the "size restored" event.Windows paints the window automatically in this case, but who knows...
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

loweskid

Maybe something peculiar to the type of graphics card?  Mine's an AMD Radeon R9 200 series.

Mario

I've tested systems using NVIDA and Intel graphic cards. I don't have any AMD cards, I prefer NVIDIA because of CUDA.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ger

I saw the issue with the same database on two different computers: desktop with NVIDIA GeForce RTX 3070 and Win11; and HP laptop with Intel Iris Xe and Win11.

Mario

I believe you that you saw it. The question is how I can reproduce it, if at all, and if there are more than two users affected by this. I doubt that this depends on the GPU.

Was IMatch busy when you minimized it? E.g. scanning folders or something?
The File Window uses an overlay to dim itself to indicate it's busy when stuff is running. I tried that to, minimizing and restoring IMatch from maximized mode, but the repaint worked fine.

Until somebody figures out a way to reproduce this, I'm done with this. I've spent maybe an hour trying to reproduce this, on two PCs and even a virtual Windows installation. If I cannot reproduce it, there are no related warnings or errors logged to the log file, there is zip I can do, unfortunately. And it did affect only two users (so far)...
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Tveloso

I see this effect here as well.

I work on a Laptop only, and usually have an external monitor plugged in, with that monitor configured as the main display:

    Screenshot 2024-08-07 113939.png

I also usually work with IMatch in a Maximized state, and it's in this state where the issue happens.  So with IMatch Maximized (the Restore button is available), If I click the Minimize button (to minimize IMatch to the TaskBar):

    Screenshot 2024-08-07 104853.png

...when then clicking the IMatch Icon in the Task Bar:

    Screenshot 2024-08-07 104947.png

...or using Alt Tab, to bring the IMatch window back up, it comes up with the entire Screen (except the Title Bar and Menu Bar) black.

If I then click the Restore button:

    Screenshot 2024-08-07 105026.png

...the window re-paints, and everything is visible again.  IMatch is now in a Restored state (the Maximize button is visible):

    Screenshot 2024-08-07 105326.png

If the Window is minimized from a Restored State, the issue does not happen - it's only when IMatch is minimized from a Maximized State that it happens.  I also noticed that the Size and Position of the IMatch main window is nearly identical, between the Maximized and Restored States on my PC (even when I have resized the Restored IMatch window in the past).

Also, when the external Monitor is not plugged in, this does not happen at all...(when IMatch is restored from a Minimized state - whether back to a Maximized or Restored state - everything is always visible).
--Tony

Mario

#23
I could finally reproduce it, but only in a very specific combination. Plugging in my secondary monitor into HDMI instead of DP causes this to happen...

When I maximize IMatch on the "main" monitor (2) and then minimize and restore it, Windows does send the required "size changed" messages.

When I move the IMatch window on the secondary monitor (1) and to the same steps, Windows sends the required messages.

When I move IMatch back to the main monitor and turn disable the second monitor (in display settings), and maximize, minimize, restore the IMatch window, window sends the required messages again.

So this happens only when a secondary monitor is active (in a specific port, in my case).
Windows then does not longer send the resize messages to IMatch and IMatch has no clue that it should re-position the inner part of the window (where the Views are).

I've tried various things, including setting a flag when the window is maximized, forcing a resize and repaint of the inner client area. Not even that helps. It seems Windows is ignoring everything, including resizing the client are and repainting it - unless the IMatch window is restored or "wiggled slightly" or resized by as little as one pixel.
And only when I plug in the second monitor into a specific port.

I could not find anything about this behavior. But since IMatch does not get the messages, it does not know.
I'll put this into the queue, but I don't expect a solution soon. I have never heard about this, I could not find anything on Google  etc.

Why should Windows stop sending messages when two monitors are connected? And only when IMatch is on the right monitor (in my case) but not when it is on the left monitor (both 4K monitors)...

Easy workaround: Don't maximize the window, just make it as large as possible (hold down <CTRL> to avoid Windows' automatically docking/sizing).

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ger

Thanks, Mario.

Quote from: Ger on August 05, 2024, 11:50:09 AMInteresting.
Normally I have the IMatch main window defined on full screen (maximized). In that case, minimizing the window to task bar and restoring leads to black screen.
However, if the window is not maximized, minimizing and restoring brings back the screen normally.



Based on your analysis last week, I was already using the workaround to not maximize the window. Hopefully a solution can be found, if not, we will have to live with this workaround.

ger

Mario

Now that I could reproduce it, I could fix it   

The problem was caused, as a side-effect, by the bug fix for this bug.
The bug fix solves the problem that a maximized IMatch window is actually a few pixels to narrow, leaving a few pixels of the background shine through.

The reason is unknown, but when Windows maximizes the IMatch window, it calculates the monitor size wrong.
IMatch counteracts by asking Windows for the monitor work rectangle  of the monitor containing the IMatch window, and then uses that rectangle to correctly size the IMatch window when the user maximizes it.

The problem reported in this thread is caused because, when the IMatch window is minimized and then maximized again, the code in IMatch that asks Windows for the monitor work rectangle of the monitor containing the IMatch window returns the wrong result. In my case, it did not return the rectangle of the monitor containing IMatch (0,0,3840,2088) but the rectangle of the left (secondary) monitor, which is -3840,0,0,2088. And since IMatch calculates the maximized window size based on that, the client area (the part inside the IMatch frame) became invisible (moved outside of the actual monitor).

The reason for all this is that Windows apparently cannot find the monitor for a minimized window (and falls back to using a "nearest" or the "primary" monitor). Which caused the wrong result. It's all a bit random, apparently.

After studying the docs, I've changed things so that IMatch knows when Windows cannot find the monitor. IMatch then uses the cached size it set when the Windows was maximized to restore the correct maximized size (else we would have the problem again that a few pixels on all four sides are not filled by the maximized IMatch window).
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Jingo

Mario - your tenacity to track down strange behavior and bugs never ceases to amaze me!!

Mario

Quote from: Jingo on August 08, 2024, 02:59:58 PMMario - your tenacity to track down strange behavior and bugs never ceases to amaze me!!
Yeah, this took a while to figure out. But I have a "bugs come first" rule. When a bug is reported and I can reproduce it, I fix it - before working on other things. This avoids unfixed bugs piling up, which is the death of every project.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook