-
-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#3476 shadow specific windows from x11 sessions
- Loading branch information
Showing
4 changed files
with
171 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
# This file is part of Xpra. | ||
# Copyright (C) 2012-2021 Antoine Martin <[email protected]> | ||
# Copyright (C) 2012-2022 Antoine Martin <[email protected]> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
||
|
@@ -40,6 +40,7 @@ def __init__(self, root_window, capture=None): | |
super().__init__() | ||
self.capture = capture | ||
self.root = root_window | ||
self.window_matches = None | ||
self.mapped = [] | ||
self.pulseaudio = False | ||
self.sharing = True | ||
|
@@ -105,6 +106,8 @@ def do_print_screen_info(self, display, w, h): | |
log.info(" on display '%s' of size %ix%i", display, w, h) | ||
else: | ||
log.info(" on display of size %ix%i", w, h) | ||
if self.window_matches: | ||
return | ||
try: | ||
l = len(self._id_to_window) | ||
except AttributeError as e: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# This file is part of Xpra. | ||
# Copyright (C) 2008, 2009 Nathaniel Smith <[email protected]> | ||
# Copyright (C) 2010-2021 Antoine Martin <[email protected]> | ||
# Copyright (C) 2010-2022 Antoine Martin <[email protected]> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
||
|
@@ -370,6 +370,43 @@ cdef class X11WindowBindingsInstance(X11CoreBindingsInstance): | |
return XDefaultRootWindow(self.display) | ||
|
||
|
||
def get_all_x11_windows(self): | ||
cdef Window root = XDefaultRootWindow(self.display); | ||
return self.get_all_children(root) | ||
|
||
def get_all_children(self, Window xid): | ||
cdef Window root = XDefaultRootWindow(self.display) | ||
cdef Window parent = 0 | ||
cdef Window * children = <Window *> 0 | ||
cdef unsigned int i, nchildren = 0 | ||
windows = [] | ||
try: | ||
if not XQueryTree(self.display, | ||
xid, | ||
&root, &parent, &children, &nchildren): | ||
return [] | ||
for i in range(nchildren): | ||
windows.append(children[i]) | ||
finally: | ||
if nchildren > 0 and children != NULL: | ||
XFree(children) | ||
for window in tuple(windows): | ||
windows += self.get_all_children(window) | ||
return windows | ||
|
||
|
||
def get_absolute_position(self, Window xid): | ||
cdef Window root = XDefaultRootWindow(self.display) | ||
cdef int dest_x = 0, dest_y = 0 | ||
cdef Window child = 0 | ||
if not XTranslateCoordinates(self.display, xid, | ||
root, | ||
0, 0, | ||
&dest_x, &dest_y, &child): | ||
return None | ||
return dest_x, dest_y | ||
|
||
|
||
def MapWindow(self, Window xwindow): | ||
self.context_check() | ||
XMapWindow(self.display, xwindow) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters