Skip to content

Commit

Permalink
#718: add test to raise a second window, similar to the problem with …
Browse files Browse the repository at this point in the history
…the Java code - except this works as GTK uses _NET_ACTIVE_WINDOW instead of ConfigureRequest

git-svn-id: https://xpra.org/svn/Xpra/trunk@8050 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Nov 4, 2014
1 parent 6f43f84 commit 3986a62
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions src/tests/xpra/test_apps/test_window_raise.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,33 @@

width = 400
height = 200

def main():
other = gtk.Window(gtk.WINDOW_TOPLEVEL)
other.set_title("Other")
other.set_size_request(width/2, height/2)
other.connect("delete_event", gtk.mainquit)
other.show_all()

window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.set_title("Main")
window.set_size_request(width, height)
window.connect("delete_event", gtk.mainquit)
vbox = gtk.VBox(False, 0)
hbox = gtk.HBox(False, 0)
vbox.pack_start(hbox, expand=False, fill=False, padding=10)
btn = gtk.Button("raise me in 5 seconds")
hbox.pack_start(btn, expand=False, fill=False, padding=10)
def move_clicked(*args):
gobject.timeout_add(5*1000, window.present)
btn.connect('clicked', move_clicked)
def add_button(title, callback):
hbox = gtk.HBox(False, 0)
vbox.pack_start(hbox, expand=False, fill=False, padding=10)
btn = gtk.Button(title)
hbox.pack_start(btn, expand=False, fill=False, padding=10)
def on_clicked(*args):
def after_delay():
print("**********************************************\nCALLING %s" % callback)
callback()
print("DONE\n**********************************************")
gobject.timeout_add(5*1000, after_delay)
btn.connect("clicked", on_clicked)
add_button("raise Main in 5 seconds", window.present)
add_button("raise Other in 5 seconds", other.present)
window.add(vbox)
window.show_all()
gtk.main()
Expand Down

0 comments on commit 3986a62

Please sign in to comment.