Example #1
0
def get_monitor_screen(window: Gtk.Window):
    display = window.get_display()
    logger.debug('Display: {}, {}', display, display.get_name())
    # FIXME: It returns wrong monitor
    monitor = display.get_monitor_at_window(window.get_window())
    geo = monitor.get_geometry()
    w, h = geo.width, geo.height
    logger.debug('Monitor size: {}', (w, h))
    return (w, h)
Example #2
0
def present_window(window: Gtk.Window):
    if window.is_active():
        return

    timestamp = Gtk.get_current_event_time()
    if timestamp == 0:
        from gi.repository import GdkX11
        timestamp = GdkX11.x11_get_server_time(window.get_window())

    window.present_with_time(timestamp)