Windows XP: window opens about 20px lower than requested

Bug #168422 reported by Birdsaregood
4
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Low
Diederik van Lierop

Bug Description

When I open Inkscape, it very often opens as a window as big as the
computer screen, except it is moved to the right and down. This makes it so
part of the program (bottom-right) cannot be viewed. I always have to make
the program full screen before I can properly size it, and this has been
getting annoying.

Details: Windows XP, Inkscape 0.45, 17" screen, 1280 by 1024 pixels.

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Originator: NO

The size and place of your window is saved in the default template. Did
you change it?

Revision history for this message
Birdsaregood (birdsaregood) wrote :

Originator: YES

It is altogether possible that I accidentally changed it, because I
neither know what a default template is nor how to change it.

Revision history for this message
Birdsaregood (birdsaregood) wrote :

Originator: YES

I found the default template, and I played with it. It saved the page
dimensions I made in it, but not the zoom size, page size, and I don't know
if it saved the window location either.

Revision history for this message
Birdsaregood (birdsaregood) wrote :

Originator: YES

And BTW: I didn't change that file before seeing this annoyance of poorly
sized windows.

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Originator: NO

Can you please provide a screenshot of the wrong behavior?

Revision history for this message
Birdsaregood (birdsaregood) wrote :

Originator: YES

It happens only when I open an existing svg file - not when I just open
Inkscape. The problem is that I have to drag or resize the screen before I
can see the bottom of the program -- every time I open a file.
File Added: printscreen.jpg

Revision history for this message
Birdsaregood (birdsaregood) wrote :

Originator: YES

(I drew that blue splash screen in the screenshot, BTW. Based on current
one.)

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Originator: NO

Ah. So, what's the bug? The size and placement of the window are saved
with the file. Your file probably comes from a computer where the task bar
is at the top, hence it's moved down. Just maximize it on your computer,
change anything in the file, undo, and save. Next time it will open in the
correct (for you) position.

Revision history for this message
Bug Importer (bug-importer) wrote :

My taskbar is at the bottom, as you can see in the screenshot. I do
maximize the screen often, sometimes I don't, but it doesn't seem to
matter. Whenever I open a file it is as big as the screen and moved down
about twenty pixels.

Revision history for this message
Bug Importer (bug-importer) wrote :

I don't know why you closed the bug. It seems to be a real problem.

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Originator: NO

can you attach that svg file here please?

Revision history for this message
Bug Importer (bug-importer) wrote :

https://sourceforge.net/tracker/index.php?func=detail&aid=1671402&group_id=93438&atid=604309

But what about the window size? I don't want to resize the window each and
every time I open a file!

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Originator: NO

The inkscape045.svg file has:

     inkscape:window-width="1280"
     inkscape:window-height="968"
     inkscape:window-x="-4"
     inkscape:window-y="-4"

which means it must open at the top of screen. And indeed it does here on
Linux. Is this not the case for you on windows? Please try the exact file
that you linked to.

Revision history for this message
Bug Importer (bug-importer) wrote :

I tried. It opens just like in the screenshot, just like every other file:
"full screen", slightly off the the right, and about twenty pixels down.
Can you try this on Windows? Or do you know of a way I can fix this?

Revision history for this message
Bug Importer (bug-importer) wrote :

And when I moved the taskbar to the top, the program still opened in the
same way - 20 px down. (However, this only blocked a little bit of the top
of the program, not the bottom of the program.)

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Originator: NO

OK, I tried it on two WinXP laptops: on one with 1000x800 screen the file
loads OK, but on another with 1280x1024 it indeed always loads with a
shift. Strange. Probably something windows-specific.

Revision history for this message
Lemerou (lemerou) wrote :

Originator: NO

Same bug on a fresh install of windows xp sp2 and inkscape 0.45

nightrow (jb-benoit)
Changed in inkscape:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
John Cliff (johncliff) wrote :

I see this too. For some reason the windows line up with the bottom of the screen when restored. Its like its ignoring the taskbar.
Shift doesnt seem constant either, seems to be somehow related to window size in the y direction. shifts further if you make the window smaller before save.

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

Inkscape apparently discards negative window positions, such as the (-4,-4) mentioned above for a maximized window on Windows XP. This has just been fixed, as of rev. #21407. I've also tested this on Fedora, and it doesn't seem to cause any side effects. If I missed something then please let me know.

Changed in inkscape:
assignee: nobody → Diederik van Lierop (mail-diedenrezi)
status: Confirmed → Fix Released
Revision history for this message
worms_x (wormsxulla) wrote :

I reported a similar behaviour recently because I hadn't found this one:

https://bugs.launchpad.net/inkscape/+bug/354428

So bug 354428 should be fixed too if 168422 (this one) is fixed.

Thanks!

Revision history for this message
LucaDC (lucadc) wrote :

Just downloaded SVN 21415 and the problem is still there.
This bug is not fixed.

1) open a new Inkscape session (in my preferences the window is small);
2) draw a rectangle;
3) maximize;
4) save the file with File->Save;
5) close Inkscape;
6) reopen the fle.
The window is not in the top corner, it's big and it goes offscreen in the bottom.

Another issue:
1) open a new Inkscape session (in my preferences the window is small);
2) draw a rectangle;
3) maximize;
4) close Inkscape so it asks if you want to save the file;
5) give a name and save the file, Inkscape closes;
6) reopen the fle.
The window is restored in it's size and position BEFORE being maximized.

