New window location
New window location
I am updating a program last updated using V5.31. Much seems to have changed since then. The Windows code recompiles without issue, but seems to be some issues with the linux implementation. With your help, hopefully we can slay these dragons one at a time.
I have a dual monitor setup with the primary monitor displaying my primary Linux desktop. The secondary monitor displays a Virtualbox Windows 7 machine.
The biggest issue is that when running the program, using v5.31 the program opens in the center of the primary screen as it is supposed to. Using later current versions v5.45LTS and v5.60 the window opens in the center of the combined screens, and ultimately opens on the far left center of the secondary screen. (the primary screen is on my left and secondary on my right). This doesn't work for me and very much need the functionality of the earlier versions of PB.
Any thoughts as to why the functionality changed and how to get it back?
I have a dual monitor setup with the primary monitor displaying my primary Linux desktop. The secondary monitor displays a Virtualbox Windows 7 machine.
The biggest issue is that when running the program, using v5.31 the program opens in the center of the primary screen as it is supposed to. Using later current versions v5.45LTS and v5.60 the window opens in the center of the combined screens, and ultimately opens on the far left center of the secondary screen. (the primary screen is on my left and secondary on my right). This doesn't work for me and very much need the functionality of the earlier versions of PB.
Any thoughts as to why the functionality changed and how to get it back?
Missed it by that much!!
HK
HK
Re: New window location
Check your PureBasic.prefs contents before starting IDE.
Code: Select all
[Editor]
IsWindowMaximized = 0
X = 0
Y = 0
Width = 1917
Height = 1047
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: New window location
I think I may have created a misunderstanding. The problem is not with the editor.
The problem is when I run the program I have created. It opens centered to both screens combined, not to the center of the primary screen.
The open window code looks like this;
That is the little splash screen that opens to let the user know the program is running and loading the database. After this the main window opens but again, centered on both screens combined. This behavior is new to PB versions after 5.31. I do not know when this behavior started, but reverting back to v5.31 the program runs normally, 5.45LTS and later the program opens centered on both screens.
The problem is when I run the program I have created. It opens centered to both screens combined, not to the center of the primary screen.
The open window code looks like this;
Code: Select all
OpenWindow(#Window_Loading, 537, 459, 206, 107, "Loading", #PB_Window_BorderLess | #PB_Window_ScreenCentered )
Missed it by that much!!
HK
HK
Re: New window location
You are using GTK3 per Default, the Default for PB5.31 is GTK2!This behavior is new to PB versions after 5.31.
Change the subsystem to GTK2.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Re: New window location
To be clear, everything works really well when compiled with PB5.31.ts-soft wrote:You are using GTK3 per Default, the Default for PB5.31 is GTK2!This behavior is new to PB versions after 5.31.
Change the subsystem to GTK2.
My understanding of the subsystems and system architecture is somewhat limited. Simply googling changing subsystem from GTK3 to GTK2 left me without any clear direction. Any help regarding accomplishing this is greatly appreciated. I know it's a bit out of the scope of this forum, so I appreciate any direction here.
Missed it by that much!!
HK
HK
Re: New window location
The old subsystem was GTK2, the new one is GTK3. To compatible with old systems, use subsytem GTK2
Subsystems
Subsystems
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Re: New window location
Thanks for your help TS. I'm not sure how to use GTK2 vs. GTK3. When opening the window I am using only native PB code, so how do I make that native PB code use GTK2? I have noticed that in the compiler options there is the ability to specify the subsystem library. Simply putting "gtk2" (no quotes) ion there does not generate an error, but also does not change the behavior of the compiled program. Trying almost anything else in there generates an error. Doing this has changed the appearance (some of the gadgets had changed size and that was solved by putting gtk2 in the library subsystem box, but it still wants to open centered to both screens as opposed to the primary screen.
So, thanks for your help, you solved every other problem I was having with updating this program )
Any thoughts as to why it still wants to open centered on both screens, and how to get it not to do that?
So, thanks for your help, you solved every other problem I was having with updating this program )
Any thoughts as to why it still wants to open centered on both screens, and how to get it not to do that?
Missed it by that much!!
HK
HK
Re: New window location
This is a linux-setting and have nothing to do with pb!Any thoughts as to why it still wants to open centered on both screens, and how to get it not to do that?
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Re: New window location
Thanks again for your help.ts-soft wrote:This is a linux-setting and have nothing to do with pb!Any thoughts as to why it still wants to open centered on both screens, and how to get it not to do that?
The exact same code, compiled within minutes of each other, one with v5.31 and the other with v5.45LTS (using gtk2) act differently. I would think if it were strictly a Linux setting, that this would not be so.
As well this code;
Code: Select all
If StartDrawing(WindowOutput(Window))
Color.i = Point(5, 5)
StopDrawing()
EndIf
I don't know but it seems as there is more to this.
Missed it by that much!!
HK
HK
Re: New window location
Drawing on WindowOutput don´t work at some functions with gtk3. Please use subsystem gtk2.
Or drawing on CanvasGadget...
Or drawing on CanvasGadget...
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: New window location
Thanks. I am using gtk2 as a subsystem. That doesn't seem to make a difference for that problem specifically.mk-soft wrote:Drawing on WindowOutput don´t work at some functions with gtk3. Please use subsystem gtk2.
Or drawing on CanvasGadget...
An additional note on this. When the PB IDE opens the splash opens centered on both screens. The IDE window still locates as before.
Missed it by that much!!
HK
HK
Re: New window location
Hi harkon,
I can confirm this behaviour, but with restriction.
Only certain (or one?) window manager are concerned.
On my Mint KDE with PB > 5.4 the Windows with #PB_Window_ScreenCentered are (in Linux terms) 'Screen'-centered. 'Screen' means the sum of both monitor-sizes.
On earlier PB-Versions or other window managers the window is 'window'-centered - just as it is presumably meant by PB.
This is imho not completely bug-free on PB-side.
Charly
I can confirm this behaviour, but with restriction.
Only certain (or one?) window manager are concerned.
On my Mint KDE with PB > 5.4 the Windows with #PB_Window_ScreenCentered are (in Linux terms) 'Screen'-centered. 'Screen' means the sum of both monitor-sizes.
On earlier PB-Versions or other window managers the window is 'window'-centered - just as it is presumably meant by PB.
This is imho not completely bug-free on PB-side.
Charly
PureBasic 5.4-5.7, Linux: (X/L/K)Ubuntus+Mint - Windows XP (32Bit)
PureBasic Linux-API-Library & Viewer: http://www.chabba.de
PureBasic Linux-API-Library & Viewer: http://www.chabba.de
Re: New window location
Thanks for verifying this. The whole GTK2 vs GTK3 thing is odd as well. When using only PB native calls, I would assume that windows would render about the same between GTK2 and GTK3 and Windows. The window dressings will be different, that is understood, but I am seeing gadgets sized and located differently (when using GTK3). No matter in this case as simply specifying GTK2 as a default solves the problem, but making an app cross platform if one wants to use GTK3 would almost necessitate just coding 2 separate apps, or at least 2 different GUIs. I cannot imaging the challenges the the PB maintainers face in having all of this work seamlessly so I am not complaining, only pointing out what it is I am experiencing at this end. I am on Linux Mint 17.3 Cinnamon.Oma wrote:Hi harkon,
I can confirm this behaviour, but with restriction.
Only certain (or one?) window manager are concerned.
On my Mint KDE with PB > 5.4 the Windows with #PB_Window_ScreenCentered are (in Linux terms) 'Screen'-centered. 'Screen' means the sum of both monitor-sizes.
On earlier PB-Versions or other window managers the window is 'window'-centered - just as it is presumably meant by PB.
This is imho not completely bug-free on PB-side.
Charly
Missed it by that much!!
HK
HK
Re: New window location
*** Update ***
I've gotten nowhere on the screen centered issue or why programs compiled using GTK3 look different than those compiled using GTK2. This makes the forms editor good only as a guideline. That's still better than nothing, but not as dummy proof as under Windows. C'est la vie, no huge deal. I have worked around the screen centering issue, for now, by just centering on Desktop #0, using ExamineDesktop() and getting width and height and calculating center. This works for now as long as I need it opened on my primary desktop. Getting the mouse coordinates could help me figure out which monitor I'm on and go from there, but for now this works.
I liked the way screen centering worked before this was changed.
I've gotten nowhere on the screen centered issue or why programs compiled using GTK3 look different than those compiled using GTK2. This makes the forms editor good only as a guideline. That's still better than nothing, but not as dummy proof as under Windows. C'est la vie, no huge deal. I have worked around the screen centering issue, for now, by just centering on Desktop #0, using ExamineDesktop() and getting width and height and calculating center. This works for now as long as I need it opened on my primary desktop. Getting the mouse coordinates could help me figure out which monitor I'm on and go from there, but for now this works.
I liked the way screen centering worked before this was changed.
Missed it by that much!!
HK
HK