Comment 29 for bug 168422

Revision history for this message
LucaDC (lucadc) wrote :

Great. That's exactly what I meant. Thanks Diederik.

Just one thing:
 - create a new document;
 - save it as non maximized;
 - reopen it (it's correctly restored);
 - modify, maximize and save it again (or close Inkscape and answer 'Save' :-) ;
 - reopen (it is correctly set as maximized) and restore normal size: the window is at its minimum allowable size.

Looking at the files I've found that when saving in maximized state that's what is saved (my desktop is a 1280x1024, status bar on the bottom):
     inkscape:window-width="1280"
     inkscape:window-height="976"
     inkscape:window-x="-4"
     inkscape:window-y="-4"
     inkscape:window-maximized="1"

Ok for the last, but shouldn't the other be the original size and position?

Also, I've changed the border size in Windows screen preferences: it was set to 1 (normal border) and I set it to 10.
That's what's saved in maximized state:
     inkscape:window-width="1280"
     inkscape:window-height="958"
     inkscape:window-x="-13"
     inkscape:window-y="-13"
     inkscape:window-maximized="1"

I think that those -4,-4 or -13,-13 (and 958 because my status bar now is thicker) are meaningless as they can change from system to system, so why not leaving the original non maximized state?

I also tried saving the (non maximized) window with negative coordinates and it worked: the negative coordinates were restored.
I don't think it's a good idea though, because new windows should always appear entirely on screen. What if for some reason the file gets corrupted (or simply saved under a system that manages negative coordinates) and then the window is completely out of screen? Or maybe only the useful active areas (e.g. the file menu or the toolbar) are out of screen: you may have difficoulties in closing the program.
I just tried modifying the coordinates to -2000, -1000 and it worked: the window is completely out of screen, non reachable. I could close it only through the status bar with right-click -> Close.
I suggest (again, sorry for that) cropping negative coordinates to 0,0 and cropping too large sizes to visible screen size but only after moving to 0,0 so the window is shrinked only if it can't entirely fit on screen.
More in details:
 - is width>visible screen width? -> set it to screen width;
 - is height>visible screen height? -> set it to screen height;
 - is x<0? -> set it to 0;
 - is y<0? -> set it to 0;
 - is the right side of the window out of visible screen? -> move the window left so its right side is at the end of the visible screen;
 - is the bottom side of the window out of visible screen? -> move the window up so its bottom side is at the edge of the visible screen;
All these considering the border width, so window's size is its complete size, including borders.

About restoring the full screen mode, I agree with you: it could be confusing and also there is not a so big difference from maximized and fullscreen to justify adding a case to manage (and maybe bugs) or complaints about it.

Feel free to discard everything if you think it's not so critical.
Thanks again for the fix.