I intend to change the monitor where I show a fullscreen window. This is especially interesting when having a projector hooked up.
I've tried to use fullscreen_on_monitor
but that doesn't produce any visible changes.
Here is a non-working example:
#!/usr/bin/env python
import sys
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from gi.repository import Gdk
w = Gtk.Window()
screen = Gdk.Screen.get_default()
print ("Montors: %d" % screen.get_n_monitors())
if len(sys.argv) > 1:
n = int(sys.argv[1])
else:
n = 0
l = Gtk.Button(label="Hello, %d monitors!" % screen.get_n_monitors())
w.add(l)
w.show_all()
w.fullscreen_on_monitor(screen, n)
l.connect("clicked", Gtk.main_quit)
w.connect("destroy", Gtk.main_quit)
Gtk.main()
I get to see the window on the very same monitor (out of 3), regardless of the value I provide.
My question is: how do I make the fullscreen window appear on a different monitor?