The two procedures give inconsistent results while the user expects they are exactly equivalent. Why aren't they?

Anyway, I think it's important to stress that a maximized window is NOT a normal window with some negative coordinate and its size near (if not even more) to the screen's one; it's a MAXIMIZED window with coordinates and size that will be applied as soon as the user demaximizes it. The state of the upper right central-of-three button reflects this difference.

So, I think that the maximized state should be stored together with original coordinates and size. Or at least, the maximized state discarded but original coordinates and size stored (so when you reopen the document they are restored).

Thanks.

Windows XP SP3, SVN 21415.

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

Works for me :-(

How is your preference set for saving the windows geometry? See the "windows" tab in the preferences dialog, has it been set to "save and restore window geometry for each document"? If not, could you then upload the file after saving it in maximed state?

Your second scenario indeed revealed something strange, thanks for uncovering that :-). When you close the file without explicitly saving then the window geometry is not being written to the file, I will look into that.

You're also right about the maximized state, that isn't written to the file either. It just hasn't been implemented yet. It is being remembered correctly however when the "remember and use the last window's geometry" option is selected, which is inconsistent.

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

Please test revision #21419 or newer. Inkscape should now also save the window geometry when you save through the data-loss warning dialog (your second scenario).

Revision history for this message
LucaDC (lucadc) wrote :

Well, everything seems working to me now: window's pos and size are saved and restores (apart from the maximized state) and the two ways of closing a document now produce the same result.

Thanks for the fix.

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

Thanks for testing too!

BTW, I just realized that saving the maximized stated in the document is a bit more complicated: what if the document is opened on another machine, with another resolution? Should we in that case restore the size or the maximized state? We can't have both.

When the size is not stored in the document but in the local user preferences instead, then we don't have this ambiguity and this might explain why the maximized state is taken into account only in that case. So I was wrong: it's not that inconsistent after all!

Revision history for this message
LucaDC (lucadc) wrote :

Sorry, I need a clarification on what you mean about the maximized state in different resolutions:
  - if you mean saving the "maximized state" as a "normal state" with size and pos so it resembles a maximized state, I agree: it could cause problems (I was thinking the same thing yesterday and wanted to try changing my resolution); this is Inkscape's current behaviour;
 - if you mean saving the "maximized state" as "state of the window", the OS will set the size and position corresponding to the current screen resolution, different (and correct) for each case; Inkscape is not doing this now.

That's why I would prefer storing the maximized state as a state and not "simulated" as it's now.

Another thing: the problem you presented (same document, different screen resolutions) is indeed present also if the window is not maximized: what if I work on a 1280x1024 screen with a 1000x900 window and after open it on a 800x600 screen? It's the same.
But if the maximized state is saved separately, then a crop to positive coordinates (i.e. 0,0 so the upper-left border is visible) and sizes less than the screen becomes always correct.

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

No, this is not exactly what I meant, but other than that everything you state is correct!

> That's why I would prefer storing the maximized state as a state and not "simulated" as it's now.

Yes, that's what should be done. Store both the state (maximized or not maximized) and the geometry (x, y, w, h) in the document. When reopening the file,
 - if it was saved in the unmaximized state, then we'll open it like that again and use the geometry data to position and size the window. Period.
 - if it was saved in maximized state, then it will again be maximized. Any geometry data will be discarded. In most cases this will be OK, but if you open it on a different system with a different resolution then the window will be bigger or smaller than saved, which might also affect the zoom. We'll have to live with that, because we cannot have both the same geometry and the same maximized state when going to a different resolution.

I hope that I made myself more clear this time ;-)

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

As of rev. #21455, the maximized state will also be stored in the document, so please test once again :-)

If we'd take this one step further, then we could store the fullscreen mode too. This however might be confusing or intrusive if it's not your own document that you're opening, and if you're not familiar with the fullscreen mode. Do you agree?

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.

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote : Re: [Bug 168422] Re: Windows XP: window opens about 20px lower than requested

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

We could save it like that, but it would probably be difficult to restore.
When maximized, I think we would first have to restore the non-maximized
position, maybe even show that to the user, and then maximize it. The user
would likely see the screen jumping in size. Maybe we could trick the
windowmanager somehow, but likely the behavior would be different for XP /
LINUX / OSX, so I prefer leaving things as they are.

> 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?

We could even leave that data out when maximized. Currently, the OS
determines which size we go to when un-maximizing. We could let Inkscape
interfere with that and use the saved unmaximized state, but I'd rather
spend my time on other things, like the next bug you mentioned:

> I just tried modifying the coordinates to -2000, -1000 and it worked: the
> window is completely out of screen, non reachable

That can only happen on Windows ;-). At least GNOME on Fedora 10 doesn't
allow for windows moving out of the screen this way. Inkscape also made
sure by itself that a window cannot move off to the right or bottom, but
it didn't check for top and left. That I just fixed. In all directions, at
least 50 pixels of the window will be visible

> Feel free to discard everything if you think it's not so critical.

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote : Re: [Bug 168422] Re: Windows XP: window opens about 20px lower than requested

>
> Feel free to discard everything if you think it's not so critical.
>

Some of it is indeed not critical, but it's good that you're being
critical! :-)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.