View Issue Details

IDProjectCategoryView StatusLast Update
0023839PackagesOtherpublic2016-01-01 11:35
ReporterThaddy de Koning Assigned ToOndrej Pokorny  
Status resolvedResolutionfixed 
Product Version1.0.7 (SVN) 
Summary0023839: Multi-monitor issue with project restore
DescriptionThere is an issue that when you close a project in a multi-monitor setup. Disconnect one (or more) monitors, there is no fall-back when opening the project again on a single monitor. This can really screw you when working on the train ;) It would be nice if the IDE could detect that the saved settings are bollocks and revert to a default fall-back. Perhaps with a dialog if you want to preserve the original settings for later.
Currently it borders on a bug, because some parts of the IDE almost completely disappear. And opposite, back to the normal multi-monitor set-up the whole IDE looks tiny and all wrong. It is pretty trivial for the IDE to detect this different use and can keep track of the current monitor configuration.
Steps To ReproduceSave project. Disconnect second monitor. Load project.
TagsNo tags attached.
Fixed in Revision
Attached Files


related to 0026140 resolvedOndrej Pokorny Lazarus Source editor window jumps to top of screen when any tab clicked 
related to 0026051 closedMartin Friebe Lazarus Moves the code window after changing the active tab 
related to 0027290 resolvedOndrej Pokorny Lazarus Store IDE position 
related to 0025540 resolvedOndrej Pokorny Lazarus Windows won't keep position on second monitor 


Thaddy de Koning

2014-05-12 12:14

reporter   ~0074940

knock, knock?

A suggested work-around is to provide a shortcut to restore a default screen layout (without saving it?).

I guess I am not the only one who experienced this bug.

Martin Friebe

2014-05-12 14:47

manager   ~0074944

Well the workaround is in the Menu "Window" > "Center a lost Window"

Please do not "knock", we got over 1000 other unhanded issues, and if they all get knocks, well...

If you whish to speed it up by helping, best is to ask on the mail list, which code you can look at, to try find a solution.

>>> " some parts of the IDE almost completely disappear "

Can you specify which parts (please test with 1.2 / and if possible also with 1.3, since there have been changes)

Most Windows use the function described below, and I would expect them to be ok, if the IDE can detect your screen count and size at all.

Btw, the issue is more complex than sound at first.

I added 2 related issues. At first sight they are the opposite. But the use the same function "TIDEWindowCreatorList.ShowForm"

In 1.2, this function tries to force everything on Screen, even against the users explicit whish.

As for helping.

For the forms, that fail, check if they use "TIDEWindowCreatorList.ShowForm".

** IF they do:
Check that Screen Count and Sizes are correct.

Write a small app of your own, access the global variable "Screen: TScreen " returns correct Count for monitors and desktops, and they all have correct coordinates.

Look at TCustomForm.MakeFullyVisible
Write a test, (or add debugln, andwatch when using the IDE.

Does GetWindowRect(Handle, ABounds) work?
How about Screen.MonitorFromWindow(Form.Handle, mdNearest) ?

Tomasz Wieckowski

2014-05-14 12:27

reporter   ~0074973

I look at the code and lazarus IDE save custom positions only as left,right,width,height without information about monitors.
So if config have bounds (as example. left=-1600,...) and one monitor will be disconnected then IDE use
ValidateAndSetCoordinates function only for correct window position to be visible (at least +60 at left, etc.), but this correction is used for IDE winodws, not for project forms.

The best way is to save in configs information about monitors/resolutions and use it for restor as original on new monitor.
As example, if left was -1600 and screen width was 1600 then new left will be 0 if monitors was changed and is out at any side of screen.

With out information about last monitor resolution (when CustomPositions was saved) it can't be done.

Martin Friebe

2014-05-14 14:36

manager   ~0074982

So this is only/mainly about designer forms then. (Maybe update the title)

I will need to leave that to someone better acquainted with them than I am.

From my limited knowledge:
Currently all info about forms is stored in the LFM. Modifying the on screen pos also affects what will be compiled into the exe (even, if the exe may use something like DeskTopCenter instead of the hardcoded pos).

The problem goes further, if you adjust the top/left, then you could argue that heigh/width must also be adjusted if you are on a smaller screen. But that would be a substantial change to the project, that should not be done like that.

The best solution really would be to use an embedded designer (as will be needed for docking anyway). Then designer form are no longer displaying the position.

The 2nd best would be to allow the form/designer at a position different from top/left, and not to update top/left. Those would then need to be stored in the project-session instead.

Ultimately allowing switch-able layouts.

But even today you can start the IDE and substitute the lps file before according to your needs.
Or store lps in primary-conf-path, and start the IDE with pcp according to current screen setup

Ondrej Pokorny

2015-11-26 19:05

developer   ~0087615

Should be fixed with the Desktops feature. You can create one Desktop for single monitor environment and one for double monitors.

You also can install the docked designer package from sparta if you have trouble with form designers on different monitors.

Issue History

Date Modified Username Field Change
2013-02-06 03:55 Thaddy de Koning New Issue
2014-01-15 21:45 Juha Manninen Relationship added related to 0025540
2014-05-12 12:14 Thaddy de Koning Note Added: 0074940
2014-05-12 14:33 Martin Friebe Relationship added related to 0026140
2014-05-12 14:34 Martin Friebe Relationship added related to 0026051
2014-05-12 14:47 Martin Friebe Note Added: 0074944
2014-05-14 12:27 Tomasz Wieckowski Note Added: 0074973
2014-05-14 14:36 Martin Friebe Note Added: 0074982
2015-11-26 19:05 Ondrej Pokorny LazTarget => -
2015-11-26 19:05 Ondrej Pokorny Note Added: 0087615
2015-11-26 19:05 Ondrej Pokorny Status new => resolved
2015-11-26 19:05 Ondrej Pokorny Resolution open => fixed
2015-11-26 19:05 Ondrej Pokorny Assigned To => Ondrej Pokorny
2016-01-01 11:35 Juha Manninen Relationship added related to 0027290