Changed behaviour on window positioning between gtk2 and gtk3

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Changed behaviour on window positioning between gtk2 and gtk3

Stewart Douglas-2
On rebuilding wx with gtk3 rather than gtk2, have spotted a change in behaviour on window positioning.

Platform: Debian test
gtk2 WX version: git head on 2nd May,
configure --enable-std-string --enable-stl --enable-std_containers --enable-std_iostreams --enable-mediactrl --with-gtk=2 CXXFLAGS="-std=c++11"

gtk3 WX version: git head on 6th May
configure --enable-std-string --enable-stl --enable-std_containers --enable-std_iostreams --enable-mediactrl --with-gtk=3 CXXFLAGS="-std=c++11"

With the gtk2 version, my main app window is positioned in the centre of the screen, and child windows are centred too - this includes windows I have coded and dialog boxes.

With the gtk3 version, my main app window is position top left of the screen, and child windows are position top left also, with dialog boxes being centred on the parent window.

I'm using wxFormBuilder to create the frames etc, and this is initialising windows with wxDefaultPosition. Has the meaning of this changed between the two toolkits ? I've also tried moving my child windows explicitly, either by specifying an explicit window position in wxFB, or by grabbing the parent window position, adding an offset to this position and moving the child window to the new position. Both approaches have no impact in the gtk3 code.

Is this expected behaviour or some fall out from the way wxFB is creating window frames etc ?

Thanks

Stew
-- 
Stewart Douglas
[hidden email]
http://www.snowgold.com

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Changed behaviour on window positioning between gtk2 and gtk3

Stewart Douglas-2
I should also state that my window manager is OpenBox, so perhaps the gtk3 port is relying on default behaviour from the Gnome shell ?

On 08/05/17 15:29, Stewart Douglas wrote:
On rebuilding wx with gtk3 rather than gtk2, have spotted a change in behaviour on window positioning.

Platform: Debian test
gtk2 WX version: git head on 2nd May,
configure --enable-std-string --enable-stl --enable-std_containers --enable-std_iostreams --enable-mediactrl --with-gtk=2 CXXFLAGS="-std=c++11"

gtk3 WX version: git head on 6th May
configure --enable-std-string --enable-stl --enable-std_containers --enable-std_iostreams --enable-mediactrl --with-gtk=3 CXXFLAGS="-std=c++11"

With the gtk2 version, my main app window is positioned in the centre of the screen, and child windows are centred too - this includes windows I have coded and dialog boxes.

With the gtk3 version, my main app window is position top left of the screen, and child windows are position top left also, with dialog boxes being centred on the parent window.

I'm using wxFormBuilder to create the frames etc, and this is initialising windows with wxDefaultPosition. Has the meaning of this changed between the two toolkits ? I've also tried moving my child windows explicitly, either by specifying an explicit window position in wxFB, or by grabbing the parent window position, adding an offset to this position and moving the child window to the new position. Both approaches have no impact in the gtk3 code.

Is this expected behaviour or some fall out from the way wxFB is creating window frames etc ?

Thanks

Stew
-- 
Stewart Douglas
[hidden email]
http://www.snowgold.com
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

-- 
Stewart Douglas
[hidden email]
http://www.snowgold.com

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Changed behaviour on window positioning between gtk2 and gtk3

oneeyeman
Hi, Stewart,

On Mon, May 8, 2017 at 10:38 AM, Stewart Douglas <[hidden email]> wrote:
> I should also state that my window manager is OpenBox, so perhaps the gtk3
> port is relying on default behaviour from the Gnome shell ?

What is your GTK+3 version?

Thank you.

