Skip to content

Commit

Permalink
#1995 use xid for the parking window
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed May 18, 2023
1 parent f7c85a8 commit 05c6cc2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion xpra/x11/gtk_x11/wm.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def _manage_client(self, xid):
log("_manage_client(%x)", xid)
desktop_geometry = self.root_get("_NET_DESKTOP_GEOMETRY", ["u32"], True, False)
root = get_default_root_window()
win = WindowModel(root, xid, desktop_geometry, self.size_constraints)
win = WindowModel(root.get_xid(), xid, desktop_geometry, self.size_constraints)
except Exception as e:
if LOG_MANAGE_FAILURES or not isinstance(e, Unmanageable):
l = log.warn
Expand Down
9 changes: 4 additions & 5 deletions xpra/x11/models/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ class WindowModel(BaseWindowModel):
_internal_property_names = BaseWindowModel._internal_property_names+["children"]
_MODELTYPE = "Window"

def __init__(self, parking_window, xid:int, desktop_geometry, size_constraints=None):
def __init__(self, parking_window_xid:int, xid:int, desktop_geometry, size_constraints=None):
"""Register a new client window with the WM.
Raises an Unmanageable exception if this window should not be
managed, for whatever reason. ATM, this mostly means that the window
died somehow before we could do anything with it."""

super().__init__(xid)
self.parking_window = parking_window
self.parking_window_xid = parking_window_xid
self.corral_xid : int = 0
self.desktop_geometry = desktop_geometry
self.size_constraints = size_constraints or (0, 0, MAX_WINDOW_SIZE, MAX_WINDOW_SIZE)
Expand All @@ -190,8 +190,7 @@ def setup(self):
# clamp this window to the desktop size:
x, y = self._clamp_to_desktop(ox, oy, ow, oh)
geomlog("setup() clamp_to_desktop(%s)=%s", ogeom, (x, y))
parking_xid = self.parking_window.get_xid()
self.corral_xid = X11Window.CreateCorralWindow(parking_xid, self.xid, x, y)
self.corral_xid = X11Window.CreateCorralWindow(self.parking_window_xid, self.xid, x, y)
log("setup() corral_xid=%#x", self.corral_xid)
prop_set(self.corral_xid, "_NET_WM_NAME", "utf8", "Xpra-CorralWindow-%#x" % self.xid)
X11Window.substructureRedirect(self.corral_xid)
Expand Down Expand Up @@ -462,7 +461,7 @@ def hide(self):
with xsync:
if X11Window.is_mapped(self.corral_xid):
X11Window.Unmap(self.corral_xid)
X11Window.Reparent(self.corral_xid, self.parking_window.get_xid(), 0, 0)
X11Window.Reparent(self.corral_xid, self.parking_window_xid, 0, 0)
X11Window.sendConfigureNotify(self.xid)


Expand Down

0 comments on commit 05c6cc2

Please sign in to comment.