Forum > General
Setting the IDE's default launch location/display
Nel_Fie:
I'm not sure if this is the right place to ask, but anyway:
Is there a known way to set the default launch location and/or display for Lazarus as installed via FPCUpDeluxe, either through options, or by modifying some kind of config file, or some other way available on Ubuntu?
For context: I have a computer setup with three monitors, the primary of which is on DVI rather than HDMI. After recently reinstalling my NVIDIA graphics driver on Ubuntu 22.04 LTS, all my instances of Lazarus (installed via FPCUpDeluxe) up to 3.99 insist on launching on my secondary display (which is on HDMI) instead of the primary display as it used to.
Now this wouldn't be too much of a problem per se, except that a lot of sub-windows that launch intermittently during work also launch to the wrong display - including the all-important auto-completion form! So I'm currently in a situation where I basically can't use auto-complete as intended because the darn thing pops up on an entirely separate screen from the source editor.
A look through the installation files suggests to me that there's maybe a way to fix this by modifying files found in the "config_lazarus" folder, or maybe by modifying the .desktop file through which Lazarus is launched, but I wanted to ask if anyone already knows a solution before I waste my time poking around and modifying random parameters that I don't fully understand.
MarkMLl:
I'm not sure you'll find that sort of thing in the .desktop file, and my own experience is that desktop environments tend to be a bit patchy as to how well they hew to what's specified in there. I also don't think that there'll be anything in the ~/.lazarus directory since that's really for the location of files (but I'd happily be corrected).
You might possibly find that it's in your project's .lps file: this can be safely deleted but I'd suggest starting with a clean project and seeing what happened.
Apart from that you might find that your desktop environment- whatever Ubuntu provides these days (I'm a Debian user, inclined towards KDE) has some sort of per-program override setting.
Are you using Wayland or X11? Can you swap to check the other's behaviour?
MarkMLl
Martin_fr:
Normally the IDE should remember the last location of each window. It has for me on multi monitor setups under Win and Fedora.
And the code-completion drop-down should follow the source editor...
Depending on OS handling (though I only know that for Win), if your screens have different DPI settings then there can be some weirdness. (I have only seen that for hints).
I would suggest to backup your config ~/.lazarus and start with an empty one. Just to see if that helps.
if it does copy files back, until you know which one causes the issue.
- non-xml file can probably remain in the folder, but back them up anyway
- if you have packages installed your lazarus executable is in that folder too, and you want to keep it in there.
Nel_Fie:
Thank you both for the replies.
--- Quote from: MarkMLl on September 26, 2024, 07:26:52 pm ---I'm not sure you'll find that sort of thing in the .desktop file, and my own experience is that desktop environments tend to be a bit patchy as to how well they hew to what's specified in there. I also don't think that there'll be anything in the ~/.lazarus directory since that's really for the location of files (but I'd happily be corrected).
You might possibly find that it's in your project's .lps file: this can be safely deleted but I'd suggest starting with a clean project and seeing what happened.
Apart from that you might find that your desktop environment- whatever Ubuntu provides these days (I'm a Debian user, inclined towards KDE) has some sort of per-program override setting.
Are you using Wayland or X11? Can you swap to check the other's behaviour?
MarkMLl
--- End quote ---
Okay, good to know I can (hopefully) exclude the .desktop and Lazarus's home directory.
I'm pretty sure the .lps file is not at fault. For a start, even the splash screen pops up on the wrong screen, as well as the error handling form which showed up after following Martin_fr's suggestion of trying out with an empty config folder.
But more importantly, there seems to be something fundamentally "borked" with my installation of 3.99 because since the graphics driver update, it always starts with a new project, even though "open last project at launch" is toggled. This error does not occur with my instances of Lazarus 3.4 and 2.2.6, yet they also launch onto the wrong monitor. Regardless of version, they all do this when loading a project that I know for sure I had saved on the right monitor, so the storage in the .lps shouldn't be the issue, unless Lazarus performs some operation on the parameters in there when loading the file.
I've looked into per-program overrides for launch location for Ubuntu, but couldn't find anything yet - and I'm not sure if it would apply to the FPCUpDeluxe installation of Lazarus? I'm a dilettante, but from what I can tell, it seems to be portable and self-contained, unlike a version installed through a .deb file or something like that...
I'm on X11, but I've given Wayland a quick test. The same error occurs.
However, something else happened: it did not apply my display settings from X11, and re-set the HDMI monitor as the primary display - exactly that one to which Lazarus now obsessively launches. Maybe there's an issue with my monitors and/or how Ubuntu stores my display configuration? Is there a way to basically wipe or reset that to zero, and re-register all display devices from scratch?
--- Quote from: Martin_fr on September 26, 2024, 08:55:33 pm ---Normally the IDE should remember the last location of each window. It has for me on multi monitor setups under Win and Fedora.
And the code-completion drop-down should follow the source editor...
Depending on OS handling (though I only know that for Win), if your screens have different DPI settings then there can be some weirdness. (I have only seen that for hints).
I would suggest to backup your config ~/.lazarus and start with an empty one. Just to see if that helps.
if it does copy files back, until you know which one causes the issue.
- non-xml file can probably remain in the folder, but back them up anyway
- if you have packages installed your lazarus executable is in that folder too, and you want to keep it in there.
--- End quote ---
It does remember the relative positions of the windows, but the whole layout is moved to the wrong monitor. As said in my reply to MarkMLI above, even the splash screen pops up there.
I've tried starting with an empty config folder as you describe, but no luck. I just get an error handling form complaining about missing configuration files - which pops up on the wrong monitor as well.
Martin_fr:
So if you have a form in the designer (NOT the embedded designer), and you move it from one monitor to the other => what are the top/left coordinates?
Each Monitor should normally report its own range.
E.g. the left monitor could have x from 0 to 1919 and the right could start at 1920.
Or the left monitor could have x from -1920 to -1 and the right starts at 0.
If you then set a top/left value in the Object inspector (for your design form) does it move to the correct monitor?
I am not sure which config file those coordinates will be in. But one file must have them. So if the IDE is closed the positions of all windows should be in one of the files.
Navigation
[0] Message Index
[#] Next page