>
> On 08/05/17 15:29, Stewart Douglas wrote:
>
> On rebuilding wx with gtk3 rather than gtk2, have spotted a change in
> behaviour on window positioning.
>
> Platform: Debian test
> gtk2 WX version: git head on 2nd May,
> configure --enable-std-string --enable-stl --enable-std_containers
> --enable-std_iostreams --enable-mediactrl --with-gtk=2 CXXFLAGS="-std=c++11"
>
> gtk3 WX version: git head on 6th May
> configure --enable-std-string --enable-stl --enable-std_containers
> --enable-std_iostreams --enable-mediactrl --with-gtk=3 CXXFLAGS="-std=c++11"
>
> With the gtk2 version, my main app window is positioned in the centre of the
> screen, and child windows are centred too - this includes windows I have
> coded and dialog boxes.
>
> With the gtk3 version, my main app window is position top left of the
> screen, and child windows are position top left also, with dialog boxes
> being centred on the parent window.
>
> I'm using wxFormBuilder to create the frames etc, and this is initialising
> windows with wxDefaultPosition. Has the meaning of this changed between the
> two toolkits ? I've also tried moving my child windows explicitly, either by
> specifying an explicit window position in wxFB, or by grabbing the parent
> window position, adding an offset to this position and moving the child
> window to the new position. Both approaches have no impact in the gtk3 code.
>
> Is this expected behaviour or some fall out from the way wxFB is creating
> window frames etc ?
>
> Thanks
>
> Stew
>
> --
> Stewart Douglas
> [hidden email]
> http://www.snowgold.com
>
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to [hidden email]
> or visit http://groups.google.com/group/wx-users
>
>
> --
> Stewart Douglas
> [hidden email]
> http://www.snowgold.com
>
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to [hidden email]
> or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Changed behaviour on window positioning between gtk2 and gtk3

Vadim Zeitlin-4
In reply to this post by Stewart Douglas-2
On Mon, 8 May 2017 15:29:08 +0100 Stewart Douglas wrote:

SD> On rebuilding wx with gtk3 rather than gtk2, have spotted a change in
SD> behaviour on window positioning.
SD>
SD> Platform: Debian test
SD> gtk2 WX version: git head on 2nd May,
SD> configure --enable-std-string --enable-stl --enable-std_containers
SD> --enable-std_iostreams --enable-mediactrl --with-gtk=2 CXXFLAGS="-std=c++11"
SD>
SD> gtk3 WX version: git head on 6th May
SD> configure --enable-std-string --enable-stl --enable-std_containers
SD> --enable-std_iostreams --enable-mediactrl --with-gtk=3 CXXFLAGS="-std=c++11"
SD>
SD> With the gtk2 version, my main app window is positioned in the centre of
SD> the screen, and child windows are centred too - this includes windows I
SD> have coded and dialog boxes.
SD>
SD> With the gtk3 version, my main app window is position top left of the
SD> screen, and child windows are position top left also, with dialog boxes
SD> being centred on the parent window.
SD>
SD> I'm using wxFormBuilder to create the frames etc, and this is
SD> initialising windows with wxDefaultPosition. Has the meaning of this
SD> changed between the two toolkits ?

 I think so, but the simplest way to check it would seem to be to just
build and run the minimal sample (which doesn't have any wxFB-generated
code) using the two toolkits on your system. If you also see the same
difference in behaviour with it, then it must be a GTK+ change.

SD> I've also tried moving my child windows explicitly, either by
SD> specifying an explicit window position in wxFB, or by grabbing the
SD> parent window position, adding an offset to this position and moving
SD> the child window to the new position. Both approaches have no impact in
SD> the gtk3 code.

 This looks really bad. What window manager do you use?

 Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/

