Recent

Author Topic: Laptop with external monitor - Form not showing up  (Read 4392 times)

tudi_x

  • Hero Member
  • *****
  • Posts: 532
Laptop with external monitor - Form not showing up
« on: September 18, 2014, 07:00:06 pm »
Hi Everyone,
Using Lazarus 1.2.4 32bits on Win 7 64 bits.
On laptop I place my main Form on the external monitor.
If while the Lazarus IDE is running I disconnect my monitor the Form moves automatically to the laptop screen.

If I save (and close) with the Form on my external monitor and afterwards if I reopen when not having the external monitor connected I cannot see the Form as it is not shown/moved automatically to my only screen (if I connect the external monitor I can see it).

Please advise:
1. If this is something intended
2. In case I really forget to move the Form before closing on my laptop screen how I can move the Form to the laptop screen when having only the laptop

Thank you
Lazarus 2.0.2 64b on Debian LXDE 10

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Laptop with external monitor - Form not showing up
« Reply #1 on: September 18, 2014, 07:05:30 pm »
You can move your form from the object inspector by changing its left and top properties
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: Laptop with external monitor - Form not showing up
« Reply #2 on: September 18, 2014, 07:12:44 pm »
I've been suffering from similar myself. 
My monitor 2 is on the left hand side of my notebook.  Looks like GTK2 and win32 widgetsets use different screen coordinates in my scenario.  If I save a project in Lazarus/GTK2, then re-open same project in Lazarus/Win32, all the project's forms are off screen to the right. 
Doesn't look like the IDE is calling .MakeFullyVisible...

Please advise:
1. If this is something intended

I'm interested in the answer to this as well, as I suspect an issue should be opened in Mantis...
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Laptop with external monitor - Form not showing up
« Reply #3 on: September 19, 2014, 06:48:15 am »
Please advise:
1. If this is something intended
I believe it is the intended behavior. You might want to change Position/DefaultMonitor values. For instance, if you choose poScreenCenter for Position, forms should move.

Check finer details from the source code TCustomForm.MoveToDefaultPosition

2. In case I really forget to move the Form before closing on my laptop screen how I can move the Form to the laptop screen when having only the laptop
Alt+Tab to activate your application
Alt+Space to get the context menu
Choose move (m if using English interface)
Use any arrow key to initiate the movement, then use your mouse to control and finalize it.

If I save a project in Lazarus/GTK2, then re-open same project in Lazarus/Win32, all the project's forms are off screen to the right. 
Sounds like a bug to me.

tudi_x

  • Hero Member
  • *****
  • Posts: 532
Re: Laptop with external monitor - Form not showing up
« Reply #4 on: September 19, 2014, 08:45:34 am »
Thank you.
What worked for me is the solution from taazz.

Regarding Position / poScreenCenter I think these these provide the position during RunTime, my problem occurs at DesignTime when coding.

From my perspective if the move of the form to the laptop screen occurs automatically (and to a specific position) while Lazarus IDE is opened and I pull the external monitor out, the same should happen also when I reopen the code for editing later on with only the laptop screen.
The user should not manually change the Left/Top position to bring the design of the form to the laptop screen.
Lazarus 2.0.2 64b on Debian LXDE 10

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Laptop with external monitor - Form not showing up
« Reply #5 on: September 19, 2014, 09:08:38 am »
Thank you.
What worked for me is the solution from taazz.

Regarding Position / poScreenCenter I think these these provide the position during RunTime, my problem occurs at DesignTime when coding.

From my perspective if the move of the form to the laptop screen occurs automatically (and to a specific position) while Lazarus IDE is opened and I pull the external monitor out, the same should happen also when I reopen the code for editing later on with only the laptop screen.
There is nothing specific in the lcl code that repositions the form when the second monitor unplugs (nothing That I'm aware that is if there is one of the lcl developers should inform us) which makes me beleive that its an OS functionality.
The user should not manually change the Left/Top position to bring the design of the form to the laptop screen.

the user should not have to reset its screen position every time the application restarts also but I do not see the autosave functionality becoming predominant in the near future also. As long as the functionality is LCL's responsibility then I agree it should behave the same in both circumstances but if I'm right that the functionality comes from the OS then no lcl should not implement anything like that perhaps an expert of some kind that will popup a message when a outside the visual screen space form is opened on the designer asking for permision to bring it inside the visual coordinates and some kind of option on where to bring it too (eg topLeft corner bottomright etc) would do the job nicely.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Laptop with external monitor - Form not showing up
« Reply #6 on: September 19, 2014, 02:24:14 pm »
Regarding Position / poScreenCenter I think these these provide the position during RunTime, my problem occurs at DesignTime when coding.
I missed that.  :-[

 

TinyPortal © 2005-2018