Page MenuHome

Fix T70991 - File Explorer: Maximize window no the filename textbox on Windows
AbandonedPublic

Authored by Dalai Felinto (dfelinto) on Thu, Nov 14, 10:43 PM.

Details

Summary

Note, although this fix the immediate obvious issue there are still some
things that need fixing in this file browser.

Right now we store the window size when maximized, which we should not.

Diff Detail

Repository
rB Blender
Branch
fix-T70991-filebrowser-windows-maximize-wrong-style (branched from master)
Build Status
Buildable 5692
Build 5692: arc lint + arc unit

Event Timeline

Does this also work when switching between maximized and normal, multiple times? I.e. does the window stay a on-top-window with the minimize button disabled? If I remember correctly I disabled this call for dialog boxes to avoid messing with the window style in unwanted ways.


I don't think we should store the maximized state. Maximizing is something you sometimes do quickly, or even unconsciously and you wouldn't want this to be saved. We'd probably have to store the normal state window size then too, as you'd want it to un-maximize to this size.
If you want the filebrowser to be maximized by default, you can just as well use the full-screen option. Note that on Linux the window can't even be maximized.
IMHO we should just skip saving the window size when maximized.

Also the file browser is always opened in the top edge of the window, regardless of where it was moved to last time (unlike the console window or the view render for example).

William, Brecht and I decided to not store the position for now, and just always open it in the center, unless there's good reason to do so. Storing the position might be a bit problematic with multi-monitor and hiDPI setups, remember that this is stored and should to work when opened on different machines.
If the window is not opened in the center, that seems like a bug. Also, I'm not aware of console or render view storing any such information.

From review: Make sure minimizebox is never set for dialog windows

Does this also work when switching between maximized and normal, multiple times?

Yes (current version anyways, previous version always had minimizedbox on).

I don't think we should store the maximized state

Tackled separatedly: D6260

Julian Eisel (Severin) abandoned this revision.EditedFri, Nov 15, 3:39 PM

Note that the proposed fix still overrides the window style set when creating the dialog window, see https://developer.blender.org/diffusion/B/browse/master/intern/ghost/intern/GHOST_WindowWin32.cpp$272-278.

So I looked into a different fix that doesn't do this and found an issue with our usage of the WS_CHILD style flag. This is actually what was causing this bug.
Committed an alternate fix that removes the incorrect WS_CHILD flag, rBf641c60530fb.

Finding this would have taken much longer if you wouldn't have done the debugging and submitted this already, so at least your efforts weren't worthless :)

My coding efforts are never worthless fear nothing. Thanks for the review and addressing this.