attachment0 (203 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Changed behaviour on window positioning between gtk2 and gtk3

Frédéric Bron
In reply to this post by Stewart Douglas-2
> With the gtk3 version, my main app window is position top left of the
> screen, and child windows are position top left also, with dialog boxes
> being centred on the parent window.

I use gtk3 on Fedora 25 with KDE.

* When I start 4 times my own application (takes a large part of the
screen at startup):
- 1st time: top-left corner
- 2nd time: bottom-right corner
- 3rd time: top-right corner
- 4th time: bottom-left corner

I do not have dialogs.

* With wxWidgets samples:
- toolbar: always starts at the same postion, close to the top-left
corner but with a margin from the top-left borders, the About dialog
is always roughly centered in the middle of the window
- minimal: 1st top-left, 2nd just below, 3rd just below 2nd, 4th just
below 3rd, 5th to the right of 4th
apparently, the window manager tries to put the window in a "free"
location. If I put a file manager in the top-left corner and start
minimal from it, the 1st minimal window is put to the right of the
file manager. So I do not think gtk does anything; the window manager
does the placement.

Frédéric

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Changed behaviour on window positioning between gtk2 and gtk3

Stewart Douglas-2
In reply to this post by Vadim Zeitlin-4
Just realised sent this only to VZ, copying now to list. Apologies for the dupe email Vadim.

Sorry just back from vacation. I did some more investigating before I went away and realised that I was indeed seeing some strange behaviour - when
creating frames without the resize option, window placement would always be at the top left (my main window and a couple of windows are created that way). With the resizeable frames, the first frame displayed would appear in a position chosen by the window manager with the size assigned to it in the wxFB designer. Later frames would appear with a zero size, or the minimum size if one was set in the designer. This is all with the gtk3 build.

I'm going to redo my tests with the latest head and report back, as the gtk2 build of wx I was using was a few days older than the gtk3 build.

Window manager is openbox. Not been able to replicate any of this behaviour with the samples - window placement appears as I would expect when running the samples that I have tested. Are there any samples which can create multiple resizeable frames ?

I believe the issue I spotted when trying to move and position frames were occurring with non resizeable frames but will confirm that too.

Will report back later with my findings.

Stew

On 16/05/17 21:40, Vadim Zeitlin wrote:
On Mon, 8 May 2017 15:29:08 +0100 Stewart Douglas wrote:

SD> On rebuilding wx with gtk3 rather than gtk2, have spotted a change in 
SD> behaviour on window positioning.
SD> 
SD> Platform: Debian test
SD> gtk2 WX version: git head on 2nd May,
SD> configure --enable-std-string --enable-stl --enable-std_containers 
SD> --enable-std_iostreams --enable-mediactrl --with-gtk=2 CXXFLAGS="-std=c++11"
SD> 
SD> gtk3 WX version: git head on 6th May
SD> configure --enable-std-string --enable-stl --enable-std_containers 
SD> --enable-std_iostreams --enable-mediactrl --with-gtk=3 CXXFLAGS="-std=c++11"
SD> 
SD> With the gtk2 version, my main app window is positioned in the centre of 
SD> the screen, and child windows are centred too - this includes windows I 
SD> have coded and dialog boxes.
SD> 
SD> With the gtk3 version, my main app window is position top left of the 
SD> screen, and child windows are position top left also, with dialog boxes 
SD> being centred on the parent window.
SD> 
SD> I'm using wxFormBuilder to create the frames etc, and this is 
SD> initialising windows with wxDefaultPosition. Has the meaning of this 
SD> changed between the two toolkits ?

 I think so, but the simplest way to check it would seem to be to just
build and run the minimal sample (which doesn't have any wxFB-generated
code) using the two toolkits on your system. If you also see the same
difference in behaviour with it, then it must be a GTK+ change.

SD> I've also tried moving my child windows explicitly, either by
SD> specifying an explicit window position in wxFB, or by grabbing the
SD> parent window position, adding an offset to this position and moving
SD> the child window to the new position. Both approaches have no impact in
SD> the gtk3 code.

 This looks really bad. What window manager do you use?

 Regards,
VZ


-- 
Stewart Douglas
[hidden email]
http://www.snowgold.com

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Changed behaviour on window positioning between gtk2 and gtk3

Stewart Douglas-2
OK am able to confirm my earlier findings, when running my code against the same version of wx built against gtk2 and gtk3.

Under gtk2, my main window is centred on the screen, and its child windows are opened centred on it, irrespective of whether they are resizeable or not. All non resizeable windows are sized as designed.

Under gtk3, my main window is positioned top left as are non resizeable child windows. The first resizeable child window created is sized as expected and positioned top left. Later resizeable child windows are also positioned top left but are given their minimum size.

Running the bombs demo shows the same positioning behaviour - under gtk2 the window is centred, and under gtk3 the window is positioned top left. I looked at the bombs demo as it's main window was created with wxDefaultPosition.

Changing the minimal sample line 145 to the code below, causes the window to be positioned top left on gtk3,

  : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(300, 300), wxDEFAULT_DIALOG_STYLE|wxMINIMIZE_BOX)

Running the minimal sample with the change above causes the window to be positioned top left which wasn't what I was expecting, but adding a call to Centre(wxBOTH) in MyFrame's constructor generates the behaviour I was expecting, with the window being centred on the screen.

Running the unmodified sample against gtk3, and the window is positioned by the window manager, with multiple instances being positioned partially overlapping each other.

Running the modified sample with only the wxFrame constructor change, the first window is positioned top left, but later runs are positioned partially overlapping.

