xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #2539: header_bar_bug.py

File header_bar_bug.py, 1.2 KB (added by Antoine Martin, 11 months ago)

reproduce the bug using a fake client

Line 
1#!/usr/bin/env python
2# Copyright (C) 2020 Antoine Martin <antoine@xpra.org>
3# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
4# later version. See the file COPYING for details.
5
6from xpra.platform import program_context
7from xpra.util import typedict
8from tests.xpra.clients.fake_client import FakeClient
9
10import gi
11gi.require_version("Gtk", "3.0")
12from gi.repository import Gtk, Gio, GLib   #pylint: disable=wrong-import-position
13
14
15def main():
16    with program_context("header-bar", "Header Bar"):
17        from xpra.client.gtk3.client_window import ClientWindow
18        client = FakeClient()
19        client.source_remove = GLib.source_remove
20        client.idle_add = GLib.idle_add
21        client.timeout_add = GLib.timeout_add
22        W = 640
23        H = 480
24        x = ClientWindow(client, -1, -1, 1,
25                         100, 100, W, H, W, H,
26                         typedict(), False, typedict(),
27                         1, 2**16, None, 24)
28        def draw():
29            x.draw_region(0, 0, W, H, "rgb24", b"\0AB"*W*H, W*3, 1, typedict(), [])
30            x.repaint(0, 0, W, H)
31        GLib.timeout_add(1000, draw)
32        #GLib.idle_add(w.show_with_focus)
33        x.show()
34        Gtk.main()
35
36
37if __name__ == "__main__":
38    main()