Page 1 of 1

5.40LTS - Moving a window shows it at 0,0 coordinates

Posted: Thu Oct 22, 2015 2:09 pm
by Niffo
Moving a window shows it at 0,0 coordinates half a second :

Code: Select all

OpenWindow(0, 100, 100, 300, 200, "gtk api test")
ResizeWindow(0, 150, 150, #PB_Ignore, #PB_Ignore)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
(seen on Debian 8-64 / Gnome with PB 5.40LTS 64 bits)

Re: 5.40LTS - Moving a window shows it at 0,0 coordinates

Posted: Thu Oct 22, 2015 2:53 pm
by pwd
Not a bug, IMHO.

Code: Select all

OpenWindow(0, 100, 100, 300, 200, "gtk api test", #PB_Window_Invisible)
ResizeWindow(0, 150, 150, #PB_Ignore, #PB_Ignore)
HideWindow(0, #False)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow


To be sure there is no bug, try this:

Code: Select all

If OpenWindow(0, 0, 0, 230, 90, "...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

ButtonGadget  (1, 10, 10, 200, 20, "Click me")

Repeat
  Event = WaitWindowEvent()
  If Event = #PB_Event_Gadget
    ResizeWindow(0, Random(500, 100), Random(500, 100), #PB_Ignore, #PB_Ignore)
  EndIf
Until Event = #PB_Event_CloseWindow
EndIf

Re: 5.40LTS - Moving a window shows it at 0,0 coordinates

Posted: Fri Nov 20, 2015 2:24 pm
by Fred
I don't think it's a bug as you displayed it before performing the move, so yes it can be shown until the move is handled by the window manager.

Re: 5.40LTS - Moving a window shows it at 0,0 coordinates

Posted: Fri Nov 20, 2015 2:32 pm
by Niffo
Sorry my sample code was not very complete because I wanted to simplify it at maximum.
The same occurs with a hidden Window, see the snippet bellow :

Code: Select all

OpenWindow(0, 100, 100, 300, 200, "gtk api test", #PB_Window_Invisible)
ResizeWindow(0, 150, 150, #PB_Ignore, #PB_Ignore)
HideWindow(0, #False)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Obviously this problem does not occur with gtk2 nor with others OSs.

Re: 5.40LTS - Moving a window shows it at 0,0 coordinates

Posted: Fri Nov 20, 2015 2:41 pm
by Fred
I see. The problem is with GTK3, which can't move an hidden window, so it's done when unhiding it. So sometimes you can see the refresh

http://www.purebasic.fr/english/viewtop ... 23&t=62753

Re: 5.40LTS - Moving a window shows it at 0,0 coordinates

Posted: Fri Nov 20, 2015 2:45 pm
by Niffo
Noted, thank you.

Re: 5.40LTS - Moving a window shows it at 0,0 coordinates

Posted: Sat Nov 21, 2015 2:04 pm
by uwekel
Fred wrote:I see. The problem is with GTK3, which can't move an hidden window, so it's done when unhiding it. So sometimes you can see the refresh
This is the main reason why i stick on 5.31.
Will you fix it?

Re: 5.40LTS - Moving a window shows it at 0,0 coordinates

Posted: Sat Nov 21, 2015 2:06 pm
by Fred
The problem is we can't fix it, it seems to be a GTK3 oddity as it works properly with GTK2.

Re: 5.40LTS - Moving a window shows it at 0,0 coordinates

Posted: Sat Nov 21, 2015 3:22 pm
by Little John
uwekel wrote:
Fred wrote:I see. The problem is with GTK3, which can't move an hidden window, so it's done when unhiding it. So sometimes you can see the refresh
This is the main reason why i stick on 5.31.
I think with PB 5.40, we can also use GTK 2 as subsystem. Or is this wrong?

Re: 5.40LTS - Moving a window shows it at 0,0 coordinates

Posted: Sat Nov 21, 2015 3:42 pm
by uwekel
I don't know exactly how you coded this, but i guess you are calling the gtk_widget_show_all() method even if the #PB_Window_Invisible flag is set. I tried to reproduce this behaviour with python and got this snippet:

Code: Select all

from gi.repository import Gtk

w = Gtk.Window()
w.set_default_size(300, 300)
w.move(200, 200) # move this line after show_all, and you see the same as on PureBasic
w.show_all()
w.connect('destroy', Gtk.main_quit)
Gtk.main()
If you run this, everything is ok, but if you move the window after the show_all(), you see the same prblem as in PB.

Re: 5.40LTS - Moving a window shows it at 0,0 coordinates

Posted: Sat Nov 21, 2015 7:00 pm
by Fred
Could be a workaround then to do the show_all() in HideWindow() if the invisible flag is used. I will test it and get back to you, thanks for investigating !

Re: 5.40LTS - Moving a window shows it at 0,0 coordinates

Posted: Wed Dec 02, 2015 8:26 pm
by uwekel
With PB 5.31 and gtk3 subsystem it works fine, so maybe it is not a GTK3 issue.

Re: 5.40LTS - Moving a window shows it at 0,0 coordinates

Posted: Thu Dec 03, 2015 4:08 pm
by Fred
I tried the workaround but it doesn't change anything here.

Re: 5.40LTS - Moving a window shows it at 0,0 coordinates

Posted: Wed Aug 24, 2016 4:58 am
by Niffo
For me, it is fixed in 5.43. May be the same thing than that ? : http://www.purebasic.fr/english/viewtop ... 53#p491384

Re: 5.40LTS - Moving a window shows it at 0,0 coordinates

Posted: Wed Aug 24, 2016 5:27 am
by Fred
Could be