View Issue Details

IDProjectCategoryView StatusLast Update
0028995LazarusIDEpublic2017-12-14 14:05
ReporterlifepowerAssigned ToOndrej Pokorny 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSLinux/x64OS VersionUbuntu 15.10
Product Version1.5 (SVN)Product Buildtrunk rev 50307 
Target VersionFixed in Version1.6 
Summary0028995: Window positions garbled after startup on multi-mon
DescriptionIt seems that Ubuntu 15.10 (Unity Desktop) has fixed multi-monitor issues that I've been having on my particular display configuration.

However, Lazarus cannot restore window positions properly - "Restore window geometry" is set for every window, but after restart, they are set to some semi-random values. In fact, even after you move some windows around, their position values don't seem to change at all in "Window positions" category. Manually changing these values, selecting "Custom geometry" and clicking "Apply" doesn't seem to change anything either.
TagsNo tags attached.
Fixed in Revision50387
LazTarget-
Widgetset
Attached Files

Relationships

has duplicate 0025540 resolvedOndrej Pokorny Windows won't keep position on second monitor 
related to 0029702 resolvedOndrej Pokorny "Get Position" in IDE Options not working 

Activities

lifepower

2015-11-11 20:34

reporter  

Screenshot from 2015-11-11 13-15-47.png (1,716,515 bytes)

lifepower

2015-11-11 20:34

reporter  

Screenshot from 2015-11-11 13-16-50.png (1,940,998 bytes)

lifepower

2015-11-11 20:34

reporter  

lifepower

2015-11-11 20:38

reporter   ~0087246

I've attached screenshots - before closing Lazarus, after restarting, and my multi-mon configuration.

Note that this doesn't seem to be a LCL issue - in new app, if you add button and in code add something like "Left := Left + 100" - this does seem to move the window around just fine. Only Lazarus for some reason cannot change its own window positions.

lifepower

2015-11-14 06:17

reporter   ~0087275

Also, when opening Lazarus IDE on fresh installation with multi-mon setup above, closing sample project that is created by default and clicking "Open" (to open existing project) - IDE gets Access Violation and Ubuntu suggests to kill it. If this is ignored, IDE hangs completely.

This AV makes IDE almost unusable. The only workaround I found is not to close sample project but click "Open" to open existing project - this prevents AV. However, should you ever close current project again and try to open another one - AV. This especially gets annoying because once AV occurs, you have to restart IDE and reaccomodate all the windows again, which are placed randomly (see screenshot) on each (re)start.

lifepower

2015-11-14 23:32

reporter   ~0087287

Last edited: 2015-11-15 19:28

View 2 revisions

By the way, same issue occurs on Xfce desktop with similar multi-mon configuration - positions are not restored and AV when you close and try to open another project.

When Lazarus is compiled and ran with QT widgetset (as opposed to GTK2), it seems to restore positions better, though main menu and messages seem to move by around 20 pixels to top or right after each restart.

Pontiac

2015-11-16 17:33

reporter   ~0087324

Confirmed this is for the Win32 build as well. 5 monitor setup here. It is like the defaults are only being honored and not being pulled in via config.

I've also noted that in 1.4.4, the config dialog box was able to detect what windows were open so you could click the "Get Position" button to get the current coordinates. In the trunk build, the "Get Position" window does not get enabled.

Either the detection mechanism that finds each window and updates the form isn't working so it isn't applying the changes read from the environment config, or, the configurations aren't being loaded properly. I suspect prior since the UI isn't reflecting a proper detection by enabling the button properly.

Pontiac

2015-11-16 17:34

reporter  

LazWindow.png (94,898 bytes)
LazWindow.png (94,898 bytes)

lifepower

2015-11-17 00:13

reporter   ~0087344

Actually, I could only reproduce this issue on multi-mon setup on Linux, in Ubuntu 15.04, Ubuntu 15.10 and Xubuntu 15.10 (all 64-bit). On same OSes, if only one monitor is used - there are no problems, Lazarus does seem to recover positions.

On Windows 7 x64 and exactly same multi-mon setup, it does seem to recover window positions okay.

However, I do get issues mentioned by Pontiac - "Get position" never gets enabled and "Apply" does nothing, either on Linux (GTK2) or Windows.

Pontiac

2015-11-17 19:25

reporter   ~0087365

I think I understand what is happening now.

lifepower> Can you verify (In multi-monitor mode) that if you set the configuration for your windows sit within the screen resolution of your primary monitor (I'm not running Linux at this time, but I might setup a VM to deal with this) and restart the app and see if your screen positions are retained? So set your main IDE to be something like top:left:width:height to be like 100:100:1000:60 and see if the positions are set as expected? Also, try moving them to outside your monitors max widths (So say 2000:100:1000:60) and see if the window 'snaps' to the right side of your primary screen.

When the windows are being positioned, the routine:

customform.inc>TCustomForm.MakeFullyVisible

is being called. As per https://github.com/graemeg/lazarus/blob/upstream/lcl/include/customform.inc - Search for that function.

The function of this procedure is to make sure that the form stays completely visible on the primary monitor. In my case, my physical monitors are laid out like:

12
345

And 4 is my primary monitor which means that monitor 3 has a negative left coordinate. Still valid for visible desktop, but invalid as far as this function is concerned. If I set the Main IDE to be in a position within the desktop area of monitor 4 (1920x1080) the Main IDE window shows up as specified. When I start setting the configuration to put the window outside the 1920x1080 range, the window is positioned and hugs the screen border.

So no consideration is being made for multi-monitor setup where other screens are concerned at all. As it sits, all your IDE windows show up on your primary monitor, period.

I'm going to check the history on this and see if it can be undone, or, if I can implement a routine to allow for snapping within monitors that aren't your primary.

Ondrej Pokorny

2015-11-18 14:04

developer   ~0087383

Please test and close if OK.
The AV-issue should be reported separately, if it still persists.

lifepower

2015-11-18 17:11

reporter   ~0087386

Excellent work, now positions are restored correctly on my configuration. Many thanks!

P.S. AV issue was reported separately and has also been resolved.

Issue History

Date Modified Username Field Change
2015-11-11 20:33 lifepower New Issue
2015-11-11 20:34 lifepower File Added: Screenshot from 2015-11-11 13-15-47.png
2015-11-11 20:34 lifepower File Added: Screenshot from 2015-11-11 13-16-50.png
2015-11-11 20:34 lifepower File Added: Screenshot from 2015-11-11 13-17-50.png
2015-11-11 20:38 lifepower Note Added: 0087246
2015-11-14 06:17 lifepower Note Added: 0087275
2015-11-14 23:32 lifepower Note Added: 0087287
2015-11-15 19:28 lifepower Note Edited: 0087287 View Revisions
2015-11-16 17:33 Pontiac Note Added: 0087324
2015-11-16 17:34 Pontiac File Added: LazWindow.png
2015-11-17 00:13 lifepower Note Added: 0087344
2015-11-17 19:25 Pontiac Note Added: 0087365
2015-11-18 14:01 Ondrej Pokorny Assigned To => Ondrej Pokorny
2015-11-18 14:01 Ondrej Pokorny Status new => assigned
2015-11-18 14:04 Ondrej Pokorny Fixed in Revision => 50387
2015-11-18 14:04 Ondrej Pokorny LazTarget => -
2015-11-18 14:04 Ondrej Pokorny Widgetset GTK, GTK 2 =>
2015-11-18 14:04 Ondrej Pokorny Note Added: 0087383
2015-11-18 14:04 Ondrej Pokorny Status assigned => resolved
2015-11-18 14:04 Ondrej Pokorny Fixed in Version => 1.6
2015-11-18 14:04 Ondrej Pokorny Resolution open => fixed
2015-11-18 17:11 lifepower Note Added: 0087386
2015-11-18 17:12 lifepower Status resolved => closed
2015-11-26 19:02 Ondrej Pokorny Relationship added has duplicate 0025540
2017-12-14 14:05 Juha Manninen Relationship added related to 0029702