Re: [Lazarus] non-sensical window repositioning

2011-06-30 Thread Felipe Monteiro de Carvalho
On Fri, Jun 24, 2011 at 10:32 PM, zeljko zel...@holobit.net wrote:
 why fsFullScreen ? IMO, wsFullScreen (WindowState) is more apropriate.

Good idea! I implemented it like that. Now wsFullScreen exists and it
works in gtk2 at the moment.

-- 
Felipe Monteiro de Carvalho

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] non-sensical window repositioning

2011-06-24 Thread Felipe Monteiro de Carvalho
Hello,

I just found a problem with lcl-gtk2 that I haven't ever seen before.
Consider this code:

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Form1.Left := 0;
  Form1.Top := 0;
  Form1.Width := 1680;
  Form1.Height := 1050;
  Application.Run;
end.

This represents the following position: Window Pos: 0 0 1680 1050
which covers the entire screen

Upon calling Form1.Show I get this instead: Window Pos: 560 0 1120 676

Which means that the position of my form was modified to something
non-sensical and different from my command.

Does anyone know if gtk2 is doing this wierd repositioning or if
LCL-Gtk2 is doing it? Maybe some kind of sanity check going wrong =O

The same code works fine in Windows. Basically this prevents the
Virtual Magnifying Glass from working correctly.

thanks,
-- 
Felipe Monteiro de Carvalho

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] non-sensical window repositioning

2011-06-24 Thread Mattias Gaertner
On Fri, 24 Jun 2011 13:49:59 +0200
Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote:

 Hello,
 
 I just found a problem with lcl-gtk2 that I haven't ever seen before.
 Consider this code:
 
 begin
   Application.Initialize;
   Application.CreateForm(TForm1, Form1);
   Form1.Left := 0;
   Form1.Top := 0;
   Form1.Width := 1680;
   Form1.Height := 1050;
   Application.Run;
 end.
 
 This represents the following position: Window Pos: 0 0 1680 1050
 which covers the entire screen

For full screen see here:
http://wiki.lazarus.freepascal.org/Application_full_screen_mode

 
 Upon calling Form1.Show I get this instead: Window Pos: 560 0 1120 676
 
 Which means that the position of my form was modified to something
 non-sensical and different from my command.
 
 Does anyone know if gtk2 is doing this wierd repositioning or if
 LCL-Gtk2 is doing it? Maybe some kind of sanity check going wrong =O

Some window managers do that.

 
 The same code works fine in Windows. Basically this prevents the
 Virtual Magnifying Glass from working correctly.


Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] non-sensical window repositioning

2011-06-24 Thread Felipe Monteiro de Carvalho
On Fri, Jun 24, 2011 at 2:46 PM, Mattias Gaertner
nc-gaert...@netcologne.de wrote:
 For full screen see here:
 http://wiki.lazarus.freepascal.org/Application_full_screen_mode

I think we should implement that in the LCL. What do you think about
these proposals:

1 TForm.SetFullscreen(AValue: Boolean);
2 fsFullScreen -- but then you can't combine with fsSystemStayOnTop

 Some window managers do that.

Yes, it is probably KDE which is hitting me =( I debugged and even Gtk
doesn't know about the position change, it just magically occurs some
time after show(), which indicates window manager changes.

This works fine (just smaller then the screen width):

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Form1.Left := 0;
  Form1.Top := 0;
  Form1.Width := 1673;
  Form1.Height := 1050;
  Application.Run;
end.

This fails:

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Form1.Left := 0;
  Form1.Top := 0;
  Form1.Width := 1674;
  Form1.Height := 1050;
  Application.Run;
end.



-- 
Felipe Monteiro de Carvalho

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] non-sensical window repositioning

2011-06-24 Thread Graeme Geldenhuys
On 06/24/2011 01:49 PM, Felipe Monteiro de Carvalho wrote:
 begin
   Application.Initialize;
   Application.CreateForm(TForm1, Form1);
   Form1.Left := 0;
   Form1.Top := 0;
   Form1.Width := 1680;
   Form1.Height := 1050;
   Application.Run;
 end.

I adjusted that to one of my monitors 1440x900 max resolution.  I then
placed a OnShow event on the form, which output the coordinates and size
again.

The output was:
  t:0  l:0  w:1440  h:1440



The Height is all wrong! But it did take up as much screen space as the
desktop allows - which excluded the two panels. One panel at the top
(menus, time, etc) and one panel at the bottom (task manager).


But if you want true fullscreen, then LCL propbably needs a WindowState
addition like wsFullScreen or something - I assume it doesn't already exist.

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] non-sensical window repositioning

2011-06-24 Thread zeljko
On Friday 24 of June 2011 14:57:15 Felipe Monteiro de Carvalho wrote:
 On Fri, Jun 24, 2011 at 2:46 PM, Mattias Gaertner
 
 nc-gaert...@netcologne.de wrote:
  For full screen see here:
  http://wiki.lazarus.freepascal.org/Application_full_screen_mode
 
 I think we should implement that in the LCL. What do you think about
 these proposals:
 
 1 TForm.SetFullscreen(AValue: Boolean);
 2 fsFullScreen -- but then you can't combine with fsSystemStayOnTop
 
  Some window managers do that.
 
 Yes, it is probably KDE which is hitting me =( I debugged and even Gtk
 doesn't know about the position change, it just magically occurs some
 time after show(), which indicates window manager changes.
 
 This works fine (just smaller then the screen width):
 
 begin
   Application.Initialize;
   Application.CreateForm(TForm1, Form1);
   Form1.Left := 0;
   Form1.Top := 0;
   Form1.Width := 1673;
   Form1.Height := 1050;
   Application.Run;
 end.
 
 This fails:
 
 begin
   Application.Initialize;
   Application.CreateForm(TForm1, Form1);
   Form1.Left := 0;
   Form1.Top := 0;
   Form1.Width := 1674;
   Form1.Height := 1050;
   Application.Run;
 end.

Qt supports fullscreen window state ... don't know for others. I guess that 
it's not hard task to implement it for other X11 widgetsets ... but don't know 
for win32 and carbon.

zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus