From 29f0a6b6f2b6f6f2f2fb2b6019f22f459ca5fa83 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 5 Aug 2024 15:51:37 +0700 Subject: [PATCH] #4317 move GDKX11Window to its own module --- xpra/x11/gtk/__init__.py | 8 -------- xpra/x11/gtk/clipboard.py | 2 +- xpra/x11/gtk/native_window.py | 14 ++++++++++++++ xpra/x11/gtk/tray.py | 2 +- xpra/x11/gtk/wm.py | 2 +- 5 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 xpra/x11/gtk/native_window.py diff --git a/xpra/x11/gtk/__init__.py b/xpra/x11/gtk/__init__.py index e6e880e62a..21fcf7e99d 100644 --- a/xpra/x11/gtk/__init__.py +++ b/xpra/x11/gtk/__init__.py @@ -2,11 +2,3 @@ # Copyright (C) 2013-2019 Antoine Martin # Xpra is released under the terms of the GNU GPL v2, or, at your option, any # later version. See the file COPYING for details. - - -def GDKX11Window(*args, **kwargs): - from xpra.os_util import gi_import - GdkX11 = gi_import("GdkX11", "3.0") - # pylint: disable=import-outside-toplevel - from xpra.gtk.window import new_GDKWindow - return new_GDKWindow(GdkX11.X11Window, *args, **kwargs) diff --git a/xpra/x11/gtk/clipboard.py b/xpra/x11/gtk/clipboard.py index 08cd3ef305..ba30f120b9 100644 --- a/xpra/x11/gtk/clipboard.py +++ b/xpra/x11/gtk/clipboard.py @@ -12,7 +12,7 @@ from xpra.gtk.error import xsync, xswallow from xpra.gtk.gobject import n_arg_signal, one_arg_signal from xpra.gtk.util import get_default_root_window -from xpra.x11.gtk import GDKX11Window +from xpra.x11.gtk.native_window import GDKX11Window from xpra.x11.gtk.bindings import ( add_event_receiver, remove_event_receiver, diff --git a/xpra/x11/gtk/native_window.py b/xpra/x11/gtk/native_window.py new file mode 100644 index 0000000000..b7635f44b0 --- /dev/null +++ b/xpra/x11/gtk/native_window.py @@ -0,0 +1,14 @@ +# This file is part of Xpra. +# Copyright (C) 2013-2019 Antoine Martin +# Xpra is released under the terms of the GNU GPL v2, or, at your option, any +# later version. See the file COPYING for details. + +from xpra.os_util import gi_import + +GdkX11 = gi_import("GdkX11", "3.0") + + +def GDKX11Window(*args, **kwargs) -> GdkX11.X11Window: + # pylint: disable=import-outside-toplevel + from xpra.gtk.window import new_GDKWindow + return new_GDKWindow(GdkX11.X11Window, *args, **kwargs) diff --git a/xpra/x11/gtk/tray.py b/xpra/x11/gtk/tray.py index 344f6ecb1a..99a6ff6a38 100644 --- a/xpra/x11/gtk/tray.py +++ b/xpra/x11/gtk/tray.py @@ -11,7 +11,7 @@ from xpra.os_util import gi_import from xpra.gtk.gobject import one_arg_signal from xpra.gtk.error import xsync, xlog -from xpra.x11.gtk import GDKX11Window +from xpra.x11.gtk.native_window import GDKX11Window from xpra.x11.gtk.prop import prop_set, prop_get, raw_prop_set from xpra.gtk.util import get_default_root_window from xpra.x11.bindings.window import constants, X11WindowBindings diff --git a/xpra/x11/gtk/wm.py b/xpra/x11/gtk/wm.py index c5dc90399b..4dadacbab8 100644 --- a/xpra/x11/gtk/wm.py +++ b/xpra/x11/gtk/wm.py @@ -14,7 +14,7 @@ from xpra.gtk.gobject import no_arg_signal, one_arg_signal from xpra.gtk.util import get_default_root_window from xpra.x11.common import Unmanageable -from xpra.x11.gtk import GDKX11Window +from xpra.x11.gtk.native_window import GDKX11Window from xpra.x11.gtk.selection import ManagerSelection from xpra.x11.gtk.prop import prop_set, prop_get, prop_del, raw_prop_set, prop_encode from xpra.x11.gtk.world_window import WorldWindow, destroy_world_window