Running the modified sample with both changes and all windows are positioned top left. Same thing happens with only the additional call to wxCentre.

This explains the behaviour I was seeing previously where attempts to position the window under gtk3 were failing.

Should wxCentre work the same under gtk2 and gtk3 ? I think that is part of the problem. Will investigate further why window sizing is changing behaviour when I open multiple frames in my application.

Thanks

Stew

On 19/05/17 13:23, Stewart Douglas wrote:
Just realised sent this only to VZ, copying now to list. Apologies for the dupe email Vadim.

Sorry just back from vacation. I did some more investigating before I went away and realised that I was indeed seeing some strange behaviour - when
creating frames without the resize option, window placement would always be at the top left (my main window and a couple of windows are created that way). With the resizeable frames, the first frame displayed would appear in a position chosen by the window manager with the size assigned to it in the wxFB designer. Later frames would appear with a zero size, or the minimum size if one was set in the designer. This is all with the gtk3 build.

I'm going to redo my tests with the latest head and report back, as the gtk2 build of wx I was using was a few days older than the gtk3 build.

Window manager is openbox. Not been able to replicate any of this behaviour with the samples - window placement appears as I would expect when running the samples that I have tested. Are there any samples which can create multiple resizeable frames ?

I believe the issue I spotted when trying to move and position frames were occurring with non resizeable frames but will confirm that too.

Will report back later with my findings.

Stew

On 16/05/17 21:40, Vadim Zeitlin wrote:
On Mon, 8 May 2017 15:29:08 +0100 Stewart Douglas wrote:

SD> On rebuilding wx with gtk3 rather than gtk2, have spotted a change in 
SD> behaviour on window positioning.
SD> 
SD> Platform: Debian test
SD> gtk2 WX version: git head on 2nd May,
SD> configure --enable-std-string --enable-stl --enable-std_containers 
SD> --enable-std_iostreams --enable-mediactrl --with-gtk=2 CXXFLAGS="-std=c++11"
SD> 
SD> gtk3 WX version: git head on 6th May
SD> configure --enable-std-string --enable-stl --enable-std_containers 
SD> --enable-std_iostreams --enable-mediactrl --with-gtk=3 CXXFLAGS="-std=c++11"
SD> 
SD> With the gtk2 version, my main app window is positioned in the centre of 
SD> the screen, and child windows are centred too - this includes windows I 
SD> have coded and dialog boxes.
SD> 
SD> With the gtk3 version, my main app window is position top left of the 
SD> screen, and child windows are position top left also, with dialog boxes 
SD> being centred on the parent window.
SD> 
SD> I'm using wxFormBuilder to create the frames etc, and this is 
SD> initialising windows with wxDefaultPosition. Has the meaning of this 
SD> changed between the two toolkits ?

 I think so, but the simplest way to check it would seem to be to just
build and run the minimal sample (which doesn't have any wxFB-generated
code) using the two toolkits on your system. If you also see the same
difference in behaviour with it, then it must be a GTK+ change.

SD> I've also tried moving my child windows explicitly, either by
SD> specifying an explicit window position in wxFB, or by grabbing the
SD> parent window position, adding an offset to this position and moving
SD> the child window to the new position. Both approaches have no impact in
SD> the gtk3 code.

 This looks really bad. What window manager do you use?

 Regards,
VZ


-- 
Stewart Douglas
[hidden email]
http://www.snowgold.com
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

-- 
Stewart Douglas
[hidden email]
http://www.snowgold.com

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Changed behaviour on window positioning between gtk2 and gtk3

Stewart Douglas-2
When I mention wxCentre and meanign calls to Centre(wxBOTH) - more coffee required

On 19/05/17 16:34, Stewart Douglas wrote:
OK am able to confirm my earlier findings, when running my code against the same version of wx built against gtk2 and gtk3.

Under gtk2, my main window is centred on the screen, and its child windows are opened centred on it, irrespective of whether they are resizeable or not. All non resizeable windows are sized as designed.

Under gtk3, my main window is positioned top left as are non resizeable child windows. The first resizeable child window created is sized as expected and positioned top left. Later resizeable child windows are also positioned top left but are given their minimum size.

Running the bombs demo shows the same positioning behaviour - under gtk2 the window is centred, and under gtk3 the window is positioned top left. I looked at the bombs demo as it's main window was created with wxDefaultPosition.

