It is currently Fri Dec 06, 2019 10:36 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: New window location
PostPosted: Thu Aug 31, 2017 3:25 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Nov 23, 2005 5:48 pm
Posts: 213
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?

_________________
Missed it by that much!!
HK


Top
 Profile  
Reply with quote  
 Post subject: Re: New window location
PostPosted: Thu Aug 31, 2017 4:54 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 3145
Location: Boston, MA
Check your PureBasic.prefs contents before starting IDE.
Code:
[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


Top
 Profile  
Reply with quote  
 Post subject: Re: New window location
PostPosted: Thu Aug 31, 2017 5:32 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Nov 23, 2005 5:48 pm
Posts: 213
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;
Code:
OpenWindow(#Window_Loading, 537, 459, 206, 107, "Loading",  #PB_Window_BorderLess | #PB_Window_ScreenCentered )


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.

_________________
Missed it by that much!!
HK


Top
 Profile  
Reply with quote  
 Post subject: Re: New window location
PostPosted: Thu Aug 31, 2017 6:03 pm 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5755
Location: Berlin - Germany
Quote:
This behavior is new to PB versions after 5.31.

You are using GTK3 per Default, the Default for PB5.31 is GTK2!

Change the subsystem to GTK2.

_________________
PureBasic 5.71 | SpiderBasic 2.21 | Windows 10 Pro (x64) | Linux Mint 19.2 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: New window location
PostPosted: Thu Aug 31, 2017 6:28 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Nov 23, 2005 5:48 pm
Posts: 213
ts-soft wrote:
Quote:
This behavior is new to PB versions after 5.31.

You are using GTK3 per Default, the Default for PB5.31 is GTK2!

Change the subsystem to GTK2.


To be clear, everything works really well when compiled with PB5.31.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: New window location
PostPosted: Thu Aug 31, 2017 7:20 pm 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5755
Location: Berlin - Germany
The old subsystem was GTK2, the new one is GTK3. To compatible with old systems, use subsytem GTK2

Subsystems

_________________
PureBasic 5.71 | SpiderBasic 2.21 | Windows 10 Pro (x64) | Linux Mint 19.2 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: New window location
PostPosted: Thu Aug 31, 2017 7:50 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Nov 23, 2005 5:48 pm
Posts: 213
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?

_________________
Missed it by that much!!
HK


Top
 Profile  
Reply with quote  
 Post subject: Re: New window location
PostPosted: Thu Aug 31, 2017 8:20 pm 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5755
Location: Berlin - Germany
Quote:
Any thoughts as to why it still wants to open centered on both screens, and how to get it not to do that?

This is a linux-setting and have nothing to do with pb!

_________________
PureBasic 5.71 | SpiderBasic 2.21 | Windows 10 Pro (x64) | Linux Mint 19.2 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: New window location
PostPosted: Thu Aug 31, 2017 8:52 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Nov 23, 2005 5:48 pm
Posts: 213
ts-soft wrote:
Quote:
Any thoughts as to why it still wants to open centered on both screens, and how to get it not to do that?

This is a linux-setting and have nothing to do with pb!


Thanks again for your help.
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:
  If StartDrawing(WindowOutput(Window))
     Color.i = Point(5, 5)
    StopDrawing()
  EndIf


Returns a value when compiled with v5.31, in v5.45LTS (gtk2) this generates an error. Using v5.45LTS in Windows it does return a value as well.

I don't know but it seems as there is more to this.

_________________
Missed it by that much!!
HK


Top
 Profile  
Reply with quote  
 Post subject: Re: New window location
PostPosted: Thu Aug 31, 2017 10:58 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 2053
Location: Germany
Drawing on WindowOutput don´t work at some functions with gtk3. Please use subsystem gtk2.

Or drawing on CanvasGadget...

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: New window location
PostPosted: Thu Aug 31, 2017 11:24 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Nov 23, 2005 5:48 pm
Posts: 213
mk-soft wrote:
Drawing on WindowOutput don´t work at some functions with gtk3. Please use subsystem gtk2.

Or drawing on CanvasGadget...


Thanks. I am using gtk2 as a subsystem. That doesn't seem to make a difference for that problem specifically.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: New window location
PostPosted: Fri Sep 01, 2017 2:26 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Jun 26, 2014 9:17 am
Posts: 308
Location: Germany
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

_________________
PureBasic 5.4-5.7, Linux: (X/L/K)Ubuntus+Mint - Windows XP (32Bit)
PureBasic Linux-API-Library & Viewer: http://www.chabba.de


Top
 Profile  
Reply with quote  
 Post subject: Re: New window location
PostPosted: Fri Sep 01, 2017 2:53 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Nov 23, 2005 5:48 pm
Posts: 213
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


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.

_________________
Missed it by that much!!
HK


Top
 Profile  
Reply with quote  
 Post subject: Re: New window location
PostPosted: Thu Sep 07, 2017 11:39 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Nov 23, 2005 5:48 pm
Posts: 213
*** 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.

_________________
Missed it by that much!!
HK


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye