by badsectoracula · 1y ago · 0 comments
Because some applications do need multiple windows in the same application context. A common example would be image editors.
It is unfortunate that almost all generic MDI implementations (Win32 and Qt basically) are incredibly barebones. I want to have multiple windows visible when i'm using Krita, for example, but Qt's MDI support (that Krita does use) is worse than what Windows 95 had.
But my response was about calling MDI an anti-pattern in general. Just because it doesn't fit all cases, it doesn't mean it is an anti-pattern.
I stand by the anti-pattern comment. I think there are very, very few cases where ‘MDI’ is appropriate, and I put it in quotes because the things being managed in that case are almost never ‘documents’ in any meaningful sense (rather they're some kind of graph node). Functionality apps build with MDI is basically always independent of the actual app and would be better implemented in the window manager — and more often than not there's actually no additional functionality over even the lowest common denominator of window managers.
In theory you can have multiple toplevel windows with separate windows for the control stuff (tool window, tool options, panels, etc like GIMP has) but in that case you really need a virtual desktop dedicated to the application itself. Personally i prefer to dedicate virtual desktops to tasks (i have a fixed number of virtual desktops and their shortcut keys have become muscle memory over the years), so e.g. anything graphical goes into the same virtual desktop, but -say- GIMP in multiwindow mode feels awkward to use alongside Blender. Krita having an MDI mode is much better IMO, even if Qt's MDI support is primitive at best.