Changing the minimal sample line 145 to the code below, causes the window to be positioned top left on gtk3,

  : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(300, 300), wxDEFAULT_DIALOG_STYLE|wxMINIMIZE_BOX)

Running the minimal sample with the change above causes the window to be positioned top left which wasn't what I was expecting, but adding a call to Centre(wxBOTH) in MyFrame's constructor generates the behaviour I was expecting, with the window being centred on the screen.

Running the unmodified sample against gtk3, and the window is positioned by the window manager, with multiple instances being positioned partially overlapping each other.

Running the modified sample with only the wxFrame constructor change, the first window is positioned top left, but later runs are positioned partially overlapping.

Running the modified sample with both changes and all windows are positioned top left. Same thing happens with only the additional call to wxCentre.

This explains the behaviour I was seeing previously where attempts to position the window under gtk3 were failing.

Should wxCentre work the same under gtk2 and gtk3 ? I think that is part of the problem. Will investigate further why window sizing is changing behaviour when I open multiple frames in my application.

Thanks

Stew

On 19/05/17 13:23, Stewart Douglas wrote:
Just realised sent this only to VZ, copying now to list. Apologies for the dupe email Vadim.

Sorry just back from vacation. I did some more investigating before I went away and realised that I was indeed seeing some strange behaviour - when
creating frames without the resize option, window placement would always be at the top left (my main window and a couple of windows are created that way). With the resizeable frames, the first frame displayed would appear in a position chosen by the window manager with the size assigned to it in the wxFB designer. Later frames would appear with a zero size, or the minimum size if one was set in the designer. This is all with the gtk3 build.

I'm going to redo my tests with the latest head and report back, as the gtk2 build of wx I was using was a few days older than the gtk3 build.

Window manager is openbox. Not been able to replicate any of this behaviour with the samples - window placement appears as I would expect when running the samples that I have tested. Are there any samples which can create multiple resizeable frames ?

I believe the issue I spotted when trying to move and position frames were occurring with non resizeable frames but will confirm that too.

Will report back later with my findings.

Stew

On 16/05/17 21:40, Vadim Zeitlin wrote:
On Mon, 8 May 2017 15:29:08 +0100 Stewart Douglas wrote:

SD> On rebuilding wx with gtk3 rather than gtk2, have spotted a change in 
SD> behaviour on window positioning.
SD> 
SD> Platform: Debian test
SD> gtk2 WX version: git head on 2nd May,
SD> configure --enable-std-string --enable-stl --enable-std_containers 
SD> --enable-std_iostreams --enable-mediactrl --with-gtk=2 CXXFLAGS="-std=c++11"
SD> 
SD> gtk3 WX version: git head on 6th May
SD> configure --enable-std-string --enable-stl --enable-std_containers 
SD> --enable-std_iostreams --enable-mediactrl --with-gtk=3 CXXFLAGS="-std=c++11"
SD> 
SD> With the gtk2 version, my main app window is positioned in the centre of 
SD> the screen, and child windows are centred too - this includes windows I 
SD> have coded and dialog boxes.
SD> 
SD> With the gtk3 version, my main app window is position top left of the 
SD> screen, and child windows are position top left also, with dialog boxes 
SD> being centred on the parent window.
SD> 
SD> I'm using wxFormBuilder to create the frames etc, and this is 
SD> initialising windows with wxDefaultPosition. Has the meaning of this 
SD> changed between the two toolkits ?

 I think so, but the simplest way to check it would seem to be to just
build and run the minimal sample (which doesn't have any wxFB-generated
code) using the two toolkits on your system. If you also see the same
difference in behaviour with it, then it must be a GTK+ change.

SD> I've also tried moving my child windows explicitly, either by
SD> specifying an explicit window position in wxFB, or by grabbing the
SD> parent window position, adding an offset to this position and moving
SD> the child window to the new position. Both approaches have no impact in
SD> the gtk3 code.

 This looks really bad. What window manager do you use?

 Regards,
VZ


-- 
Stewart Douglas
[hidden email]
http://www.snowgold.com
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

-- 
Stewart Douglas
[hidden email]
http://www.snowgold.com
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

-- 
Stewart Douglas
[hidden email]
http://www.snowgold.com

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users